Saravanan666/pypi-org huggingface dataset:
Package: django-dbtemplates-bakatrouble
dbtemplatesis a Django app that consists of two parts:It allows you to store templates in your databaseIt providestemplate loaderthat enables Django to load the
templates from the databaseIt also features optional support for versioned storage and django-admin
command, integrates with Django’s caching system and the admin actions.Please seehttps://django-dbtemplates.readthedocs.io/for more details.The source code and issue tracker can be found on Github:https://github.com/jazzband/django-dbtemplates
Package: django-dbtemplates-iplweb
dbtemplatesis a Django app that consists of two parts:It allows you to store templates in your databaseIt providestemplate loaderthat enables Django to load the
templates from the databaseIt also features optional support for versioned storage and django-admin
command, integrates with Django’s caching system and the admin actions.Please seehttps://django-dbtemplates.readthedocs.io/for more details.The source code and issue tracker can be found on Github:https://github.com/jazzband/django-dbtemplates
Package: django-db-tools
Django Db Tools is a set of Database tools that are helpful when running
applications with Django in production. The primary initial tool allows for
flipping a site in and out of a read-only mode.Currently the following functionality is being worked on:A header displaying the read only modeAbility to render a template explaining posts are not allowedInstallationAdd thedb_toolsdirectory to your Python path.Add the following middleware to your project’ssettings.pyfile:MIDDLEWARE_CLASSES = (
    # ...
    'dbtools.middleware.ReadOnlyMiddleware',
    # ...
)ConfigurationThe db tools has two modes which you can control:READ_ONLY_MODEThis mode ensures all users even if already logged in act as anonymous users
on your site. To enable this you need to set the following environment variable:READ_ONLY_MODE = TrueGET_ONLY_MODEThis mode disallows all POST requests to your site. If your site only allows
inserting data as POSTS then this should be sufficient to allow your users to
view their data, but also ensure no new data is written. To enable this set the
following environment variable:GET_ONLY_MODE = True
Package: django-dburl
django-dburlNOTE: This library is a fork ofdj-database-url,
updated to allow for registering custom backends, passingDATABASESkeys as
configuration, and tested on more modern versions of Python and Django.This simple Django utility allows you to utilize the12factorinspiredDATABASE_URLenvironment
variable to configure your Django application.Thedjango_dburl.configmethod returns a Django database connection dictionary,
populated with all the data specified in your URL. You can also pass in any keyword
argument that Django'sDATABASESsetting accepts, such asCONN_MAX_AGEorOPTIONS.
Any querystring parameters (such as?timeout=20) will automatically be parsed and
added toOPTIONS(OPTIONS["timeout"] = 20in this case).If you'd rather not use an environment variable, you can pass a URL in directly
instead todjango_dburl.parse.Supported DatabasesAll built-in Django database backends are supported. See below for more details.Installationpip install django-dburlUsageConfigure your database insettings.pyfromDATABASE_URL:importdjango_dburlDATABASES["default"]=django_dburl.config(CONN_MAX_AGE=600)Provide a default:DATABASES['default']=django_dburl.config(default='postgres://...')Parse an arbitrary Database URL:DATABASES['default']=django_dburl.parse('postgres://...',CONN_MAX_AGE=600)TheCONN_MAX_AGEoption is the lifetime of a database connection in seconds
and is available in Django 1.6+. If you do not set a value, it will default to0which is Django's historical behavior of using a new database connection on each
request. UseNonefor unlimited persistent connections.URL schemesDatabaseDjango BackendURLPostgreSQLdjango.db.backends.postgresqlpostgres://USER:PASSWORD@HOST:PORT/NAMEPostGISdjango.contrib.gis.db.backends.postgispostgis://USER:PASSWORD@HOST:PORT/NAMEMySQLdjango.db.backends.mysqlmysql://USER:PASSWORD@HOST:PORT/NAMEMySQL (GIS)django.contrib.gis.db.backends.mysqlmysqlgis://USER:PASSWORD@HOST:PORT/NAMESQLitedjango.db.backends.sqlite3sqlite:///PATHSpatiaLitedjango.contrib.gis.db.backends.spatialitespatialite:///PATHOracledjango.db.backends.oracleoracle://USER:PASSWORD@HOST:PORT/NAMEOracle (GIS)django.contrib.gis.db.backends.oracleoraclegis://USER:PASSWORD@HOST:PORT/NAMERegistering custom schemesimportdjango_dburl# These were supported out of the box in dj-database-url.django_dburl.register("mysql.connector.django","mysql-connector")django_dburl.register("sql_server.pyodbc","mssql",string_ports=True)django_dburl.register("django_redshift_backend","redshift",options={"currentSchema":lambdavalues:{"options":"-c search_path={}".format(values[-1])},},)
Package: django-dburlresolvers
A URL resolver which store the URL patterns in database, which means a webmaster can define some URLs.InstallingInstall package from pypi:$ easy_install django-dburlresolversPutdbresolverinto your installed applications:INSTALLED_APPS = (
    ...
    'dbresolver',
)Change the projecturls.pyfile like this:from dbresolver import get_dbresolver_patterns

