Saravanan666/pypi-org huggingface dataset:
Package: djgo
djgoDescriptionThis package provides some shortcuts for your django app.Installationpip install djgoPyPI pageGitHub pageUsagedjgo has shortcuts for different parts of the app.
To use it, simply import it withimport djgo.manage.pyMethodstart_django()(ormanage()) is a shortcut for launching Django.wsgi.pyMethodset_wsgi()is a shortcut that sets Django settings env variable and returns default wsgi application.urls.pyMethodload_app()is a shortcut that loads and returns an app module or its part.app/contrib.pyMethodapp_config()is a shortcut that sets Django app config. Example:from djpp import app_config
default_app_config = app_config(verbose_name='My Cool App')app/models.pyDecorator@metais a shortcut that sets meta and __str__() for your model.WARNING: All meta defined this way won't register in migrations.Example:@meta(single='My Client', plural='My Clients', display='name')
class Client(models.Model):
    name = models.CharField()is equal toclass Client(models.Model):
    name = models.CharField()
    class Meta:
        verbose_name = 'My Client'
        verbose_name_plural = 'My Clients'
    def \_\_str\_\_():
        return self.nameexcept the meta (name and verbose_name) won't register in migrations.You can also pass functions todisplay:@meta('My Client', display=lambda self: 'Cool ' + str(self.name))
class Client(models.Model):
    name = models.CharField()is equal toclass Client(models.Model):
    name = models.CharField()
    class Meta:
        name = 'My Client'
        verbose_name = 'My Client'
    def \_\_str\_\_():
        return 'Cool ' + str(self.name)except the meta (name and verbose_name) won't register in migrations.djgo.admindjgo has a small set of methods for admin site and admin.py file:admin.urlsis a shortcut forpath('url', admin.site.urls), except adds '/' in the end of your url string if it doesn't have one.admin.metais a shortcut for settingadmin.site.site_headerandadmin.site.site_title.admin.clear_modelsis a shortcut for clearing models from admin site registry.admin.quick_inlineis adecoratorfor setting some tabular inline params.Other featuresYou can also access settings through djgo withdjgo.settings!Lastly, djgo provides a smalllog()method for printing some info.
