Saravanan666/pypi-org huggingface dataset:
Package: django-dictmessages
A small Django package allowing a dictionary to be passed to contrib.messages.
The dictionary is then pre-rendered and passed to the real contrib.message
function.DependenciesA recent version of Django is required, but there are no third-party
dependencies for this package.InstallationUse your favorite Python installer to install it from PyPI:$ pip install django-dictmessagesOr get the source from the application site:$ hg clone https://bitbucket.org/mhurt/django-dictmessages
$ cd django-dictmessages
$ python setup.py installConfigurationAdd'dictmessages'to yourINSTALLED_APPSsetting like this:INSTALLED_APPS = {
  ...
  'dictmessages',
}Getting StartedWherever you would normally make use of thedjango.contrib.messagesAPI you
can use this package instead:# Before...
from django.contrib import messages

# After...
from dictmessages import messagesSincedictmessagesis a simply a wrapper around the original functionality,
you can continue to use it in the same way:from dictmessages import messages
...
...

# This still works the same...
messages.success(request, 'Awesome! You totally nailed that, dude.')But, if you’d like to something a little more fancy…:from dictmessages import messages
...
...

message_dictionary = dict(
    object='Awesome!', activity='You totally nailed that, dude.')

messages.success(requestion, message_dictionary)
Package: django-dictpatterns
In urls.py, you can write urlpatterns by using dictionary.fromdjango.conf.urlsimportincludefromdjango.contribimportadminadmin.autodiscover()fromdictpatterns.urlsimportDictPatternsUrlDictPatterns=DictPatterns({r'^':('testapp.views.home','home',{r'test/':('testapp.views.test','test',{r'(?P<id>\d*)/':('testapp.views.test_n','test_n',{r'd/':('testapp.views.test_d','test_d')})}),r'admin/':(include(admin.site.urls),'admin')})})urlpatterns=UrlDictPatterns.to_patterns()In templateBecause of this format, you can trace the parent url of a page.
You can display the parent url in template.{% load dict_url_tools %}

Now :<br>{% this_url %}<br>Parent :<br>{% parent_url %}SettingsMake sure of writing DictPatterns in your urls which is designated as ROOT_URLCONF.
And designate the root of DictPatterns as ROOT_DICTPATTERNS_NAME in settings.py if you need. Default value is “UrlDictPatterns”.
Package: django-dict-response
OverviewWriteviews.pysimply.UsageBefore:from django.shortcuts import redirect, render

def view(request):
    ...
    if request.method == 'POST':
        ...
        return redirect(url)
    response = render(request, template_name, dict(obj=obj, title=title), status=200)
    response['Age'] = 120
    return responseAfter:def view(request):
    ...
    if request.method == 'POST':
        ...
        return {'redirect_to': [url]}
    return dict(Age=120, obj=obj, template_name=template_name, title=title, status=200)InstallationInstall using pip:pip install-Udjango-dict-responseAdd tolastof MIDDLEWARE_CLASSES in yoursettings.py:'django_dict_response.middlewares.DictResponseMiddleware',DependenciesDjango >= 1.7ConfigurationREDIRECT_KEYThe setting is used when redirectdefault:'redirect_to'
