Saravanan666/pypi-org huggingface dataset:
Package: django-durationwidget
Django Duration WidgetWhen to use?You can find duration field as below which is not far good for humans to use.Django duration widget is used for simplfiend Django model'sDurationfield.Quick startInstalldjango-durationwidgetusingpippip install django-durationwidgetAdddurationwidgetto yourINSTALLED_APPSsetting like this::INSTALLED_APPS=[...'durationwidget',]Make sure to setAPP_DIRStoTruein settings.pyTEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','DIRS':[os.path.join(BASE_DIR,'templates'),...],'APP_DIRS':True,# Setup this to True'OPTIONS':{...},},]Cheer up you are ready to useTimeDurationWidgetas normal widget as below.fromdjangoimportformsfromdurationwidget.widgetsimportTimeDurationWidgetfrom.modelsimportYourModelclassCustomForm(forms.ModelForm):...duration=forms.DurationField(widget=TimeDurationWidget(),required=False)classMeta:model=YourModel...It will render Duration field as belowTimeDurationWidgetduration=forms.DurationField(widget=TimeDurationWidget(show_days=True,show_hours=True,show_minutes=True,show_seconds=True),required=False)Following keyword argument can be passed to show/ hide fields in duration widget.By default all keyword arguments are set toTrueshow_days: To display/ hide days field in widgetshow_hours: To display/ hide hours field in widgetshow_minutes: To display/ hide minutes field in widgetshow_seconds: To display/ hide seconds field in widget
Package: django-durationwidget2
Django Duration WidgetThis package provides a more natural way of defining duration fields in forms. It is derived from the
work of Devang Padhiyarhereand provides a
Python2 compatible implementation.When to use?You can find duration field as below which is not far good for humans to use.Django duration widget is used for simplifying Django model'sDurationfield.Quick startInstalldjango-durationwidget2usingpippip install django-durationwidget2Adddurationwidgetto yourINSTALLED_APPSsetting like this::INSTALLED_APPS=[...'durationwidget',]Make sure to setAPP_DIRStoTruein settings.pyTEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','DIRS':[os.path.join(BASE_DIR,'templates'),...],'APP_DIRS':True,# Setup this to True'OPTIONS':{...},},]Cheer up you are ready to useTimeDurationWidgetas normal widget as below.fromdjangoimportformsfromdurationwidget.widgetsimportTimeDurationWidgetfrom.modelsimportYourModelclassCustomForm(forms.ModelForm):...duration=forms.DurationField(widget=TimeDurationWidget(),required=False)classMeta:model=YourModel...It will render Duration field as belowTimeDurationWidgetduration=forms.DurationField(widget=TimeDurationWidget(show_days=True,show_hours=True,show_minutes=True,show_seconds=True),required=False)Following keyword argument can be passed to show/ hide fields in duration widget.By default all keyword arguments are set toTrueshow_days: To display/ hide days field in widgetshow_hours: To display/ hide hours field in widgetshow_minutes: To display/ hide minutes field in widgetshow_seconds: To display/ hide seconds field in widget
Package: django-dust-sensor
=====Django DUST sensor=====Read data from dust sensor connected via RPi Serial port. This is proprietary software for customized hardware used by WebEye.services- version 0.2.34 fixed avg_unit counting regarding http://www.howmuchsnow.com/arduino/airquality/Quick start-----------1. Add "dust_sensor" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'dust_sensor',)2. Include the polls URLconf in your project urls.py like this::url(r'^dust_sensor/', include('dust_sensor.urls')),3. update settings- DUST_SENSOR_VENTIOLATION_GPIO: number of GPIO to enable/disable ventilation- DUST_SENSOR_SERIAL_PORT: should be "/dev/ttyAMA0"- DUST_SENSOR_SERIAL_SPEED: should be 96004. set up loggersfor fluentd or td-agent  use handler name fluend.dust_sensorfor django human readable logger handler use django.dust_sensor5. add celery beat schedule settingsCELERYBEAT_SCHEDULE = {'refresh_dust_measure': {'task': 'dust_sensor.tasks.refresh_dust_measure','schedule': timedelta(minutes=1)}}6. Run `python manage.py migrate` to create the polls models.7. Start the development server and visit http://127.0.0.1:8000/admin/to create a poll (you'll need the Admin app enabled).8. Visit http://127.0.0.1:8000/dust_sensor/ to read data.
Package: django-dynamic
Django Dynamic:What if you can generate Django Apps without learning how to code from a Django app?This seems possible…Most code was taken from,https://code.djangoproject.com/wiki/DynamicModelsHow to use:Deploy django-dynamic or copy app as your base app name.Make a virtual environmentpip install -r requirements.txtFill in database detailsVisit the adminStart adding apps.Important Notes:Before you start run python manage.py startapp <APP_NAME>
According to what you will name your app in the admin section.If you make a change to app or model, drop all of the app tables and start from scratch with the following steps.Drop all app tables.Run, python manage.py makemigrations –empty <APP_NAME>Then run, python manage.py makemigrationsThen run, python manage.py migrateAlso please access the homepage to load your apps like needed into Django.http://127.0.0.1:8000/You will soon get the hang of it.This is only the planned version, do not use in production until you know all the ins and outs of Django Dynamic.
Package: django-dynamic-admin
Create dynamic models from Django administration (with migration support).Quick startInstall django-dynamic-admin package in your Django project:pip install django-dynamic-adminAdd “django-dynamic-admin” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'polymorphic'
    'dynamicadmin',
]Runpython manage.py migrateto create the base models.Seehttps://github.com/seht/dynamicadmin-example-projectfor example usage.Visithttp://127.0.0.1:8000/admin/to create dynamic models from Django administration.Adding new Field typesCreate new field types by extendingdynamicadmin.models.FieldAdding new Content typesCreate new content types by extendingdynamicadmin.models.BundleTODOField weights…
Package: django-dynamic-allowedsites
=============================
django-dynamic-allowedsitesDjango 1.6+ library for setting yourALLOWED_HOSTSbased on the domains indjango.contrib.sites.. image::https://travis-ci.org/frankyjquintero/django-allowedsites.svg?branch=master:target:https://travis-ci.org/frankyjquintero/django-allowedsitesUsage is something like the following, in yoursettings.pyor equivalent::from allowedsites import AllowedSites
ALLOWED_HOSTS = AllowedSites(defaults=('mytestsite.com',))Or, if you want to use your cache backend::from allowedsites import CachedAllowedSites
ALLOWED_HOSTS = CachedAllowedSites()A single key,allowedsiteswill be inserted containing an unsorted collection
of all the domains that are in thedjango.contrib.sites. For the sake of allowing
multiple processes to keep up to date with theSitevalues without hitting
the database, using a shared cache (ie: notLocMemCache) is encouraged.TheCachedAllowedSitesalso provides anupdate_cacheclass method which
may be used as a signal listener::from django.db.models.signals import post_save
from django.contrib.sites.models import Site
post_save.connect(CachedAllowedSites.update_cache, sender=Site,
                  dispatch_uid='update_allowedsites')You can modify the the defaults::from allowedsites import AllowedSites
