Saravanan666/pypi-org huggingface dataset:
Package: dj-apibrowser
Generic GUI for any RESTful APISee the demo athttps://apibrowser-demo.herokuapp.com/(source).dj-apibrowseritself is just a trivial middleware that servesAPIBrowser, which is written in JS, and works purely in the web browser. It returns the APIBrowser HTML code whenever a web browser navigates to a page.Installationpipinstalldj-apibrowsersettings.pyAdddj_apibrowser.APIBrowserServerMiddlewareto the list ofMIDDLEWAREs.If neccesary, specify on which endpoints should we serve APIBrowser. Default config means that this is disabled on paths starting from /admin/, and enabled on all other paths:API_ENDPOINTS = [
    ('admin/', False),
    ('', True),
]
Package: djapps
djappsallows you to load your django apps by their app names rather
than by the module path. This is particularly useful if you don’t know where
modules will be installed or if you plan to allow overriding of your apps (eg
a user replaces yourfoo.barapp withmyfoo.bar).UsageIf you have a django app calledbarin a package calledfoo(such that
you would addfoo.barto your INSTALLED_APPS) then you can get hold ofbarwithout knowing its full module path:import djapps.bardjappshooks into python’s regular import mechanism so all the normal
ways to import things will work:from djapps.bar import models
from djapps.bar.models import MyModel as ThisIsMyModelYour app names in a django project should all be unqiue, djapps won’t
work if they are not (but django won’t like that either).InstallationUse your favorite install method, for example:$ pip install djappsYou do not need to add djapps to your INSTALLED_APPS, just start using it.
Package: djappsettings
DjAppSettings: Per-App Settings for DjangoI hate pasting blobs into my settings.py every time I enable an app.This is a Python module which provides a sane way for reusable Django apps to configure themselves.It’s a drop-in replacement for thedjango.conf.settingsclass. You can fetch all of your project, app, and global default settings via a singlesettingsobject.It doesn’t touch your project’s settings module, and existing Django apps are free to ignore it. Your app can even fall back to the usual method if this module isn’t available.App settings are prevented from clobberingbuilt-in settings. They can onlyaddsettings.Project settings (inDJANGO_SETTINGS_MODULE) override app settings.Using per-app prefixes is a good idea, but not mandatory.But, butI’m aware ofJared Forsyth’sdjango-appsettings, and I think it’s lovely but wrong. Project settings should not be editable in the Django admin.I’m also aware that this feature has been rejected numerous times on the Django trac. But pasting a bunch of junk into mysettings.pyeach time I add an app is a pain in the ass.Checking for a setting (viasettings.hasattr), and falling back to a hard-coded default value is a terrible solution, because your defaults are duplicated and buried. They should be easily discoverable.UsageWhere you would usually do something like:from django.conf import settings
getattr(settings, "MY_SETTING", "DEFAULT")Create asettings.pyfile in your app, containing:MY_SETTING = "DEFAULT"and do something like:from djappsettings import settings
settings.MY_SETTINGIf you’d like to support this module where available, but fall back to the usual method if not, justtryit:try: from djappsettings import settings
except: from django.conf import settings
settings.MY_SETTINGInstallationVia Pip:$ pip install djappsettingsVia GitHub:$ git clone git://github.com/adammck/djappsettings.git
$ python djangoappsettings/setup.py installTestingInstall tox and run the tests:$ git clone git://github.com/adammck/djappsettings.git
$ pip install tox
$ cd djappsettings
$ toxBugs?This was created to scratch an itch for theRapidSMSproject. I hope it will be useful to you. Use it at your own risk. (But do use it, because it’swaybetter.)Patches and pull requests are very welcome.
Please file bugs onGitHub.Licensedjappsettings is free software, available under the BSD license.
Package: djaptcha
# DjaptchaDjaptcha is a Django plugin that implements the `captcha` python package by `lepture`. It is designed to store user sessions in the database and generate random captcha images based on these sessions.## InstallationIf you haven't already, `pip install captcha` and then use the following to install `djaptcha`:```bash$ pip install djaptcha```Now add `djaptcha` to the list of installed plugins in your Django app.```pythonINSTALLED_APPS = [...'djaptcha',...]```*__Note__: You must have sessions enabled and configured in your django app to use this plugin. You also must have configured a database. End users must have cookies enabled in their browser to be able to generate captcha images.*Finally, run `python manage.py make_migrations` and `python manage.py migrate` to create the djaptcha database models.## SettingsIt's recommended that you change the following settings to suit your specific project needs:```python# These are the default valuesDJAPTCHA_MAX_TRIES = 10 # Maximum amount of tries before user can't generate new captchasDJAPTCHA_LENGTH = 6 # Length of the captcha (example: 'F7W8MG' has a length of 6)DJAPTCHA_CHARACTERS = 'ABCEFGHJKLMNPRSTUVWXYZ' # Characters allowed in the captchaDJAPTCHA_URL = STATIC_URL + 'captcha/' # The URL that end users can access captcha images atDJAPTCHA_DIR = 'static/captcha/' # The local directory your captcha images should be stored inDJAPTCHA_EXPIRY = 5 # Length in minutes before the captcha and image are deletedDJAPTCHA_COOKIES_TEMPLATE = 'djaptcha/cookies.html' # The template that tells users to enable cookies```## UsageTo add a captcha field to your form you need to follow these steps:1. Add the `CaptchaMixin` to your View class. *`CaptchaMixin` should be on the far left to ensure it's methods have priority*```pythonfrom djaptcha.views import CaptchaMixinclass MyView(CaptchaMixin, FormView):form_class = MyForm# View logic here```2. Add the `CaptchaForm` to your Form class. *`CaptchaForm` should be on the far left to ensure the captcha is validated before any other data.*```pythonfrom djaptcha.forms import CaptchaFormclass MyForm(CaptchaForm, Form)# Form fields and logic here.pass```3. Djaptcha also provides some context variables to use in your views. You can use them like so in your form templates:```html<!--captcha_refresh_link : a path to the url that will refresh the captcha imagecaptcha_retries : the number of retries the user has left--><form method="post">{% csrf_token %}{{ form.as_p }}<p><a href="{{ captcha_refresh_link }}">Refresh</a></p><p>{{ captcha_retries }} retries left.</p><button type="submit">Submit</button></form>```
Package: djapy
IntroductionThis is the documentation for theDjapylibrary, which is designed to let you make RESTful APIs
within Django with as no boilerplate, using plain Python and Django, with the supremacy of Pydantic.Djapy is molded according toDjango's philosophy of "batteries included", and is designed to
be as simple as possible to use, while still being powerful enough to handle most use cases.@djapifydefget_user(request)->{200:UserSchema,404:str}:returnrequest.userIt's that simple!InstallationDjapy is available on PyPI, and can be installed withpip:pipinstalldjapyCreating a new projectTo create a new project, run the following command:django-adminstartproject<project_name>More on this in theUsagesection.
Package: djarango
djarangoArangoDB Backend Interface for DjangoInstallation$ pip install djarango
$ # check install status
$ djarango statusConfigure settings.py (example)DATABASES_ARANGO = {
    'default': {
        'ENGINE'       : 'django.db.backends.arangodb',# Backend implementation
        'NAME'         : 'graphdb',                 # DB name
        'HOST'         : 'localhost',               # Single-mode host; 'localhost' is default.
        'PORT'         : '8529',                    # Port 8529 is the default; optional.
        'USER'         : 'someuser',
        'PASSWORD'     : 'somepassword',
        'TIME_ZONE'    : 'UTC',
#       'USE_TZ'       : True,
        'CONN_MAX_AGE' : 60,
        'AUTOCOMMIT'   : True,
        # Arango supports clustered DB
        # If "HOSTS" is provided, it will override "HOST".
#       'HOSTS'     : [ '172.28.0.1', '172.28.0.2', '172.28.0.3', '172.28.0.4', ],
#       'HOST_RESOLVER' : 'rounrobin',      # Options are 'roundrobin' | 'random'
    }
}Add Edge Fields to a Django model (example)from django.db.backends.arangodb.fields.edges import EdgeField