Package: django-didadata
What is django-didadatadidadatais a Django app to collect numeric data.
The app will provide graphs and notifications for collected metrics.Prepare for developmentA Python 3 interpreter is required. If you use pyenv with a virtualenv, follow the next steps$cd/path/to/project-root/$mkvirtualenvdjango-didadata# activate virtualenv, if not activated yet
# and install all dev requirements:$pipinstall-e.[dev]Now you’re ready to run the tests:$py.testCode styleThis project is styled byblackandisort. You can use the following command to format the code automatically and make it black and isort compatible:$makeformat-python-code
Package: django-diffable
Django DiffableAboutA django abstract model that tracks model fields' values and provide some useful api to know what fields have been changed.Installpipinstalldjango-diffableUsageInherit fromDiffableModel:fromdiffable.modelsimportDiffableModelfromdjango.dbimportmodelsclassProduct(DiffableModel):name=models.CharField(max_length=30)Use as follows:>>>product=Product(name='Atari')>>>product.has_changedFalse>>>product.changed_fields[]>>>product.name='Commodore'>>>product.has_changedTrue>>>product.changed_fields['name']>>>product.diff{'name':('Atari','Commodore')}>>>product.get_field_diff('name')('Atari','Commodore')>>>product.save()>>>product.has_changedFalse>>>product.name='ZX Spectrum'>>>product.has_changedTrue>>>product.refresh_from_db()>>>product.has_changedFalse>>>product.name'Commodore'LicenseThe Django Wicked Historian package is licensed under theFreeBSD
License.
Package: django-digested
Using django-digested you can set up notification emails for your users,
sent out either immediately or in regular batches (“digests”).Installation:pip install django-digestedUsage:INSTALLED_APPS += [‘digested’]
manage.py migrate digestedNow subclass digested.digest_managers.BaseDigestManager and override
these methods:get_items(self)
get_subscribers_for_item(self, item)
get_updates_for_digest(self, item, preference)
send_one_instant_update(self, subscriber, update)
send_one_digest_update(self, subscriber, preference, updates)Call send_instant_update to send out instant updates, and
send_digest_updates at appropriate regular intervals.
Package: django-digg-paginator
Digg-like paginator for Django.Originaly posted on Django snippets site by miracle2khttp://blog.elsdoerfer.name/https://djangosnippets.org/snippets/773/To setup use pip install django_digg_paginatorCan be used with generic ListView as simple as
from digg_paginator import DiggPaginatorclass MyCustomView(ListView):paginator_class = DiggPaginatorand addig a temaplate like in origial django snippet info
Package: django-digid-eherkenning
Version:0.12.0Source:https://github.com/maykinmedia/django-digid-eherkenningKeywords:django, authentication, digid, eherkenning, eidas, dutch, nl, netherlandsPythonVersion:3.7+A Django app for DigiD/eHerkenning authentication flowsContents1Features2Getting started1FeaturesSAML-based DigiD authentication flowSAML-based eHerkenning authentication flowCustom Django authentication backendExtensible2Getting startedSee thedocumentation.
Package: django-dilla
What's Dilla?======General-purpose testing tool* Django custom management command* Random data generator* i.e. models.SlugField() will get corporis_maxime_architecto_689 value, not hwegid24#!@#1ty51794t* images (see Screenshots)Why would I need that?========================Let's say you wrote your blog application (oh yeah, your favorite!) in Django. Unit tests went fine, and everything runs extremely fast, even those ORM-generated ultra-long queries. You've added several categorized posts and it's still stable as a rock. You're quite sure the app is efficient and ready to for live deployment. Right? Wrong.Dilla would add hundreds of categories, posts and even photos to your app in seconds. After it's done you migh re-consider your deployment plans.HowTos=======* Add Dilla to INSTALLED_APPS tupleINSTALLED_APPS = ( ...'dilla',)* Check if it works$ ./manage.py help dillaUsage: manage.py dilla [options] appname [appname ...]...* Make sure you're running development environment. You don't want to have your production db filled with junk, do you?* Review your models. Maybe there are some, that you wouldn't like to be populated by Dilla?class BlogConfiguration(models.Model):...class Dilla:skip_model = True# or you might want to skip specified fields# skip_fields = ('hash', 'user',)* Want Dilla to generate images for you? Just let it know.class BlogPostImage:# example: sorl-thumbnail fieldimage = ImageWithThumbnailsField("Blog post image", upload_to='images/%Y/%m/%d',thumbnail={'size': THUMB_SET[0] }, height_field = 'height', width_field = 'width',extra_thumbnails=THUMB_SET[1])...class Dilla:image_fields = ('image', )generate_images = Trueimage_resolution = '640x480'* Run 200 iterations on your app model$ ./manage.py dilla blog -i 200You're done. Expect funny data. Profile your queries etc.
Package: django-diplomat
DiplomatDiplomat provides Django models for the countries and languages covered by the
ISO 3166 and ISO 639 standards, respectively.  Diplomat is implemented as a
wrapper around a subset of pycountry, and its interface should feel familiar to
users of that module.InstallationAdddiplomatto yourINSTALLED_APPS, then run thesyncdbcommand, which
will create the required language and country models.Model UsageDiplomat’s field models exactly mirror the attributes of the pycountry database
objects that they imitate.  In addition to these attributes, custom manager
methods are available for some of the objects provided by diplomat.LanguagesTheISOLanguagemodel is a wrapper around thepycountry.db.Languagemodel.>>> from diplomat.models import ISOLanguage
>>> aragonese = ISOLanguage.objects.get(alpha2='an')
>>> aragonese.alpha2
u'an'
>>> aragonese.bibliographic
u'arg'
>>> aragonese.terminology
u'arg'
>>> aragonese.name
u'Aragonese'In addition, it provides a custom model manager.>>> from diplomat.models import ISOLanguage
>>> all_languages = ISOLanguage.objects.all()
>>> basic_languages = ISOLanguage.objects.basic()
>>> usable_languages = ISOLanguage.objects.usable()
>>> all_languages.count() > usable_languages.count() > basic_languages.count()
True
>>> all([l.alpha2 for l in all_languages])
False
>>> all([l.alpha2 for l in basic_languages])
True
>>> all_languages.filter(terminology='zxx').count()
1
>>> usable_languages.filter(terminology='zxx').count()
0CountriesTheISOCountrymodel is a wrapper around thepycountry.db.Countrymodel.>>> from diplomat.models import ISOCountry
>>> germany = ISOCountry.objects.get(alpha2='DE')
>>> germany.alpha2
u'DE'
>>> germany.alpha3
u'DEU'
>>> germany.numeric
u'276'
>>> germany.name
u'Germany'
>>> germany.official_name
u'Federal Republic of Germany'Field UsageDiplomat provides a series of simple form fields for selecting country and
language objects.  These fields, which can be imported fromdiplomat.fields,
are as follows:LanguageChoiceFieldA field for selecting a single usable language.LanguageMultipleChoiceFieldA field for selecting multiple usable languages.BasicLanguageChoiceFieldA field for selecting a single basic language covered by ISO 639-1.BasicLanguageMultipleChoiceFieldA field for selecting multiple basic languages covered by ISO 639-1.CountryChoiceFieldA field for selecting a single country.CountryMultipleChoiceFieldA field for selecting multiple countries.
Package: django-dirbrowser
Django app for browse a local server direcotry.This app is user to give acces to a local directory and still using django auth,
django templates and django middleware.Requires django version 1.3 or greater.ContentsInstallationUsageInstallationInstall or adddjango-dirbrowserto your Python path.pip install django-dirbrowseror with wasy_intalleasy_install django-dirbrowserUsageAdddirbrowserto yourINSTALLED_APPSsetting.Add dirbrowse serve to your project’surls.pyfile:from dirbrowser.views import serve

