Saravanan666/pypi-org huggingface dataset:
Package: django-qunit
django-qunitdjango-qunit integrates the [QUnit Javascript testing framework][1] with
[Django][2], making it possible to run QUnit tests alongside your Django
app and test Ajax routines.[1]:http://docs.jquery.com/QUnit[2]:http://www.djangoproject.com/installationAdd ‘django_qunit’ to your settings.INSTALLED_APPS.Add settings.QUNIT_TEST_DIRECTORY, containing the path to your javascript files.Add a urlconf to include(‘django_qunit.urls’).Visit the URL you’ve included in your urlconf, and it should display QUnit test results.See the example in the tarball for more information.licenseCopyright (c) 2010 Cody Soyland
Licensed new-style BSD, also containing QUnit, which is licensed MIT. See LICENSE file for more information.
Package: django-quotes
Django QuotesA simple reusableDjangoapp that allows you to collect quotes from arbitrary groups of characters, and then serve random quotes or Markov-chain generated sentences based upon them. Includes a Bootstrap compatible set of templates an optional REST API.FeaturesDocumentation and a full test suite.Support for abstract grouping of quote sources.Convenience methods for fetching a random quote.Object-level permissions viadjango-rules.Generate sentences based off of a Markov-chain for individual sources and groups using natural language processing.Bootstrap-compatible templates.A simple REST API for fetching data via JSON with CORS support.Check outthe documentationfor installation and quickstart instructions.
Package: django-quran
Installation=======1. Download and install django-quran2. Add 'quran' to INSTALLED_APPS3. Run `django-admin.py syncdb`4. Run `django-admin.py quran_loaddata`Resources======- Fully verified Quranic text from <ahref="http://tanzil.info/wiki/Main_Page">Tanzil</a>- Morphological data (including words, roots) from <ahref="http://quran.corpus.com/">The Quranic ArabicCorpus</a>- Translations from <a href="http://zekr.org/resources.html">Zekr</a>
Package: django-qurl
Append, remove or replace query string parameters from a url (preserve order).
Originally created by Sophilabs -https://github.com/sophilabs/django-qurl-templatetagInstallationpip install -e git+https://github.com/obiwanus/django-qurl.git#egg=django-qurlUsage in templatesExample:{% load qurl %}

{% qurl '/search?page=1&color=blue&color=green' order=name page-- color+=red color-=green %}
Output: /search?color=blue&order=name&color=red

{% qurl request.get_full_path order='name' %}
Output: /your/current/path/?order=nameParameters:name=value: replace all values of name by one value
name--: remove all values of name
name+=value: append a new value for name
name-=value: remove the value of name with the valueUsing reverse in the template tag:{% qurl 'url_name' [reverse_params] | order=name color+=red color+=green %}
Output: /reversed/url/?order=name&color=red&color=greenThe reverse syntax is exactly the same as in the standard Django{% url %}tag.Usage in viewsExamples:fromqurlimportqurlurl='/testurl/1/'qurl(url,add={'a':'a1','b':['b1','b2']})# Output: /testurl/1/?a=a1&b=b1&b=b2url='/testurl/1/?a=a1&b=b1&b=b2'qurl(url,add={'a':'a2'},remove=['b'])# Output: /testurl/1/?a=a2url='/testurl/1/?a=a1&b=b1&b=b2'qurl(url,add={'a':['a2']},remove=['b'])# Output: /testurl/1/?a=a1&a=a2url='/testurl/1/?a=a1&b=b1&b=b2'qurl(url,exclude={'b':'b2'},add={'a':'a2'})# Output: /testurl/1/?a=a1&a=a2&b=b1# You can use request.GET as a baseurl='/testurl/1/'qurl(url,add=request.GET,exclude={'b':'b1'}Notes:If you want to assign a specific value to the parameter (replacing all
existing values), useadd={'param':'value'}.If you want to add a value to already existing ones, useadd={'param':['value']}. You can add more than one value of course.Please check the tests for more usage examples.Running testsPlease make suretoxis installed and runtoxfrom the command line.The source code is hosted on Github:https://github.com/obiwanus/django-qurl/
Package: django-qurl-templatetag
A Django template tag to modify url’s query string.DocumentationThe full documentation is athttps://django-url-templatetag.readthedocs.org.Quick StartInstall Django QUrl Template Tag:pip install django-qurl-templatetagAfter installation is done, addqurl_templatetagto theINSTALLED_APPSsetting in your settings.py file:INSTALLED_APPS = (
    # …
    'qurl_templatetag',
    # …
)Tag Usage{% load qurl %}