# Djarango treats every Django model as an ArangoDB collection.
class ModelA(models.Model):
    title           = models.CharField(max_length = 50)
    description     = models.CharField(max_length = 200)
    counta          = models.IntegerField(default = 0)

    # EdgeField creates an edge from ModelA to ModelB
    # ModelA and ModelB are ArangoDB nodes, by default.
    # graph_name specifies the name of the graph that will be created in
    # ArangoDB containing the model (node) collections and edges.
    modelb          = EdgeField('ModelB', graph_name='ABTest')

class ModelB(models.Model):
    title           = models.CharField(max_length = 50)
    description     = models.CharField(max_length = 200)
    countb          = models.IntegerField(default = 0)

    # The EdgeFields are unidirectional.  In order to create a bidirectional
    # edge, there must be an EdgeField in each direction.
    # Specify the same graph_name so that the edges will be in the same graph.
    # Otherwise, a graph name will be auto-generated: 'graph_modelb_modela'
    # and each edge will be in different graphs.
    modela          = EdgeField('ModelA', graph_name='ABTest')Design NotesAdditional information about design and the edge field implementation is in fields.md
Package: djasa
Djasa: Seamless Rasa Integration for DjangoDjasa is a Django package designed to seamlessly integrate Rasa into Django projects. Our primary goal is to provide a modular, maintainable, and easy-to-use solution for developers aiming to incorporate chatbot functionalities.Key FeaturesPlug-and-Play Integration: Easily integrate Rasa into any Django project and leverage Django's ORM for data management.Unified Management Dashboard: A visual interface for training, testing, and managing Rasa models. Plus, an editor for defining intents and responses.User Contextual Awareness: Utilize Django's authentication for personalized chatbot interactions and real-time data fetching.Feedback Loop Integration: Efficiently collect user feedback and set automated schedules for periodic Rasa model retraining.Installation (TBD)We are working diligently to provide a smooth installation process. Detailed installation steps will be provided soon.Setup (TBD)Our aim is to make the setup process intuitive and hassle-free. Detailed setup instructions will be added shortly.ContributionWe value community contributions and feedback. If you encounter any issues or have suggestions for improvements, please raise an issue or submit a pull request.LicenseMIT License. SeeLICENSEfor more details.
Package: dja_skel
IntroductionThis package addspaster createlike functionality to the djangomanage.pycommand.The full documentation can be found athttp://dja-skel.rtfd.orgThe project is hosted athttp://code.google.com/p/dja-skel/Changelog0.1 - Unreleasedpre-alpha release in order to gather somo external testing, opinions
and so on.
Package: djasmine
This app integrates Jasmine JavaScript tests with the Django test framework in a simple but effective DRY way. Using it
you can easily write and run tests that integrates your frontend and backend in a manner that is much easier to maintain
than selenium tests interacting with full web pages.You can either run individual jasmine spec files and check the result from within your Django test suit or open an url
from your devserver and run all specs at once, checking the result on the webpage.Getting startedAdd'djasmine'to yourINSTALLED_APPS:INSTALLED_APPS = [
    ...
    'djasmine',
]Include the djasmine URLconf in your projecturls.pylike this:url(r'^djasmine/', include('djasmine.urls')),Add the following to your project settings:import jasmine_core