(r'^browse/(?P<path>.*)$', serve, {'document_root': CURRENT_DIR}),Or personalize it on your own views:from dirbrowser.views import serve

def mybrowser(reques, path):
    extra_context = {.. some extra vars ..}

    return serve(request, document_root='path_to_my_root_dir',
                template="custom_template.html",
                extra_context=extra_context)Theserveview accepts the parameters:document_root : Path to the root directory to servetemplate : Template used to show index page (if show_indexes is True)extra_context : Extra context to the templateshow_indexes : if True show the directory index page. Default is False
Package: django-direct
django-direct is a simple Django application that provides a RESTFul
API to validate and fetch Direct x509 certificate via LDAP and DNS.Detailed documentation for using the API is in the “docs” directory.
Installation instructions are below.Quick startPip install django-direct:pip install django-directAdd “direct” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'direct',
)Include the direct URLconf in your project urls.py like this:url(r'^direct/', include('direct.urls')),There are no models in this application so there is no migration step.5. Use the APIs.  Visithttp://127.0.0.1:8000/direct/to verify the installation and for more information.
See the docs folder for more information.
Package: django-directmessages
Django-DirectmessagesDjango-Directmessages is a low-level and easy-to-use Django App to manage simple directmessages.
In contrast to other Django Apps for messaging, Django-Directmessages doesn’t use any type of pre-built templates and is concentrated on the programmatic usage.Django-Directmessage is thought to be used with APIs or small apps, but can be used for any type of messaging. It featues:Sending of private 1-to-1 messages between users.Listing unread messages for a given user.Read a given messageGet all conversation partners/contacted users for a given userRead a whole conversation between two users.RequirementsDjango >= 1.5is supportedInstallationpip installdjango-directmessagesadd"directmessages"toINSTALLED_APPSand runpython manage.py migrate.UsageImport the Message Management API on top of yourviews.pyfrom directmessages.apps import InboxSend message:Inbox.send_message(from_user, to_user, message)List all unread messages:Inbox.get_unread_messages(user)Read a message (and mark as read):Inbox.read_message(message)Print a message as <user>: <message>:Inbox.read_message_formatted(message)Print a list of all conversation partners for a user:Inbox.get_conversations(users)Get a conversation between two users:Inbox.get_conversation(user1, user2, _limit_, _reversed_, _mark_read_)Limit (Int: optional): Instead of getting the whole conversation, get the first 50 (depends on reversed)Reversed (Bool: optional): Usually the ‘limit’-param gives back the first x messages, if you put Reversed to True, limit will give back the x latest messages.Mark_Read (Bool: optional): Mark all messages in conversation as readSignalsYou can use the following signals to extend the app for your needsmessage_sent:Gets called as soon as a message is sent.
Provides the Message object, the sender and the recipient as params.message_read:Gets called as soon as a message is read:
Provides the Message object, the sender and the recipient as params.ContributingBug reports, patches and fixes are always welcome!To DoAdd some security functions (e.g checking if user is allowed to read a message)Add some custom exceptions (e.g. when no message was found)
Package: django-directory-tree
# Directory-TreeDirectory Tree is a Django app to see all directory in media folder.Detailed documentation is in the “docs” directory.Quick startAdd “directory_tree” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'directory_tree',
]Add MEDIA_URL and MEDIA_ROOT to your setting.py setting like this (Optional):BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