ALLOWED_HOSTS = AllowedSites(defaults=('mytestsite.com',))
ALLOWED_HOSTS += AllowedSites(defaults=('anothersite.net',))
ALLOWED_HOSTS -= AllowedSites(defaults=('mytestsite.com',))
# ultimately, only anothersite.net is in the defaultsOther uses?Itmaywork withdjango-csp_ (Content Security Policy headers),django-cors-headers_ Cross-Origin Resource Sharing (CORS) headers and others. I don't know... _django-csp:https://github.com/mozilla/django-csp.. _django-cors-headers:https://github.com/adamchainz/django-cors-headers
Package: django-dynamic-api
Django Dynamic APISimple tool thatGenerates Secure APIson top ofDRFwith minimum effort - actively supported byAppSeed.Dynamic API Features- seevideopresentationAPI engineprovided byDRFMinimal Configuration(single line in config for each model)Handles any modeldefined across the projectHow to use itStep #1-Install the package$pipinstalldjango-dynamic-api
//OR
$pipinstallgit+https://github.com/app-generator/django-dynamic-api.gitStep #2-Update Configuration, include the new APPsINSTALLED_APPS=['django_dyn_api',# Django Dynamic API  # <-- NEW'rest_framework',# Include DRF         # <-- NEW'rest_framework.authtoken',# Include DRF Auth    # <-- NEW]Step #3-Register the modelincore/settings.py(DYNAMIC_API section)This sample code assumes thatapp1exists and modelBookis defined and migrated.DYNAMIC_API={# pattern:# API_SLUG -> Import_PATH'books':"app1.models.Book",}REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':['rest_framework.authentication.SessionAuthentication','rest_framework.authentication.TokenAuthentication',],}Step #4-Migrate DBand create the tables used byDRF$pythonmanage.pymakemigrations
$pythonmanage.pymigrateStep #5-Update routing, include APIsfromdjango.contribimportadminfromdjango.urlsimportpath,include# <-- UPD: 'include` directivefromrest_framework.authtoken.viewsimportobtain_auth_token# <-- NEWurlpatterns=[path("admin/",admin.site.urls),path('',include('django_dyn_api.urls')),# <-- NEWpath('login/jwt/',view=obtain_auth_token),# <-- NEW]Step #6-Use APIIf the managed model isBooks, the API interface is/api/books/and all CRUD methods are available.Note: for mutating requests, theJWT Tokenis provided byhttp://localhost:8000/login/jwt/route (the user should exist).Links & resourcesDRF- HOMEpageMoreDeveloper Toolsprovided byAppSeedAsk forSupportviaEmail&DiscordDjango Dynamic API- Open-source library provided byAppSeed
Package: django-dynamic-breadcrumbs
django-dynamic-breadcrumbsdjango-dynamic-breadcrumbsis a Django app to generate HTML breadcrumbs
dynamically from URL paths.Athttps://example.com/reference/instrument/guitar/, shows:Home > Reference > Instrument > Guitar.Quick start1. Installpip install django-dynamic-breadcrumbs2. Add to settingsAdd "dynamic_breadcrumbs" label to your INSTALLED_APPS settings:INSTALLED_APPS = [
    ...
    'dynamic_breadcrumbs',
]Adddynamic_breadcrumbs.context_processors.breadcrumbstocontext_processors:TEMPLATES=[{"BACKEND":"django.template.backends.django.DjangoTemplates","DIRS":[os.path.join(BASE_DIR,"templates")],"APP_DIRS":True,"OPTIONS":{"context_processors":[#..."dynamic_breadcrumbs.context_processors.breadcrumbs",],},},]3. Add templateInclude thedynamic_breadcrumbs/breadcrumbs.htmlin your base template.{% if breadcrumbs %}
<div class="container">
    {% include "dynamic_breadcrumbs/breadcrumbs.html" with breadcrumbs=breadcrumbs%}
</div>
{% endif %}Now each time you visit a page which makes use of the above template,
it will have the breadcrumbs generated from the URL path.4. (Optional) CustomizationTweak defaultsettings.DocumentationFull docs at:https://django-dynamic-breadcrumbs.readthedocs.io/LicenseMIT
Package: django-dynamic-business-rules
A Django centric event driven rules engine for extensible and configurable responses to changes to django models and triggers.DocumentationThe full documentation is athttps://django-dynamic-business-rules.readthedocs.io.Use CasesConfigure Rules for sending messages to users and edit them without deploying new codeBlock spam users if they perform too many suspiscious activities during a certain time frame, allow non-programmer users to edit that time frameTrigger a required password reset if a configurable set of suspiscious behaviors are encounteredKey IdeasThe goal of this project is to allow non-technical users to be able to
configure behaviors of the system, similar to a commercial tool like
IFFT or Zapier. Non-developer end users of this tool are not required
to be programmers but they will need to be at least somewhat technical
in their understanding of the system so for the remainder of the
document will will refer to them as “analysts”.QuickstartInstall Django Dynamic Business Rules:pip install django-dynamic-business-rulesAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'dynamic_business_rules.apps.DynamicBusinessRulesConfig',...)Add Django Dynamic Business Rules’s URL patterns:fromdynamic_business_rulesimporturlsasdynamic_business_rules_urlsurlpatterns=[...url(r'^admin/dynamic-rules/',include(dynamic_business_rules_urls)),...]Create a Variable classIn one of your Django apps create a variable class in a file nameddynamic_rule_variables.py(this name must be used so we can
introspect apps looking for implementations of variable classes)The Variable object translates a Django signal into a set of values
that non-technical users can use when creating conditional business
rules. For an example Variable object see example/dynamic_rule_variables.py you’ll notice
that the variable object doesn’t inherit from any object, it’s
constructor receives a django signal as kwargs and then its properties
evaluate the properties of that signal (in the case of the example the
post_save signal’s instance is a key value).Create an Action classIn one of your Django apps create an action class in a file nameddynamic_rule_actions.py(this name must be used so we can
introspect apps looking for implementations of action classes)The action object provides methods that rule sets can “fire” if all
their conditions evaluate to true.Screenshots of AdminCreating a New RuleAdding Conditions To EvaluateFeaturesAllows users to implement and extend their ownVariableandActionclasses in a flexible way that allows you to build a business rules engine that fits the needs of your project.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2019-02-08)First release on PyPI.
Package: django-dynamic-cabinetmaps
Django-Dynamic-Cabinet Maps====[![versions](https://img.shields.io/badge/python-2.7-yellow.svg)]()[![versions](https://img.shields.io/badge/Development%20Status-0.1.dev2-orange.svg)]()[![Documentation Status](https://readthedocs.org/projects/django-dynamic-cabinetmaps/badge/?version=v0.1.dev2)](http://django-dynamic-cabinetmaps.readthedocs.org/en/v0.1.dev2/?badge=v0.1.dev2)一个轻量级、用于Django框架下的“动态生成机柜图”工具> 目前还处于开发测试阶段，不够完善的地方，我会在文档中进行标注；欢迎大家提出宝贵意见。>> 开发版本暂时不支持ie内核, Chrome\Firefox\Safair都支持## Introduce尽管绘制机柜图的需求是非常普遍的，尤其是在构建CMDB平台。但在其机柜设计与开发中，还是有不少的坑需要大家注意和解决；因此这个小项目或许可以多多少少解决大家在实际开发中遇到的痛点和麻烦。对于机柜图的处理，先前已经有很多主流的做法，那么‘Django-Dynamic-Cabinet Maps’到底有什么优势呢？- 轻量级- Don’t  XML / YML ！- Don’t  TinyXML ！- Don’t  Config Template !- Don’t  Repeat Yourself ！- 动态性- 可动态调整机柜排版- 机柜的个数和机柜中导轨的个数可被不同的需求动态改变。- 扩展性- 可定制的机柜编号- 可定制的机柜样式- 兼容和支持Bootstrap进行页面美化- 默认可支持100个机柜(通过定制可以更大0_0)## Requirements- Python 2.7- Django 1.6, 1.7, 1.8- sass 3.4+ (不是必须)## Installation1. 通过pip进行安装```pip install django-dynamic-cabinetmaps```- 也可以使用GitHub直接clone进行安装2. 在settings.py进行添加```INSTALLED_APPS = (......'cabinet_structure',......)```## Demo1. 从git上克隆 https://github.com/boylegu/django-dynamic-cabinetmaps.git2. 然后进入``demoapp``3. ``python manage.py runserver``4. 通过浏览器访问``http://127.0.0.1:8000/cabinetmaps/``>> 目前demo是需要django 1.6运行## Usage & Documentation详细使用帮助,可以查看[文档](http://django-dynamic-cabinetmaps.readthedocs.org/en/latest/).## Future- 支持Python 3.- 将会在正式版中修正样式显示的问题.- 完善样式可定制的功能.- 机柜编号可支持反转.- 增加服务器数据渲染的API- 支持机柜分页## Support如果你有任何意见和交流可以直接通过GitHub或者加QQ讨论群:`315308272`与我交流## Authors- 顾鲍尔 (Boyle Gu)
Package: django-dynamic-datatb
Django Dynamic DataTablesOpen-Sourcelibrary forDjangothat provides apowerful data table interface(paginated information) with minimum effort - actively supported byAppSeed.Django Dynamic Services-sample project that uses the libraryDjango - Build Services without Coding-video presentationFeaturesModern Stack:Django&VanillaJSDTlayer provided bySimple-DataTablesServer-sidepaginationSearch, FiltersExports in PDF, CSV formatsMIT License(commercial use allowed)How to use itStep #1-Install the package$pipinstalldjango-dynamic-datatb
//OR
$pipinstallgit+https://github.com/app-generator/django-dynamic-datatb.gitStep #2- Update Configuration,add new importsimportos,inspectimportdjango_dyn_dtStep #3- Update Configuration,include the new APPsINSTALLED_APPS=['django_dyn_dt',# <-- NEW App]Step #4- Update Configuration, include the newTEMPLATESDIRTEMPLATE_DIR_DATATB=os.path.join(BASE_DIR,"django_dyn_dt/templates")# <-- NEW AppTEMPLATES=[{"BACKEND":"django.template.backends.django.DjangoTemplates","DIRS":[TEMPLATE_DIR_DATATB],# <-- NEW Include"APP_DIRS":True,"OPTIONS":{},},]Step #5- Update Configuration, updateSTATICFILES_DIRSDIRDYN_DB_PKG_ROOT=os.path.dirname(inspect.getfile(django_dyn_dt))# <-- NEW AppSTATICFILES_DIRS=(os.path.join(DYN_DB_PKG_ROOT,"templates/static"),)Step #6-Register the modelinsettings.py(DYNAMIC_DATATB section)This sample code assumes thatapp1exists and modelBookis defined and migrated.DYNAMIC_DATATB={# SLUG -> Import_PATH'books':"app1.models.Book",}Step #7-Update routing, include APIsfromdjango.contribimportadminfromdjango.urlsimportpath,include# <-- NEW: 'include` directive addedurlpatterns=[path("admin/",admin.site.urls),path('',include('django_dyn_dt.urls')),# <-- NEW: API routing rules]Step #8- Use the Dynamic Datatable moduleIf the managed model isBooks, the dynamic interface is/datatb/books/and all features available.Links & resourcesDRF- HOMEpageMoreDeveloper Toolsprovided byAppSeedAsk forSupportviaEmail&DiscordDjango Dynamic DataTables- Open-source library provided byAppSeed
Package: django-dynamic-db-router
Django Dynamic DB RouterWorking with multiple databases within django is supported, but the
syntax requires peppering.using('my_database')throughout all
queries that need to be routed to different databases. This is
especially painful when trying to use libraries that were written
without multiple database support in mind. With this library, running
complex queries across different databases is as simple as:fromdynamic_db_routerimportin_databasewithin_database('non-default-db'):result=run_complex_query()To set up you django project to be able to use this router, simplypip installdjango-dynamic-db-routerand addDATABASE_ROUTERS=['dynamic_db_router.DynamicDbRouter']to your
Django settings.Django Dynamic DB Router includes a number of additional features,
such as:Usingin_databaseas a function decorator.Read and write protection controls.Load database configurations dynamically for the lifetime of the
context manager.For more information, and complete API documentation, see the docs,
linked below.InstallationTo install the latest release, type:pip install django-dynamic-db-routerTo install the latest code directly from source, type:pip install git+git://github.com/ambitioninc/django-dynamic-db-router.gitDocumentationFull documentation is available athttp://django-dynamic-db-router.readthedocs.orgLicenseMIT License (see LICENSE)
Package: django-dynamicfields
It offers a Django Field able to dynamically add extra fields to any model using Admin
interface.This app has been designed to work as front-end to an Django/ElasticSearch based stack.QuickstartInstall django-dynamicfields:pip install django-dynamicfieldsThen use it in a project:import django_dynamicfieldsHistory0.1.0 (2015-10-02)First release on PyPI.
Package: django-dynamic-file
A hopefully flexible approach to serving dynamic files with django.IntroductionCurrently there are many other file handling libraries out there, most of them designed
to handle files efficiently, make use of various storage backends or provide a good admin integration.This library aims at providing an easy interface for handling files in conjunction with django rest framework, providing
methods for applying generic permissions to serving, updating and deleting files.This is done by wrappingFileFieldin their own model.You may read more about the usage of this libraryat the official documentation site.
Package: django-dynamic-filenames
Write advanced filename patterns using theFormat String Syntax.Getting StartedInstallationpipinstalldjango-dynamic-filenamesSamplesBasic example:fromdjango.dbimportmodelsfromdynamic_filenamesimportFilePatternupload_to_pattern=FilePattern(filename_pattern='{app_label:.25}/{model_name:.30}/{uuid:base32}{ext}')classFileModel(models.Model):my_file=models.FileField(upload_to=upload_to_pattern)Auto slug example:FeaturesField namesextFile extension including the dot.nameFilename excluding the folders.model_nameName of the Django model.app_labelApp label of the Django model.instanceInstance of the model before it has been saved. You may not have a primary
key at this point.uuidUUID version 4 that supports multiple type specifiers. The UUID will be
the same should you use it twice in the same string, but different on each
invocation of theupload_tocallable.The type specifiers allow you to format the UUID in different ways, e.g.{uuid:x}will give you a with a hexadecimal UUID.The supported type specifiers are:sString representation of a UUID including dashes.iInteger representation of a UUID. Like toUUID.int.xHexadecimal (Base16) representation of a UUID. Like toUUID.hex.XUpper case hexadecimal representation of a UUID. Like toUUID.hex.base32Base32 representation of a UUID without padding.base64Base64 representation of a UUID without padding.WarningNot all file systems support Base64 file names.All type specifiers also support precisions to cut the string,
e.g.{{uuid:.2base32}}would only return the first 2 characters of a
Base32 encoded UUID.Type specifiersYou can also use a special slug type specifier, that slugifies strings.Example:fromdjango.dbimportmodelsfromdynamic_filenamesimportFilePatternupload_to_pattern=FilePattern(filename_pattern='{app_label:.25}/{model_name:.30}/{instance.title:.40slug}{ext}')classFileModel(models.Model):title=models.CharField(max_length=100)my_file=models.FileField(upload_to=upload_to_pattern)Slug type specifiers also support precisions to cut the string. In the example
above the slug of the instance title will be cut at 40 characters.