JASMINE_SPEC_ROOT = BASE_DIR + '/path/to/spec/files'

STATICFILES_DIRS = [
    jasmine_core.__path__[0],
    JASMINE_SPEC_ROOT,
]Now you need to get your site’s JavasSript files included by the Djasmine runner view. You probably already have them written out in your'base.html'template or similar. In order to keep DRY you don’t want to provide this list again in some test setup file, and with Djasmine you don’t have to. Instead break out the list of javascript tags into a special top-level template called'javascripts.html'and include this in your'base.html'(or similar). This template will also be picked up by the spec runner code. If you are using e g compressor preprocessing tags the template include approach allows you to use these also for the test running code.For more specialized needs you can provide your own'djasmine/specrunner.html'template.Running Jasmine specs from Django testsCreate your Django tests by usingdjasmine.testcase.JasmineRunnerTestCaseas base class for your test cases. There is one
required class property,webdriver, that should specify the Selenium WebDriver class you wish to use for the test,
e gselenium.webdriver.firefox.webdriver.WebDriver.Run and check result of a Jasmine spec file with theassertSpecPassesmethod, which takes one argument: the name
of your spec file.Example:from djasmine.testcase import JasmineRunnerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver


class MyIntegrationTest(JasmineRunnerTestCase):
    webdriver = WebDriver

    def test_all_works_nicely(self):
        self.assertSpecPasses('my_tests.spec.js')  # Runs everything in this spec file and checks result

        ...
        (other checks of backend state possible here)
        ...