Package: dj-graphene
Dj GrapheneThis package adds extra functionalities to graphene-django to make stuffs more in the "django way", writing less code and get more things done.WARNING:This is still in development and some things may not work properly. I will try to solve all the bugs ASAP but it may take time.FeaturesNote:By installing this package graphene and graphene-django will be available so all the features of those packages are also available.New base type: ModelObjectTypeModelObjectType allow to create new types with default permissions. The fields in this package only works with subtypes of ModelObjectTypeA straightforward but powerful permissions system (like DRF permissions)New fields: RelayConnectionField, RelayFilterConnectionFieldDjangoModelMutationAllow to create easily create/update/delete mutationsTypesFor the following examples we will use these models:classAuthor(models.Model):name=models.CharField(max_length=100,blank=False)birthday=models.DateField()classBook(models.Model):isbn=models.CharField(max_length=30,unique=True)title=models.CharField(max_length=100,blank=True)author=models.ForeignKey(Author,on_delete=models.CASCADE)The types would look like this:classAuthorNode(ModelObjectType):classMeta:model=Authorfilter_fields={'name':['exact','icontains','istartswith'],}# we use RelayNode instead of graphene.relay.Nodeinterfaces=(RelayNode,)permission_classes=(IsAuthenticated,)classBookNode(ModelObjectType):classMeta:model=Bookinterfaces=(RelayNode,)permission_classes=(IsAuthenticated,)QueriesclassQuery(graphene.ObjectType):author=RelayNode.Field(AuthorNode)authors=RelayFilterConnectionField(AuthorNode)book=RelayNode.Field(BookNode)books=RelayFilterConnectionField(BookNode)MutationsclassNewAuthorMutation(DjangoModelMutation):classMeta:model=Authorfields=('name','birthday')permission_classes=(IsAuthenticated,)classUpdateAuthorMutation(DjangoModelMutation):classMeta:model=Authorpermission_classes=(IsAuthenticated,)classDeleteAuthorMutation(DjangoModelMutation):classMeta:model=Authorfields=['id']# required param to indicate that this is a delete mutationdeleting=True# is_relay is used to translate GlobalId into Django IDsis_relay=Truepermission_classes=(IsAuthenticated,)classMutations(graphene.ObjectType):create_author=NewAuthorMutation.Field()update_author=UpdateAuthorMutation.Field()delete_author=DeleteAuthorMutation.Field()
Package: dj-gravatar
Dj-GravatarDj-Gravataris a Python package to display avatars usingGravataron a website developed using Django Framework.InstallationWindows OSIn the terminal/PowerShell, typepython-mpipinstalldj-gravatarIf you do not havepip, then download the package fromhere, unzip it and keep it in your Django project's root directory (as an app).Linux/MacOSIn the terminal, typesudopip3installdj-gravatarIf you are in a virtual environment, typepipinstalldj-gravatarIf you do not havepip, then download the package fromhere, unzip it and keep it in your Django project's root directory (as an app).UsageSuppose the directory structure of your project is like this.Django_Project
â”‚db.sqlite3
â”‚manage.py
â”‚
â”œâ”€â”€â”€pages
â”‚â”‚admin.py
â”‚â”‚apps.py
â”‚â”‚models.py
â”‚â”‚tests.py
â”‚â”‚urls.py
â”‚â”‚views.py
â”‚â”‚__init__.py
â”‚â””â”€â”€â”€templates
â”‚â”‚base.html
â”‚â”‚
â”‚â””â”€â”€â”€pages
â”‚about.html
â”‚index.html
â”‚
â””â”€â”€â”€Django_Projectasgi.pysettings.pyurls.pywsgi.py__init__.pyInDjango_Project/settings.py,...INSTALLED_APPS=[...'dj_gravatar'# NOTE: underscore(_) is used instead of hyphen(-)...]...In the Django Template (.htmlfile) where you want to show the gravatar,{% load gravatar %}
...<imgsrc="{% gravatar_url 'email@mail.com' 200 %}"alt="profile-pic">...The above code outputs like this:<imgsrc="http://www.gravatar.com/avatar/267f3587edc9b64d8e80ee7eca8abbcb?s=200&d="alt="profile-pic"><!-- OR --><imgsrc="http://www.gravatar.com/avatar/[hash]?s=200&d="alt="profile-pic">The arguments=200represents the size of the image (size=200px). Default size is 80px.You can also use the following snippet to achieve the same as above:{% load gravatar %}
...
{% gravatar 'email@mail' 200 "alt='profile-pic'" %}
...You can use any HTML attribute instead ofalt, likestyle. But only use one optional attribute at a time, Otherwise you will getTemplateSyntaxError.If you want to usehttps://.../instead of the defaulthttp://.../, then add the following setting in yoursettings.pyfile.GRAVATAR_SECURE=True# Default FalseIf any email address has no matching Gravatar image, then, a default image is shown. There are the following types of default images:404:do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) responsemp:(mystery-person) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash)identicon:a geometric pattern based on an email hashmonsterid:a generated 'monster' with different colors, faces, etcwavatar:generated faces with differing features and backgroundsretro:awesome generated, 8-bit arcade-style pixelated facesrobohash:a generated robot with different colors, faces, etcblank:a transparent PNG image (border added to HTML below for demonstration purposes)You cansee herehow each type of default image looks like.To show a particular default image out of the above, add the following setting to yoursettings.pyfile.GRAVATAR_DEFAULT_URL='identicon'# Choose any one of the aboveContributeContributions are welcome. If you spot any bug(s), have a feature request, or anything else, don't hesitate todo aPull Request, oropening an issuefromhere.
Package: djgunicorn
Run Django development server with Gunicorn.QuickstartInstall django-gunicorn:pip install djgunicornThen add it to yourINSTALLED_APPS. You will get a new commandgunserver(please forgive my little pun-loving self). It runs like
Django’s development server, but the HTTP handling is backed by Gunicorn.FeaturesYou can find available options with:python manage.py help gunserverMost options work as the built-inrunservercommand (indjango.contrib.staticfiles). Exceptions:Theverbosityandno-colorsettings arenotpassed to Gunicorn.
They still affect messages emitted by the command itself, however.Thenothreadingoption does not do anything.TodoUnit tests and CI.Check how low we can support Django and Gunicorn versions.Support for additional Gunicorn configs that may be useful. SSL seems to
be a common need.Is it possible to conditionally replace therunservercommand? By
installing an alternative app config, for example?We now useDJANGO_SETTINGS_MODULEto relay where the settings module is
to the Gunicorn subprocess (and let Django loads it automatically). This
causes problems ifsettings.configure()is called manually without a
module, and will likely require some hacks to fix.Interesting Links#21978 (Add optional gunicorn support to runserver)Fixed #21978 – Added optional gunicorn support to runserver. · django/djangodj-static/dj_static.py · kennethreitz/dj-staticSSL support for Django-admin runserverSettings — Gunicorn documentationHistory0.3.0 (2016-04-13)Add Gunicorn config changing directory to wheremanage.pyto avoid
problems whenmanage.pyis run in another directory.Info message is now displayed when Gunicorn reloads, asrunserverdoes.Enable extendedrunserverprovided bystaticfilesonly if it is
installed (which is the default).Gunicorn access logs are now coloured, asrunserver’s.Get rid of a custom static handler in favour of Django’s stock one.0.2.0 (2016-04-12)Gunicorn invocation is re-implemented withsubprocessto handle reloading
gracefully. (benoitc/gunicorn#935)0.1.1 (2016-04-11)Lazy-load WSGI handler in Gunicorn application to avoid race conditions.0.1.0 (2016-04-11)First release on PyPI.
Package: djhacker
Basic usageInstall withpip install djhackerand then:importdjhackerdjhacker.formfield(YourModel.your_field,form_class=YourFormField,custom_form_field_kwarg='something',)This will make any Django ModelForm render aYourFormField(custom_form_field_kwarg='something')by default, plus
whatever other kwargs it wants to add, you won’t have to use any specific model
form, this will work natively in the admin for instance.Noteform_classis optionnal, you may as well just pass kwargs and not
change the default form class for a form field.Custom formfield callbackYou can register custom form field for model field types:@djhacker.register(models.ForeignKey)defcustom_fk_formfield(model_field,**kwargs):returndict(form_class=YourFormField,custom_form_field_kwarg=something,**kwargs,)# you don't need to pass extra arguments anymore for ForeignKey fields:djhacker.formfield(YourModel.some_fk,queryset=Some.objects.all())Widget Script attributesAnother thing Django is not doing anytime soon isletting you customize script
tags. Which means there’s no
easy way to combine Widget.Media.js and any of the nice new script tag
attributes, including, but not limited to:async,defer: good to control when your script is loadedtype="module": to load a script as an EcmaScript Module (ESM) and use
importsLet’s have this anyway, first patch Django’s Media render_js:importdjhackerdjhacker.media_script_attributes()Then, let’s customize a script tag:classYourWidget(forms.Widget):classMedia:js=['your/script.js[type=module][defer=true]',]It will render as such:<scriptsrc="/static/your/script.js"type="module"defer="true"></script>UpgradeTo v0.2.xRegistered callbacks now return a simple dict with the form field class in
form_class.@djhacker.register(models.ForeignKey)defcustom_fk_formfield(model_field,**kwargs):returnYourFormField,{'custom_form_field_kwarg':'something',**kwargs,)Becomes:@djhacker.register(models.ForeignKey)defcustom_fk_formfield(model_field,**kwargs):returndict(form_class=YourFormField,custom_form_field_kwarg=something,**kwargs,)
Package: dj-happy-quotas
dj-happy-quotasTransaction-based quotas for Django.IntroductionBelieve it or not, but some users really don't enjoy signing up for monthly or annual subscription plans. And for some applications such subscriptions also don't really make much sense, like when they are best used ocassionally by means of single-fire transactions.This package provides handling of transaction-like quotas that a user can fill up on demand.Handling of pricing plans and payments are not subject of this package.UseInstall:poetry add dj-happy-quotas(A merepip install dj-happy-quotasmight work as well.)Add toINSTALLED_APPSinsettings.py:INSTALLED_APPS=[...'dj-happy-quotas',...]Run database migrations:python manage.py migrate dj-happy-quotasPublishing a new release# Update version number in pyproject.toml and happy_quotas/__init__.py# Check that everything looks okpoetryconfig--list
poetrycheck# Publishpoetrybuild
poetrypublishRelated projectsdjango-billingfor a very similar approach to this one here but being more generic in targetting recurring billing on top.django-flexible-subscriptionsfor handling of subscriptions where authentication is plugged via Django's standard groups.django-plansfor subscription pricing plans including quotas and account expiration.django-subscriptionsA django package for managing the status and terms of a subscription.django-paddleDjango models and helpers for integrating paddle subscriptions.dj-paddlefor subscriptions-related paddle integration.
Package: dj-haystack-url
Haystack configuration from environment variableFree software: MIT licenseSupported BackendsSupport currently exists for Simple, Whoosh, Elasticsearch, Solr, and Xapian
backends.InstallationInstallation is simple:$ pip install dj-haystack-urlUsageConfigure your Haystack connections insettings.pyfromHAYSTACK_CONNECTIONS(defaultis optional):HAYSTACK_CONNECTIONS = {'default': dj_haystack_url.config(default='simple')}Parse an arbitrary Haystack connection URL:HAYSTACK_CONNECTIONS = {'default': dj_haystack_url.parse('simple')}URL schemaEngineHaystack BackendURLSimplehaystack.backends.simple_backend.SimpleEnginesimpleWhooshhaystack.backends.whoosh_backend.WhooshEnginewhoosh:PATH[1]Elasticsearchhaystack.backends.elasticsearch_backend.ElasticsearchSearchEngineelasticsearch:URL/INDEX_NAMESolrhaystack.backends.solr_backend.SolrEnginesolr:URLXapianxapian_backend.XapianEnginexapian:PATH[1][1](1,2)Whoosh and Xapian connect to an index on the file system. The same URL
format is used, omitting the hostname, and using the “file” portion as the file
path to the index.History0.1.0 (2014-01-11)First release on PyPI.
Package: djhcup_core
=====HCUP Hachoir: Core module=====Part of the Django-HCUP Hachoir set of Python packages. Provides core functionality, including automated detection and configuration of other installed djhcup components.Quick start-----------0. HCUP Hachoir uses Celery (http://www.celeryproject.org/) as a tasking layer by default. Be sure you have properly configured your Django installation to use Celery, including a message broker and result backend. Typically this invovles creating a celery.py file as described in http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html, and adding configuration items to your settings.py file.For example, with a local rabbitmq-server back-end, add these lines::BROKER_URL = 'amqp://'CELERY_RESULT_BACKEND = 'amqp://'1. Add "djhcup_core" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'djhcup_core',)2. Modify your urls.py to include the following pattern entry::url(r'', include('djhcup_core.urls'))If you want all djhcup addresses to appear as a subdirectory instead, such as www.example.com/your_prefix/, change r'' to r'your_prefix'::url(r'your_prefix', include('djhcup_core.urls'))3. Modify your settings.py to include a separate database dictionary entry for djhcup named 'djhcup'. For example::'djhcup': {'ENGINE': 'django.db.backends.postgresql_psycopg2','NAME': 'your_db_name','USER': 'your_db_user','PASSWORD': 'your_db_password','HOST': 'your_db_host','PORT': '5432',},Note that while this could use the same database and credentials as your default entry, we recommend you set it up in a separate database for easier management.4. Tell djhcup where to look for your HCUP data by adding these lines to your settings.py::import os, pyhcup# Look in here for data and loadfilesDJHCUP_IMPORT_PATHS = ['/path/to/your/hcup/data/', # update this to point at your raw dataos.path.dirname(pyhcup.__file__), # loadfiles included with PyHCUP]5. Run `python manage.py syncdb` to create the djhcup_staging models. Or, if using South, migrate forward to build database objects for this package's models.6. Start your server per normal (for test servers, use `python manage.py runserver`).
Package: dj-healthchecks
Installationpip install dj-healthchecksUsageAdd to a projectInurls.py:from django.conf.urls import url, include

from rest_framework import routers
from healthchecks.api import HealthViewSet

router = routers.DefaultRouter()
router.register(r'health', HealthViewSet, basename='health')

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^', include(router.urls)),
]You define your healthchecks insettings.pyHEALTH_CHECKS=['healthchecks.checks.im_ok','healthchecks.checks.connect_to_db','healthchecks.checks.connect_to_queue','healthchecks.checks.connect_to_redis','healthchecks.checks.ping_upstream_urls',...]This library provides some utility healthchecks, but you can also easily write your own.Provided healthchecks are inhealthchecks/checks.pySpecifying your own healthcheck:HEALTH_CHECKS=[...'myapp.myodule.my_health_check',]Now you have:GET /health/ # run all health checks in settings.py
GET /health/some-health-check/ # run a specific healthcheckNote:for a specific healthcheck, you-will be replaced with.Run project:docker-compose upRun tests:docker-compose run --rm web python manage.py testProfit.UpdatingBump the version:bumpversion manjor|minor|patchPush to master
Package: dj-hitcount
Basic app that allows you to track the number of hits/views for a particular object.This project was built upon the efforts ofdjango-hitcount. It was made a separate project as theoriginal one had been stalledfor a long time.Documentation:http://dj-hitcount.rtfd.orgSource Code:https://github.com/abhiabhi94/dj-hitcountIssuesUse the GitHubissue trackerfor dj-hitcount to submit bugs, issues, and feature requests.Changeloghttp://dj-hitcount.readthedocs.org/en/latest/changelog.html
Package: dji3d
DJI3DDJI3D is a tool for graphing 3d positional data extracted from DJI drone telemetry. Many DJI drones have the option to save basic flight telemetry data inside subtitle tracks on recorded videos. This script will extract this data and export it in one of three formats:3D graphTakes GPS data, and plots it with matplotlibJSONA raw, timestamped JSON dumpCSVA timestamped CSV logUsageusage: dji3d [-h] [-i] [-f {graph,csv,json}] [-o OUTPUT] input

DJI3D is a tool for graphing 3d positional data extracted from DJI drone telemetry

positional arguments:
  input                 Raw drone video file with telemetry data

optional arguments:
  -h, --help            show this help message and exit
  -i, --interactive     Run interactively
  -f {graph,csv,json}, --format {graph,csv,json}
                        Output format
  -o OUTPUT, --output OUTPUT
                        Output locationInstallingpython3-mpipinstalldji3dExample
Package: djib
Djib Python SDKIt's the base Python library for interacting with Djib network.
You can use it interact
with the Djib network.QuickstartInstallationpipinstalldjibGeneral RPC Usagefromdjib.rpcimportDjibRpcWALLET_PRIVATE_KEY='<Base58 encoded string>'try:rpc=DjibRpc(WALLET_PRIVATE_KEY,is_devnet=True)# status of driveresponse=rpc.status()ifresponse.error:print(f"Error:{response.error['message']}, Code:{response.error['code']}, Data:{response.error['data']}")else:print(response.data)exceptExceptionase:print(f"Error:{str(e)}")KMS Usagefromdjib.rpcimportKmsClientWALLET_PRIVATE_KEY='<Base58 encoded string>'try:kms=KmsClient(WALLET_PRIVATE_KEY,is_devnet=True)a='Hello, World!'a_enc=kms.encrypt(a)a_dec=kms.decrypt(a_enc)asserta_dec==aexceptExceptionase:print(f"Error:{str(e)}")DevelopmentSetupInstallpoetryInstall dev dependencies:poetryinstallActivate the poetry shell.poetryshell
Package: djig
Djig is a minimalist, Digg-like news aggregator (old Digg, not new) for letting
users submit content.  Currently in a fairly alphaish state, not recommended
for use.Djig includes a search_indexes.py file and a couple of example search templates
for use with Django-Haystack.  Haystack is not a requirement, and lack of its
presence should not cause any harm, but may be used if search is needed. You
will need to at least update_index after installing Djig.License: Creative Commons Non-Commercial, 3.0http://creativecommons.org/licenses/by-nc/3.0/
Package: dj-inmemorystorage
dj-inmemorystorageAn in-memory data storage backend for Django.Compatible with Django'sstorage
API.Supported VersionsPython 2.7 with Django 1.11Python 3.5/3.6/3.7 with Django 1.11+Python 3.8 with Django 2.2+In general, we followPython's supported
versionsandDjango's supported
versions.
Any major change in version support will be released as a new major
version.UsageIn your test settings file, addDEFAULT_FILE_STORAGE='inmemorystorage.InMemoryStorage'By default, theInMemoryStoragebackend is non-persistant, meaning
that writes to it from one section of your code will not be present when
reading from another section of your code, unless both are sharing the
same instance of the storage backend.If you need your storage to persist, you can add the following to your
settings.INMEMORYSTORAGE_PERSIST=TrueDifferencesThis library is based ondjango-inmemorystorageby Cody Soyland, withmodificationsmade by Seán Hayes with support for theurlmethod, withadditional
supportfrom Tore
Birkeland for writing to the file.Wave's modifications include packaging, and test modifications such thatpython setup.py testworks. This version also bumps the version to1.0.0and renames it to dj-inmemorystorage such that it doesn't
conflict on PyPI.The biggest difference is that this package works with Django 1.4 now
(previously only 1.5+). It also supports Python 2.6/2.7 with Django
1.4+, Python 3.2/3.3/3.4 with Django 1.5+ and Python 3.5/3.6 with Django
1.7+.ContributingEnsure that you open a pull requestAll feature additions/bug fixes MUST include tests
Package: djinn_announcements
djinn_announcementsDjinn module for announcements1.4.8ordering on start_date1.4.7more translation stuff1.4.6added translations1.4.5functional changesdjango 1.8 compatibility1.4.3small textual change1.4.1Move to Django 1.6.x seriestranslationsadded remove_after publishing toggle1.2.0Several changes toPEP8 fixesi18n fixeslink field now uses djinn_forms link fieldmoved text fields to markup fields1.1.1Removed index for announcements1.1.0Better integration with djinn_contenttypespermissions added1.0.4CSS class changes1.0.3Fixed missing indexable extend1.0.2Move to haystack 2.xMove to Django 1.5.x1.0.1Added missing add permission for user role1.0.0Initial version
Package: djinn_core
djinn_coreDjinn intranet core utilities1.2.8fixed SkinTemplateLoader for django 1.8 compatibility1.2.6django 1.8 compatibility1.2.5made templatefilter messageclass more robust1.2.4caching contenttype instances1.2.2allowing spaces in keywords1.2.1Move to Django 1.6.x seriesadded form/button protection mechanisms1.1.1Minor fix for JS library1.1.0Added admin view and base templateAdded djinn_tool concepturl fixfixes for admin ui1.0.5Fix for truncate util1.0.4Added HTML truncate utilsmessaging in JS1.0.3small fixes for utilities regarding urn representation1.0.2Moved some utilities to djinn core1.0.1Minor fix for ‘implements’ function1.0.0Initial version
Package: djinn_events
djinn_events===================Djinn module for events1.0.10=====* added translations1.0.9=====* django 1.8 compatibility* date formatting1.0.7=====* Move to new publishing model from djinn_contenttypes* Move to Django 1.6.x1.0.6=====* PEP8 fixes* cleaned up some code/templates1.0.5=====* Override controls for submit1.0.4=====* Styling and template fixes1.0.3=====* Fixed missing indexable statement1.0.2=====* Move to haystack 2.x* Move to Django 1.5.x1.0.1=====* Style fix1.0.0=====Initial version