{% qurl url [param]* [as <var_name>] %}

Parameters:
        name=value: replace all values of name by one value
        name=None: remove all values of name
        name+=value: append a new value for name
        name-=value: remove the value of name with the value
        name++: increment the value by one
        name--: decrement the value by one

Example:

    {% qurl '/search?page=1&color=blue&color=green' order='name' page=None color+='red' color-='green' %}
    Output: /search?color=blue&order=name&color=red

    {% qurl request.get_full_path order='name' %}Library UsageA Qurl object has a set of chainable methods to modify the querystring parameters.Available methods are:set: replace all values of name by one value, parameter is removed when value is Noneadd: append a new value for nameremove: remove the value of name with the valueinc: increment the value by another value (optional, defaults to 1)dec: decrement the value by another value (optional, defaults to 1)get: build the urlfrom qurl_templatetag import Qurl

>>> Qurl('http://www.sophilabs.co/?page=1&tags=python')\
        .inc('page', value=2)\
        .add('tags', 'django')\
        .add('tags', 'web')\
        .remove('tags', 'python')\
        .get()
http://www.sophilabs.co/?page=3&tags=django&tags=webTests$ pip install -r requirements/test.pip
$ python runtests.pyAboutDjango Qurl Template Tag is maintained and funded by sophilabs, inc. The names and logos for
sophilabs are trademarks of sophilabs, inc.
Package: django-qwert
django-qwert is a trivia snippet collection of Django which used inKawazInstallpip install django-qwertFeaturesHttp403 exceptionLikeHttp404exception. You can raiseHttp403exception andHttpResponseForbiddenwill be responsedUser based exceptionSuper user can see Django technical exception page even whenDEBUG=FalseGlobal requestDeveloppers can accessrequestinstance duaring request process
with thread local mechanismswith_requestdecoratorTo enable handlingrequestinstance in form, convert form class and
classbased generic view class. It is useful to determine the author of
the object in method of form.Useful templatetags and some extra builtin templatetagsexpr (extra builtin)calculate python expression in templateevaluateevaluate django template in stringtruncateletters (extra builtin)liketruncatewords, this truncate letters. Useful to use the
language which does not have space for delimiter (like Japanese,
Chinese …etc)markdownenhanced markdown filter which can care about the markdown extensions.markdownis required to use this templatetag.urlize_htmlurlizefilter for HTML string.BeautifulSoupis required to
use this templatetagEnhanced override_settingsSimilar with Django 1.4override_settingsbut it will recallsyncdbcommand when new app is appended toINSTALLED_APPS.
Andwith_appsandwithout_appsdecorator/context manager is
added.Automatically test user is created insyncdbcommandSettingsAUTO_CREATE_TESTUSERTo disable automatically creating test user insyncdbcommand, setFalseto this setting. Default:TrueTESTUSER_USERNAMEAn username of test user. Default:'admin'TESTUSER_EMAILAn email address of test user. Default:"%s@test.com" % TESTUSER_USERNAMETESTUSER_PASSWORDA password of test user. Default:'password'ENABLE_EXTRA_BUILTINSTo disable adding extra templatetags to buitlin, setFalse.
Package: django-ra
Ra FrameworkA light-weight effective Django based framework to create business application and various resource planing systems,
equipped with a reporting engine and a responsive dashboard.FeaturesA responsive dashboard built on top of Django’s admin.Reporting Engine that filters and compute several types of reports with simple lines of code.A charting capabilities to turn reports into attractive charts.A widget system to display reports and its charts on dashboard home , or on object’sviewpages.Tools and goodies to extend and customize the framework behavior from top to bottom.Python 3.6 / 3.7 / 3.8Django 2.2, 3.0 CompatibleDependenciesPython 3PostgreSQLInstallation$pipinstalldjango-raQuick startCreate a virtual environment and install ra-framework from Pypi$pipinstalldjango-raOnce Ra installed, it provides a command to generate a new project.$ra-adminstartmyprojectThis will create a new project foldermyproject, based on a template containing everything you need to get started.
You can always integrate ra framework to your existing project, please refer to the docsIntegrating into an existing django projectCreate a postgres database, and assign its details toDATABASESsettingNoteRa only support Postgresql.As Django’sQuerySet.distinct(*fields)is supported only on Postgres.distinct(*fields)is used by the reporting engine.Run the usual commands needed for any django project$./manage.pymigrate$./manage.pycreatesuperuser$./manage.pyrunserverVoila!! Your site should now up and running athttp://localhost:8000. Enter your super user credentials and login.DocumentationAvailable onRead The DocsPlease Proceed to the tutorialCreate a sales application Part 1Testing and contributionTo run the test suite, first, create and activate a virtual environment. Then
clone the repo, install the test requirements and run the tests:# 1. Clone and install requirements
$ git clone git+git@github.com:ra-systems/RA.git
$ cd tests
$ python -m pip install -e ..
$ python -m pip install -r requirements/py3.txt