urlpatterns = patterns('',
    ... # your URLs
)

urlpatterns += get_dbresolver_patterns()UsageRegister some views of your project to get available indbresolver. You may
register it manually or automatically (by autodiscovering):Manually: Using thedbresolverAPI directly:>>> from dbresolver import register_view
>>> from fooapp.views import foo_listing
>>> register_view(foo_listing, 'Foo listing')Automatically: Put this code in your project (we recommended in the projecturls.py):from dbresolver import autodiscover_views
autodiscover_views()You need to define an especialviews_to_registermethod, like ilustrate this example:def foo_listing(request):
    foo_list = FooModel.objects.all()
    return render_to_response('fooapp/foo_listing.html',
                            {'foo_list': foo_list},
                             context_instance=RequestContext(request))

def views_to_register():
    """ returns views to be registered with dbresolver """
    return (
        (foo_listing, _('Foo listing')),
    )Also you can register generic views with parameters. For example, imagine you
have a view like this:def render_template(request, template_name=None):
    try:
        return direct_to_template(request, template=template_name)
    except TemplateDoesNotExist:
        raise Http404()You may register the view with a parameter which be defined for admin user:>>> from configfield import params
>>> register_view(render_template, 'Generic view to render a template',
                  params=(
                      params.Template(
                          name='template_name',
                          label='Template to be rendered',
                      ),
                  ))If you want autoregistering of that view, the code was like this:def views_to_register():
    return (
        {'view': render_template,
         'label': 'Generic view to render a template',
         'params': (
             params.Template(name='template_name', label='Template to be rendered'),
        )},Now you only have to enter on admin site to create URL patterns attached to
views. You can use both Djangodefault regular expressionsand simplersurlex expressions.0.1.0-betaFixed a model form error when used outside admin.0.1.0-alphaInitial version
Package: django-db-xlsx
Import/export django models from/to xlsxQuickstartInstall django-db-xlsx:pip install django-db-xlsxInvoke export:from django_db_xlsx import dump_models
return dump_models()Invoke import (note: can import exported file):from django_db_xlsx import load_models
<load workbook from whatever, e.g. FileField in form>
load_models(wb)Optional setting for default models saved:DJANGO_DB_XLSX_MODELS = [
    ('auth', 'User'),
]FeaturesImport models via xlsxExport models via xlsxTODOBeef up woefully lacking testsRunning TestsDoes the code actually work?:source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxLicenseCopyright Jon Robison 2017, see LICENSE for details
Package: django-dcat
django-dcat is a Django app that provides a model layer forDCAT 3.0metadata and some command line tools to import data to it, to create vocabularies and more.Note:This is a work in progress and it is not stable for production. If you wanna see an example of what can
be done checkoutCatalogo Social, a data catalog implemented with django-dcat.Quick startInstall the package using pip:pip install django-dcatAdd “dcat” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...,
    "dcat",
]Runpython manage.py migrateto create the DCAT models in your database.Start the development server and visithttp://127.0.0.1:8000/admin/to start adding data (you’ll need the Admin app enabled).Runpython manage.py--helpto see the available commands.CLI utilitiesMigrating from CKANThere are two commands that allows you to:Make a dump of data from a CKAN data portal (that hasckanext-datajsoninstalled)Create a Catalog with its related entities (datasets, distributions, etc)# Download the data.json file from the portal$wget-Odata.jsonhttps://www.ckan-example.org/data.json# Download all files from the portal (by default in a data/ folder)$pythonmanage.pydump_from_datajson# Import all data and files into a local catalog$pythonmanage.pyimport_from_datajsonControlled vocabularies for standardise metadataThere are two commands to import controlled vocabularies used in the EU Open Data Portal in order to standardise the metadata.# Populate records for the MediaType model (CSV, PDF, etc)$pythonmanage.pyimport_filetypes# Populate records for Licences (MIT, Apache, etc)$pythonmanage.pyimport_licencesThe goal of these commands is to provide data publishers with pre-filled options for the metadata fields. This will improve
data quality and avoid common problems like duplicated metadata values for typos or inconsistent data entry (like distributions with
.csv, .CSV, CSV, etc)Extending the modeldjango-dcatfocuses on providing a model layer for DCAT metadata. However, if you require custom fields in your application,
you can extend any model using a OneToOneField pattern (similar to what you use to extend Django’s User model).fromdjango.dbimportmodelsfromdcat.modelsimportDistributionclassDistributionExtras(Distribution):distribution=models.OneToOneField(Distribution,on_delete=models.CASCADE,related_name='extras')my_extra_field=models.CharField(max_length=255,blank=True,null=True)And then you can call this fields from your code using the related name attribute:fromdcat.modelsimportDistributiondistribution=Distribution.objects.get(pk=1)print(distribution.extras.my_extra_field)Note: Instead of calling itextrasYou can play with more semantic names for the related_name
attribute like the name of your app.Implementation notesThe Django models in this package are inspired by the diagram presented in DCAT profiles.See the diagram:UML diagram illustrating the DCAT-AP specificationFor more information on DCAT:Data Catalog Vocabulary (DCAT) - Version 3.0DCAT-AP profilePublishing a new VersionThe project uses twine to publish to PyPi:Update the version insetup.cfgCreate a new release in Github.Build the package:python-mbuildUpload to PyPitwine upload dist/*
Package: django-dcolumns
The MIT License (MIT)OverviewDColumn is a Django plugin that lets the developer add columns to a model
dynamically. It does this in the same way that the admin uses an inline model.
Matter-of-fact that is exactly how the additional columns are displayed in
the admin. The only addition is that there is special JavaScript that
converts the column type to the type you have previously set it to.This can be done, because any type of field can be represented as a string.
There are two methods on any model you define as aDcolumnmodel that
does conversion in and out of the type you have set.DColumn now will only work with Django 3.2 and above and therefore only
Python 3.6 and above.WarningVersion 2.0 is a partial rewrite ofDjango DColumnsand is NOT
backwards compatible with previous versions. It now needs to use fields
defined in user forms. The latest releases of Django would not work
with the old way Dcolumns had previously handled fields. This is
actually better as it is now more consistent with how Django does
things.ProvidesFunctionality to permit the addition of fields to a model through the
admin.Add pseudo models for static data objects.The admin reflects all newly added fields in the correct type.Feel free to contact me at: carl dot nobile at gmail.comComplete Documentation can be found onRead the Docsat:Django DColumns
Package: django-dcors
The packagedcorsis a Django middleware for enabling Cross-Origin Resource
Sharing (CORS).Install  the module using:pip install django-dcorsCode is available athttps://github.com/prasanthn/django-dcors.Values specified in the Django settings module are used to set appropriate
headers in HTTP responses. These headers are added to all responses.Pre-flight requests, i.e., OPTIONS requests that have the
Access-Control-Request-Method header, are returned with an empty response
containing all the headers mentioned below.Take this behaviour into account when adding this middleware to the
MIDDLEWARE_CLASSES list in the settings module.Adding headers to all responses is useful since not all requests are
“pre-flighted”. For example a “simple” credentialed GET request is not
“pre-flighted”, but the response must have Access-Control-Allow-Credentials set
to “true” for the response to be available to the client script.Setting              Value                  Respone header

CORS_ALLOW_ORIGIN       string            Access-Control-Allow-Origin
CORS_ALLOW_METHODS      list              Access-Control-Allow-Methods
CORS_ALLOW_HEADERS      list              Access-Control-Allow-Headers
CORS_ALLOW_CREDENTIALS  "true" or "false" Access-Control-Allow-Credentials
CORS_EXPOSE_HEADERS     list              Access-Control-Expose-Headers
CORS_MAX_AGE            seconds           Access-Control-Max-Age
CORS_ALLOW_ALL_ORIGIN   <any-value>       <see explanation below>
CORS_ALLOW_ALL_HEADERS  <any-value>       <see explanation below>If the setting CORS_ALLOW_ALL_ORIGIN is present, containing any value, then the
Access-Control-Allow-Origin response header is set to the value of the Origin
header in the request. This is a shortcut for allowing CORS for all domains.If the setting CORS_ALLOW_ALL_HEADERS is present, containing any value, then the
Access-Control-Allow-Headers response header is set it the value of the Access-
Control-Request-Headers header in the request. This is a shortcut for allowing
clients to send any header with a CORS request.By default none of the above values are set, and hence the response will contain
empty values for the corresponding header. Note that the headers will be present
in the response, but the value of each will be an empty string.This middleware only adds appropriate headers to responses, and doesn’t prevent
access based on header values in the request. A web browser will not allow
JavaScript to issue requests and access responses that don’t conform to the CORS
standard. The browser determines the allowed access points using the headers in
the response.Seehttps://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORSfor more
information on CORS. Web browsers that support CORS can be found athttp://caniuse.com/#search=cors.Tests are present in dcors/tests.py, and have been tested with Django 1.4.5 and
1.5.1 in Python 2.7.3 .
Package: django-dde
# Django Distributed Exporter (DDE)> Asynchronous and Distributed Data Exporter from a Django QuerySetDDE main goal is to get data from a QuerySet and export to an output format (currently CSVonly) using Celery for task distribution.## Installation```shpip install django-dde```## RequirementsDDE uses **Celery** to manage its tasks. Currently our broker defaults to **Redis** so besure to install the dependencies need,[for more information click here.](http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html)File management is dealt using Django's Default Storage. [For more information on how to use itplease click here.](https://docs.djangoproject.com/en/2.0/topics/files/#file-storage)We developed DDE using **Django 1.11** and **Python 3.5**. Other versions are pending tests. Let us knowif works in your virtual environment.## UsageFirst of all:`pip install django-dde`Excelent! Now you must ensure that in your `settings.py` you have these configurations:```pythonEXPORTER_FROM_EMAIL = 'sender@email.com'```Now you have to configure a periodic task using Celery, [please refere to this link.](http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html)Now in the code:```pythonfrom exporter.models import Exporterexporter = Exporter.objects.create_exporter(queryset=Model.objects.queryset, # Change Model to your Modelemail=example@mail.com, # E-mail that will receive the link to the exporter,limit_per_task=100, # How many entries each task will proccess)```And that's it! Simple, right?## Development setupInstalling our dependencies in your virtual environment is pretty straight foward:`pip install -r requirements/development.txt`But you can use our Docker to test DDE. This method already install all dependencieson a container, creates a Redis container and you ready to go. We already configured some shortcuts to help:```shmake build # Builds docker image, be sure to run this firstmake build-no-cache # Build/Rebuilds (cleaning cache) docker imagemake tests # Run all testsmake bash # Enters Docker's Bashmake help # Shows the available commands```## Release History* 0.1* Initial version## MetaStored E-commerceDistributed under the MIT license. See ``LICENSE`` for more information.[https://github.com/stored](https://github.com/stored)## Contributing1. Fork it (<https://github.com/yourname/yourproject/fork>)2. Create your feature branch (`git checkout -b feature/fooBar`)3. Commit your changes (`git commit -am 'Add some fooBar'`)4. Push to the branch (`git push origin feature/fooBar`)5. Create a new Pull Request*Remember: Every feature created or fixed must have a test written and/or fixed.*
Package: django-ddm
# Data Donation Module (ddm)>_NOTE:_This package is currently under active development.DDM(Data Donation Module) is a Django application that helps researchers to
setup data donation projects and to collect data donations for academic research.This is part of a larger initiative from the University of Zurich and the Digital
Society Initiative to strengthen the exchange about the topic of data donations and
promote this data collection approach. For more information, visithttps://datadonation.uzh.ch.Documentation:https://uzh.github.io/ddm/ddm/main/index.htmlPyPi:https://pypi.org/project/django-ddm/
Package: django-debreach
Extra mitigation against theBREACH attackfor Django projects.django-debreach provides additional protection to Django’s built in CSRF
token masking by randomising the content length of each response. This is
achieved by adding a random string of between 12 and 25 characters as a
comment to the end of the HTML content. Note that this will only be applied to
responses with a content type oftext/html.When combined with the built-in mitigations in Django and rate limiting
(either in your web-server, or by using something likedjango-ratelimit), the
techniques here should provide a fairly comprehensive protection against the
BREACH attack.Installation & UsageInstall from PyPI using:$ pip install django-debreachTo enable content length modification for all responses, add thedebreach.middleware.RandomCommentMiddlewareto thestartof your
middleware, butaftertheGzipMiddlewareif you are using that.:MIDDLEWARE_CLASSES = (
    'debreach.middleware.RandomCommentMiddleware',
    ...
)or:MIDDLEWARE_CLASSES = (
    'django.middleware.gzip.GzipMiddleware',
    'debreach.middleware.RandomCommentMiddleware',
    ...
)If you wish to disable this feature for selected views, simply apply thedebreach.decorators.random_comment_exemptdecorator to the view.If you only want to protect a subset of views with content length modification
then it may be easier to not use the middleware, but to selectively apply thedebreach.decorators.append_random_commentdecorator to the views you want
protected.Python 2 and Django < 2.0 supportVersion 2.0.0 drops all support for Python 2 and Django < 2.0. If you need
support for those versions continue usingdjango-debreach>=1.5.2,<2.0.
Package: django-debugger
django-debuggerA simple plugin to attach a debugger in Django during runserverInstallationpipinstalldjango-debuggerUsagePrepend django_debugger totopof theINSTALLED_APPSINSTALLED_APPS=["django_debugger",...]# Or if you have multiple settings configurationINSTALLED_APPS=["django_debugger",...# custom development apps]+INSTALLED_APPSAdd--enable-debuggerargument to runserver commandpythonmanage.pyrunserver---enable-debugger0.0.0.0:8000ORAddDEBUGGER_ENABLE = Trueto settings file.Settings VariablesDEBUGGER_ENABLE = True: Attaches debugger.DEBUGGER_ADDRESS = "0.0.0.0": Address to listen for remote debuggingDEBUGGER_PORT = 5678: Port to listen for remote debuggingDEBUGGER_WAIT_FOR_ATTACH = False: Wait for debugger to attach before continuing.
Package: django-debugging
Django Debugging================Django debugging makes it easier to debug your app during development. Currently it contains the runserver_plus functionality from the project [django-extensions](https://github.com/django-extensions/django-extensions "Django Extensions").Installation------------Run `pip install django-debugging`If you are using the package from source you will need to install [Werkzeug](http://werkzeug.pocoo.org/) manually.Add `django-debugging` to your `INSTALLED_APPS` setting:```pythonINSTALLED_APPS = (...'django_debugging',)```Getting Started---------------To get started use the `runserver_plus` command instead of `runserver`. All `runserver` options will work with `runserver_plus`.```$ python manage.py runserver_plus* Running on http://127.0.0.1:8000/* Restarting with reloader...Validating models...0 errors foundDjango version 1.4.1, using settings 'mysite.conf.settings'Development server is running at http://127.0.0.1:8000/Using the Werkzeug debugger (http://werkzeug.pocoo.org/)Quit the server with CONTROL-C.```Usage-----Werkzeug displays its own traceback page instead of Django's normal traceback page.It has two options:###View SourceYou can expand and the view the source of each line in the traceback.###Interactive Console DebuggerLets you evaluate python expressions in the browser with the context being same as the line in the traceback. Use it to print values, assign variables, or run functions. (*Warning:* This is extremely insecure and should never be run and a production server.)
Package: django-debug-helper
django-debug-helperDjango debug error related exception search on Google/ Stack Overflow.Installation$ pip install django-debug-helperSetting it upAdd the custom middleware to yourMIDDLEWAREin thesettings.py.if DEBUG:
	MIDDLEWARE += ('django-debug-helper.debug.ErrorSearchMiddleware', )Next time you get an error in your applications, you will see an external link to a customgoogle/ stackoverflowsearch as you defined.By default it set togooglesearch, but if you want to usestackoverflowsearch instead ofgooglethen add this into yoursettings.pyDJANGO_TRACE_SEARCH_SITE = "stackoverflow"
Package: django_debug_html_store
`django_debug_html_store` is django debug tool.Requirements------------* Python 2.5 or later (not support 3.x)* Django 1.1 or later (Support 1.4)(maybe!)Features--------* nothingSetup-----::$ easy_install django_debug_html_storeor$ pip install django_debug_html_storeHistory-------0.0.2 (2013-2-23 by django sprintf 2013/02!)0.0.1 (2011-4-18)~~~~~~~~~~~~~~~~~~* first release