Package: djason
Django JSON SerializerThis is a django serializer that outputs sensible json to be sent to the
frontend, rather than intended as a serializer to a file. Here’s an example:>>> print s.serialize(User.objects.all(), relations=['groups'], excludes=['user_permissions'], indent=4)
[
    {
        "username": "dusty",
        "first_name": "",
        "last_name": "",
        "is_active": true,
        "is_superuser": true,
        "is_staff": true,
        "last_login": "2010-11-26 13:27:07",
        "groups": [
            {
                "pk": 1,
                "model": "auth.group",
                "name": "hello",
                "permissions": []
            }
        ],
        "pk": 1,
        "model": "auth.user",
        "password": "sha1$8f816$b4c8139100c314b46f1ca931858e4d6d5c61917f",
        "email": "dusty@linux.ca",
        "date_joined": "2010-11-22 17:55:40"
    }
]The default serializer (djason.json) spits out a list of objects as a string.
You can optionally have it return that list wrapped in an HttpResponse object
by passing the httpresponse=True option into serialize.There is a second serializer that takes two optional parameters, attributes (a
dict) and list_name (a string). This serializer returns a dictionary with any
key value attributes in the attributes dictionary, and one extra attribute
named list_name, which contains the list of objects as returned by the json
serializer. For example:>>> print s.serialize(User.objects.all(), relations=['groups'], excludes=['user_permissions'], indent=4, attributes={'somekey': 'somevalue'}, list_name="users")
{
    "somekey": "somevalue",
    "users": [
        {
            "username": "dusty",
            "first_name": "",
            "last_name": "",
            "is_active": true,
            "is_superuser": true,
            "is_staff": true,
            "last_login": "2010-11-26 13:27:07",
            "groups": [
                {
                    "pk": 1,
                    "model": "auth.group",
                    "name": "hello",
                    "permissions": []
                }
            ],
            "pk": 1,
            "model": "auth.user",
            "password": "sha1$8f816$b4c8139100c314b46f1ca931858e4d6d5c61917f",
            "email": "dusty@linux.ca",
            "date_joined": "2010-11-22 17:55:40"
        }
    ]
}This project was originally forked from:https://code.google.com/p/wadofstuff/wiki/DjangoFullSerializersThe original code produced a json format that was good for ./manage.py dump and
load, but wasn’t as suitable for sending data to a web client for processing
via ajax.What’s newVersion 0.2
- Added a serializer that allows including the serialized object inside an
object with extra attributes
- Added an ‘httpresponse’ option that will automatically wrap the serialized
stream in an HttpResponse object
Version 0.1First public releasedforked fromhttps://code.google.com/p/wadofstuff/wiki/DjangoFullSerializerspatched withhttps://code.google.com/p/wadofstuff/issues/detail?id=4Modified to output more sensible json for client consumptionTurned it into a django appAdded a template tag for rendering raw django
Package: djatalist
DjatalistTable of ContentsInstallationLicenseInstallationpipinstalldjatalistAdd to installed appsINSTALLED_APPS=['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','djatalist',]Licensedjatalistis distributed under the terms of theMITlicense.
Package: djatex
DescriptionThis project provides a python module named djatex which allows a
django app to generate a PDF document from a LaTeX template file.ExampleA small django project is included, with an example django app that generates a one-page PDF document in the LaTeX article style.To set up the example server, run the following commands:$ python3 -m venv pythonenv
$ source pythonenv/bin/activate
$ pip install django
$ python setup.py install
$ cd example
$ python manage.py migrate
$ python manage.py runserverYou should now have an http server running on localhost port 8000.  Connect to localhost:8000 with your web browser to generate a PDF.
Package: dj-audit
django-auditDjango Audit is a simple Django app that tracks and logs requests to your application.Quick StartInstall django-auditpipinstalldj-auditAdddj_auditto your INSTALLED_APPS:INSTALLED_APPS=[...,"dj_audit"]Adddj_auditmiddleware:MIDDLEWARE=[..."dj_audit.middleware.AuditMiddleware"]if you want access to the dj-audit dashboard, then add the following to yoururls.pyurlpatterns=[path("admin/",admin.site.urls),path("dj-audit/",include('dj_audit.urls'))]Run migratepythonmanage.pymigrateManagement commandsflush_auditlog- Cleans up dj-audit AuditLog tablepythonmanage.pyflush_auditlogCustomizing dj-auditYou have a couple options available to you to customizedj-audita bit. These should be defined in yoursettings.pyfile.AUDIT_LOG_TEMPLATE: str: If set, the template here will be render when the user visits the audit log page (i.e /dj-audit/audit-logs/)REQUEST_STATUS_TEMPLATE: str: If set, the template here will be render when the user visits the request status page (i.e /dj-audit/request-status/)IGNORE_FILE_EXTENSIONS: list: If set, the middleware will not log endpoints containing the extensions specified in the list.DEFAULT:['.svg', '.js', '.css', '.png', '.jpg', '.ico']AUDIT_LOG_DJ_REST_CONTENT_TYPES: list: content type of your Rest APIs.DEFAULT:['application/json', 'application/xml']AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200: bool: Specify if there are extra conditions you will like to check to validate if a request is successful or not.DEFAULT:FalseAUDIT_LOG_DJ_EXTRA_CONDITIONS: list: Extra conditions to set to determine if a request body is successful or not.DEFAULT:[]Testmaketestor with coveragemakecoverage_test
Package: djauto
Create Django projects the easy way. From installing django to creating app for project, One command, that’s all!Installpip install djautoHow to use it?djauto PROJECT_NAME APP_NAMEWhat does above command do?Downloads latest version of [Django](https://www.djangoproject.com/) using pipCreates a django project named “PROJECT_NAME” in current directory.Creates and add the app named “APP_NAME” in INSTALLED_APPS insettings.py.Asks if you want to create github repository. If yes, thenAsks for github username.Creates repo named PROJECT_NAME.Asks for short description.Asks for password.Adds all file and push it on github.We’re done!
Package: dj-auto-multitenant
customerscustomers is a Django app which is used to serve django tenant details. It is used to create tenants, schemas and doamin urls for respective tenants. :fire:Quick startInstall the packagepip install dj-auto-multitenant.Now make change in your DATABASE_ENGINEDATABASES = {
    'default': {
        'ENGINE': 'django_tenants.postgresql_backend',
        # ..
    }
}Add DATABASE_ROUTERS setting, so that the correct apps can be synced, depending on what’s being synced (shared or tenant).DATABASE_ROUTERS = (
    'django_tenants.routers.TenantSyncRouter',
)Add the middleware django_tenants.middleware.main.TenantMainMiddleware to the top of MIDDLEWARE, so that each request can be set to use the correct schema.MIDDLEWARE = (
    'django_tenants.middleware.main.TenantMainMiddleware',
    #...
)Now change your INSTALLED APPS settings and seprate your shared apps and tenant apps. Add yourcustomersapp in SHARED APP.SHARED_APPS = (
    'django_tenants',  # mandatory
    'customers', # you must list the app where your tenant model resides in

    'django.contrib.contenttypes',

    # everything below here is optional
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
)

TENANT_APPS = (
    # The following Django contrib apps must be in TENANT_APPS
    'django.contrib.contenttypes',

    # your tenant-specific apps

    'myapp.houses',
)INSTALLED_APPS = list(SHARED_APPS) + [app for app in TENANT_APPS if app not in SHARED_APPS]Add:
TENANT_MODEL = "customers.Client" # app.ModelTENANT_DOMAIN_MODEL = "customers.Domain"  # app.Model

CLOUDAMQP = "<YOUR CLOUDAMQP URL>"Now migrate customerspython manage.py migrate_schemas --shared
Package: djavedt
IntroductionThese utility functions are helpful in handling dates, datetimes, and timezones
in Django.ExamplesLet's say you have the following in your Django settings.pyTIME_ZONE = 'EST'
USE_TZ = TrueNow let's attempt to write our own tomorrow() function.from datetime import timedelta
from django.utils.timezone import now

def tomorrow():
  # Subtle bug! Django's now() function returns a timezone enabled datetime
  # in UTC, regardless of the TIME_ZONE setting. If it's 11 Wednesday
  # MORNING in New York, this function will work. But if it's 11 Wednesday
  # NIGHT in New York, the UTC timezone is already in Thursday, so in that
  # case this code will return Friday.
  return now().date() + timedelta(days=1)Here's one way to fix the problem.from datetime import timedelta
from djavedt import now

def tomorrow():
  # djavedt's now() function returns a timezone enabled datetime in the
  # timezone of the TIME_ZONE setting, which is EST in our example. So this
  # function will work as expected at 11PM in New York.
  return now().date() + timedelta(days=1)
Package: djaxei
A django admin extension for importing exporting records from/to xls/odsA Python library project using:pytestflake8toxbumpversionisortFree software: MIT licenseDocumentation:TBDFeaturesRequires Python >=3.8, Django>=3.2Currently work only with xlsxwriterCould help if usedirenvin dev environmentContributingSeedemoin tests folderTODODev setupinstall direnvinstall pyenvclone project:git clone https://github.com/GigiusB/djaxei.gitcd djaxeipyenv install `cat .python-version`pip install -U poetry# this should install poetry in your pyenv pythoncp .env.example .envcp .envrc.example .envrcdirenv allowpoetry env use `pyenv which python`cd .. ; cd -# see if it loads the envpoetry installpytestCredits