MEDIA_URL = '/media/'
MEDIA_ROOT = str(BASE / 'media')Add media path in your project urls.py like this (Optional):from django.conf import settings
from django.conf.urls.static import static

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)Option if you want to see file have in a database ? setting like this in setting.py:DIRECTORY_TREE_MODEL_USE = True # default False
DIRECTORY_TREE_MODEL = {
    TABLE_NAME: [list_field],
}Include the directorty tree URLconf in your project urls.py like this:path('directory_tree/', include('directory_tree.urls')),Start the development server and visithttp://127.0.0.1:8000/admin/to login by admin userVisithttp://127.0.0.1:8000/directory_tree/to participate in the directory tree.
Package: django-direct-render
#django direct renderrender a simple html without wirting view function.## INSTALLATIONpip install django_direct_render### INSTALLED_APPin INSTALLED_APP, add the following entry‘direct_render’### project urls.pyadd the folowing line at topimport direct_render.urlsadd the following url configuration in your urls.pyurl(r’^direct_render/’, include(direct_render.urls)),the abover the regular expression can change with your desire### Usageput xxx.html in templates.browse file directly from ‘direct_render/xxx.html’
Package: django-dirtyfields
Tracking dirty fields on a Django model instance.
Dirty means that field in-memory and database values are different.This package is compatible and tested with the following Python & Django versions:DjangoPython2.0, 2.13.72.2, 3.0, 3.13.7, 3.8, 3.93.23.7, 3.8, 3.9, 3.104.03.8, 3.9, 3.104.1, 4.23.8, 3.9, 3.10, 3.11Install$pipinstalldjango-dirtyfieldsUsageTo usedjango-dirtyfields, you need to:Inherit fromDirtyFieldsMixinin the Django model you want to track.fromdjango.dbimportmodelsfromdirtyfieldsimportDirtyFieldsMixinclassExampleModel(DirtyFieldsMixin,models.Model):"""A simple example model to test dirty fields mixin with"""boolean=models.BooleanField(default=True)characters=models.CharField(blank=True,max_length=80)Use one of these 2 functions on a model instance to know if this instance is dirty, and get the dirty fields:is_dirty()get_dirty_fields()Example>>>model=ExampleModel.objects.create(boolean=True,characters="first value")>>>model.is_dirty()False>>>model.get_dirty_fields(){}>>>model.boolean=False>>>model.characters="second value">>>model.is_dirty()True>>>model.get_dirty_fields(){'boolean':True,"characters":"first_value"}Consult thefull documentationfor more information.
Package: django-disable-cache-headers
Middleware that disables caching headers during development in Django.In production you will typically a CDN or browser cache to speed up subsequent
reads of your pages. This ensures reads don’t need to hit your DB as often.fromdjango.views.decorators.cacheimportcache_control@method_decorator(cache_control(public=True,max_age=60*5)),name="dispatch")defmy_view(request):...However this is annoying during development as you always want to serve fresh
pages and static files on page refresh. Using this middleware in development
strips out the cache headers and prevents the browser (or dev cache) from
caching your content.QuickstartInstall Django disable cache headers:pip install django-disable-cache-headersAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'disable_cache_headers.apps.DisableCacheHeadersConfig',...)Add the middleware in your development settings, e.g in config/settings/local.py.from.baseimport*MIDDLEWARE+=["disable_cache_headers.middleware.DisableCacheControl"]Running Testspython-mvenvvenvsource./venv/bin/activatepipinstall-rrequirements_test.txtpytestHistory0.1.0 (2019-08-22)First release on PyPI.
Package: django-discord-bind
A Django app for securely associating a user with a Discord account.This is a simple Django application that allows users to associate one or
more Discord accounts to their Django accounts and automatically join a
partner Discord server using theOAuth2 functionality of the Discord API.RequirementsPython 2.7, 3.4, 3.5Django 1.9, 1.10Licensedjango-discord-bind is released under the terms of the MIT license.
Full details in LICENSE file.
Package: django-discord-connector
Django Discord ConnectorDjango Discord Connector is a saimple Django application that adds models, urls, and Celery tasks to help manage Discord entities.There are several behaviors that the application will add:Automatically adding discord roles when adding attached DjangoGroup objects to a UserPeriodically syncing Discord entities with information from the Discord serverInstallationAdd django_discord_connector to your INSTALLED_APPSInclude the django_discord_connector URLs in your urls.pyRunpython3 manage.py migrateto create the django_discord_connector tablesCreate a DiscordClient in the administration panelLoad the default periodic taskspython3 manage.py loaddata discord_default_schedule.jsonSettingsThe Django Discord Connector adds settings which change the behavior of the celery tasks and other functionality.SettingValuesDescriptionDJANGO_DISCORD_REMOTE_PRIORITYTrue / Falsesync_discord_user_discord_groupswill update the DiscordUser according to the remote Discord groups, instead of the local groups.Provided URLsURL NameDescriptiondjango-discord-connector-sso-callbackThe callback url for SSO tokens (sso/callback)django-discord-connector-sso-token-addRedirects users to the SSO login for Discorddjango-discord-connector-sso-token-removeRemoves an SSO token (expects kwarg pk)Provided Celery TasksTask NameActionsync_discord_usersUpdates all information and groups for a DiscordUsersync_discord_groupsUpdates all DiscordGroup objects with groups from Discord serversync_discord_channelsUpdates all DiscordChannel objects with channels from Discord server
Package: django-discord-integration
Django Discord IntegrationDiscord integration for Django, supporting error reporting via webhooks.This app comes with two message handlers:DiscordMessageHandlerandSimpleDiscordMessageHandler.DiscordMessageHandlersends all the information related to the message, such as a traceback if there is one, while theSimpleDiscordMessageHandleronly sends the title.Installation$pipinstalldjango-discord-integrationIn yoursettings.py, add the following:INSTALLED_APPS=('discord_integration',...)Next, migrate the database:$ python manage.py migrateFinally, create a Discord integration object in the Django admin site. Set the Discord webhook URL as well as the bot username and avatar URL if necessary. You can create multiple objects to direct different logs to different channels. The default object should the namedefault.Sample Logging ConfigurationLOGGING={'handlers':{'discord_integration':{'level':'ERROR','class':'discord_integration.log.DiscordMessageHandler','model_name':'default',# OPTIONAL: specify a name to use a different integration configuration.},},'loggers':{'handlers':['discord_integration'],},}