# 2. Set the test database connection details in the environment
$ export DATABASE_NAME=<database name>
$ export DATABASE_USER=<database user>
$ export DATABASE_PASSWORD=<database password if any>

# 3. Run the tests
$ ./runtests.py
# And for Coverage report
$ coverage run --include=../* runtests.py [-k]
$ coverage htmlFor more information on contributing, we honorDjango’s guidelines.
Package: django-rabbitmq
===========================
Django RabbitMQ IntegrationStart a RabbitMQ consumer after django server start.Quick startAdd "django-rabbitmq" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'django_rabbitmq',
]Config rabbitmq settings like this::RABBITMQ = {
'default': {
'HOST': 'server_ip',
'PORT': 5672,
'VIRTUAL_HOST': '/',
'USER': 'user',
'PASSWORD': 'password',
'QUEUE': 'queue'
}
}Create a mq.py and inherit RabbitMQ model::from django_rabbitmq.mq import RabbitMQclass CustomModel(RabbitMQ):def callback(self, ch, method, properties, body):
     print("[django-rabbitmq] Received %r" % body)
     ......
     your code
     ......RabbitMQ.callback = CustomModel.callback
Package: django-rabbitmq-utils
django_rabbitmq_utilsTo enhance the RabbitMQ library features in Python Django, to utilize additional libraries and features that complement RabbitMQ's functionality.requirementsFor running this, you need to havepython3installed on your system.Installationpip install django-rabbitmq-utils==0.0.1Examplefrom django_rabbitmq_utils.rabbitmq import send_message_with_retry, consume_messages_from_queue

def send_notification(message):
    send_message_with_retry(message)

def start_message_consumer():
    consume_messages_from_queue('my_queue')# settings.py
CELERY_QUEUES = getattr(settings, 'CELERY_QUEUES', ())
CELERY_QUEUES += message_routing.routing.get_queues()


# celery.py
from kombu import Connection
from django_rabbitmq_utils.routing import get_exchange

app = Celery('your_project')

@app.task(bind=True)
def process_message(self, body):
    # Connect to RabbitMQ and publish the message with routing key
    with Connection(app.broker_connection()) as connection:
        exchange = get_exchange()
        producer = connection.Producer(serializer='json')
        producer.publish(body, exchange=exchange, routing_key='key1')# settings.py
import ssl
from django_rabbitmq_utils.rabbitmq_ssl import RABBITMQ_SSL_CONFIG

BROKER_URL = 'amqp://<username>:<password>@<rabbitmq_host>:<rabbitmq_port>/<vhost>'
BROKER_USE_SSL = True
BROKER_SSL_OPTIONS = RABBITMQ_SSL_CONFIG# seetings.py
COMMANDS = {
    **rabbitmq_integration.register_commands()
}
Package: django-radagast
Radagast: the wizard no-one has heard of.A wizard that is similar to the one in Django except that:It uses jinja2 and jingo.It will work with or without Ajax.The path it takes can change.You don’t need to have a form on every page.It does a lot less.It lets you work with views in the normal way, if that’s what you want.You can set URL paths to specific parts of the wizard.License: BSDAuthor: Andy McKay,amckay@mozilla.com
Package: django-radio
A radio management application that makes easy scheduling, live recording, publishing…It is used byRadioCo.Featuresdesigned to work with any web browserdrag and drop scheduling calendar interfacelive shows can be recorded and published automaticallycomplete authentication system (user accounts, groups, permissions)…and much moreMore information onour website.DocumentationPlease head over to ourdocumentationfor all
the details on how to install, extend and use django radio.Quick StartWe recommend using aconfigured radioco project.
Package: django-radiogrid
django-radiogridWith this you can create a radio grid field:Installationpip install django-radiogridIn your settings.pyINSTALLED_APPS = (

    # ...

    'radiogrid',
)In your models.pyfrom radiogrid import RadioGridField

# ...

ROWS = (
    (1, 'First'),
    (2, 'Second'),
    (3, 'Third'),
)

VALUES = (
    ('pyha', 'Pyha'),
    ('work', 'Work'),
    ('happy', 'Happy'),
    ('food', 'Food'),
)

class MyModel(models.Model):

    # ...

    my_grid = RadioGridField(rows=ROWS, values=VALUES, require_all_fields=True)Example projectYou can run it as usual:virtualenv venv
. venv/bin/activate
pip install django
pip install -e .
cd example
./manage.py migrate
./manage.py loaddata data
./manage.py runserver
./manage.py testordocker-compose up app
docker-compose run --rm app testDevelopingTestingdocker-compose run --rm app test
docker-compose run --rm app coverage
docker-compose run --rm app tox -e py310-django-masterReleasingadd a new version description inCHANGES.rstchange a version in__init__.pyadd a github releasedocker-composerun--rmapp release1.1.0 (2022-07-01)Updated for Django 4.0. Thanks @Milutinke92 for the patch!Drop support for non-LTS Django versions.Drop support for old Python 3 versions.1.0.4 (2017-07-22)Fixed the parameter require_all_fields=False. Thanks @nmalkin for the patch!1.0.3 (2017-03-26)Updated for Django 1.111.0.2 (2016-09-26)Updated for Django 1.101.0.1 (2015-08-04)Fixed bug with validation1.0.0 (2015-07-26)First stable release0.0.1 (2015-07-24)Initial version
Package: django-radius-eap-mschapv2-authbackend
Django RADIUS EAP-MSCHAPv2 Authentication BackendBased onhttps://github.com/mneitsabes/RADIUS-EAP-MSCHAPv2-Python-client.UsageAdd this to yoursettings.py:AUTHENTICATION_BACKENDS = [
    'django_radius_eap_mschapv2_authbackend.EAPMSCHAPv2RADIUSBackend.RADIUSEAPMSCHAPv2Backend',
]


RADIUS_HOSTS = ['ip_srv1', 'ip_srv2']
RADIUS_SECRET = ''
RADIUS_NAS_IP = ''
RADIUS_NAS_ID = ''
Package: django-ra-erp
Ra FrameworkA light-weight, effective, Django based framework to create various business applications, resource planing and management systems.If offers a ready made platform where you can start to create data entry pages and attach various reports to them.FeaturesA customizable responsive dashboard (built on top of Django’s admin).A Reporting Engine to compute and chart various and complex reports like time series and crosstab.A widget system to display various reports in one page.Extendable and customizablePython 3.6 / 3.7 / 3.8/ Django 2.2, 3.0 CompatibleInstallation$pipinstalldjango-ra-erpQuick startCreate a virtual environment and install Django Ra ERP from Pypi$virtualenvra-erp$sourcera-erp/bin/activate$pipinstalldjango-ra-erpOnce installed, Ra provides a command to generate a new project, which would contains all the dependencies needed.$ra-adminstartmy_project_nameYou can always integrate Ra to your existing project, it’s fairly simple. Here is the guideIntegrating into an existing django projectLet’s run the preparation commands and get started !$./manage.pymigrate$./manage.pycreatesuperuser$./manage.pyrunserverDocumentationAvailable onRead The DocsPlease Proceed to the tutorialCreate a sales application Part 1Testing and contributionTo run the test suite, first, create and activate a virtual environment. Then
clone the repo, install the test requirements and run the tests:# 1. Clone and install requirements
$ git clone git+git@github.com:ra-systems/django-ra-erp.git
$ cd tests
$ python -m pip install -e ..
$ python -m pip install -r requirements/py3.txt

# 2. Set the test database connection details in the environment
$ export DATABASE_NAME=<database name>
$ export DATABASE_USER=<database user>
$ export DATABASE_PASSWORD=<database password if any>

# 3. Run the tests
$ ./runtests.py
# And for Coverage report
$ coverage run --include=../* runtests.py [-k]
$ coverage htmlFor more information on contributing, we honorDjango’s guidelines.
Package: django-rainbowtests
This is a custom test runner for Django that gives youreallycolorful test
output.How do I use this?Install the latest release with:pip install django-rainbowtestsNew in 0.5.0: Add a settings forRAINBOWTESTS_HIGHLIGHT_PATH. While
running your tests, any lines in your tracebacks that match this path will be
highlighted, making them easier to find and read. If you omit this setting,
the default is to use the path to your django installation (which probably
ends up highlighting more than you need or want).:RAINBOWTESTS_HIGHLIGHT_PATH = '/path/to/my/project/'New in 0.6.0If the test output is too verbose and you just want a colorful
version of the standard Django test output, setRAINBOWTESTS_SHOW_MESSAGEStoFalse:RAINBOWTESTS_SHOW_MESSAGES = FalseDjango > 1.6: Set your test runner to theRainbowDiscoverRunner:TEST_RUNNER = 'rainbowtests.test.runner.RainbowDiscoverRunner'Django < 1.5: Set your test runner to theRainbowTestSuiteRunner. This was
removed in django 1.8, so using this test runner on newer projects will fail:TEST_RUNNER = 'rainbowtests.test.simple.RainbowTestSuiteRunner'Then run your tests!Python/Django CompatibilityThis codeshouldwork with Django 1.4 - 1.8, Python 2.7 and Python 3.4. If you
find otherwise, please open an Issue.CoverageAs of version 0.3.0, there is (experimental) support forcoverage,
and 0.4.0 cleaned it up by introducing a new test runner:UseTEST_RUNNER = ‘rainbowtests.test.runner.RainbowDiscoverCoverageRunner’and run your tests as normal (python manage.py test <whatever>), and if you
have coverage installed, you should see a report when your tests complete.
You could also usecoverage htmland openhtmlcov/index.htmlfor a more fancy coverage report.
Make sure you have a.coveragercfile, though!LicenseThis code is distributed under the terms of the MIT license. See theLICENSEfile.
Package: django-raise-response
django-raise-responsedjango-raise-response is a simple plugin that provides the ability to return
any response by raising it as you would do with django.http.Http404Why would you need this? If you need to return a non-4XX/5XX response from a
class-based view, for example a 303/301 response, this is the only decent way
to do it.Installingpip install django-raise-responseThen add ‘raiseresponse.middlewares.RaiseResponse’ to your middlewares:MIDDLEWARE = [
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'raiseresponse.middlewares.RaiseResponse'
]UsageNow you can use ResponseError to raise any response:from raiseresponse import ResponseError

# somewhere in your view
response_you_want_to_rise = HttpResponse()
raise ResponseError(response_you_want_to_rise)
Package: django-ram
Django RAMRole based user access management for Django.RequirementsPython 3.6+Django 4.1, 4.0, 3.2, 3.1, 3.0Installationpip install django-ramOptionally install with rest framework support:pip install django-ram[rest_framework]Adddjango_ram'to yourINSTALLED_APPSsetting.INSTALLED_APPS=[...'django_ram',]./manage.py migrateOverviewUser ModelAdd theRolesMixinto your user model.fromdjango_ram.modelsimportRolesMixinclassCustomUser(AbstractUser,RolesMixin):passAlso remember to configureAUTH_USER_MODELin yoursettings.pymodule.Declarative Rolessome_app/roles.pyfromdjango_ram.definitionimportRoleDefinitionclassAdminRole(RoleDefinition):name="Admin"description="System administrator."classAuthorRole(RoleDefinition):name="Author"description="A writer of a book, article, or document."Roles will be created (or updated) post migration to reflect role definitions inroles.pyfiles.Role names have to be globally unique.Django AdminRegister the admin class (or subclass it to expand functionality.)fromdjango.contribimportadminfromdjango_ram.adminimportUserAdmin...admin.site.register(YourUserModel,UserAdmin)Rest Framework Supportfromdjango_ram.rest_frameworkimportHasRoleBasePermission,has_rolefromsome_app.rolesimportAuthorRoleclassHasAuthorRole(HasRoleBasePermission):role_definition=AuthorRoleclassPublicationViewSet(viewsets.ModelViewset):permission_classes=[has_role(AuthorRole),#  Is equivelant to:HasAuthorRole,]
Package: django-randomcharfield
django-randomcharfieldWhat's this?This is a custom Django model field written as an alternative to UUIDs.It works by base64-encoding 20 bytes (160 bits) fromurandom, as recommended by Neil Madden's fantastic blog post,"Moving away from UUIDs"InstallationUse any package manager of choice. If using pip, install with this command:pip install django-randomcharfieldUsageAdd this to your model definition as follows:fromdjango.dbimportmodelsfromrandomcharfieldimport(RandomCharField,generate_random_field,)classSomeModel(models.Model):uid=RandomCharField(default=generate_random_field)Note that this doesn't make any assumptions about your current database state. That means you are responsible for creating the database index for this field, adding a uniqueness constraint, or making it a primary key.If you have existing rows in your table and want to add a uniqueness constraint, you may want to set this field as nullable (i.e. passing innull=True) and to devise a plan to populate this. A good guide for such a plan is one written in the official Django documentation to deal with the same situation forUUIDField:https://docs.djangoproject.com/en/3.0/howto/writing-migrations/#migrations-that-add-unique-fieldsNotesThis isn't a lot of code, so you should probably be just copying the field to your project if you want customisations, rather than proposing changes.LicenseMIT
Package: django-randomfield
Django IBAN FieldIBANField is an extension for django CharField with special validation for IBAN accounts.InstallYou can install django-randomfield with pip as usual o pipenv$>pipinstalldjango-randomfield$>pipenvinstalldjango-randomfieldUsageUse IBANField on your models, like any other django models fields.fromdjango_randomfield.fieldsimportCharRandomFieldclassMyModel(models.Model):account=CharRandomField()