Saravanan666/pypi-org huggingface dataset:
Package: django-polymorphic-auth
OverviewProvides a polymorphic parentUsermodel and several child models.You can enable and disable child models without affecting foreign keys
to the the parent model, and avoid complicated schema and data
migrations.You can even have multiple child models active at the same time!How It WorksThe polymorphic parent model contains the bare minimum required by
Django for a user model. This is where your foreign keys will point to
(via theAUTH_USER_MODELsetting), and this allows you to avoid
schema migrations when changing child models.Check out thedjango-polymorphicdocs for more information on the underlying system that makes this
possible.PluginsSeveral child models are also provided asusertypeplugins for
common use cases (email login, username login, etc.), along with a
number of abstract models and mixin classes that you can use to create
your own plugins.For example:# myproject/usertypes/foo/models.py

from django.utils.translation import ugettext_lazy as _
from polymorphic_auth.models import AbstractUser

class FooUser(AbstractUser):
    foo = models.CharField(unique=True)

    USERNAME_FIELD = 'foo'

    class Meta:
        verbose_name = _('user with foo login')
        verbose_name_plural = _('users with foo login')Then just add your plugin to theINSTALLED_APPSsetting and point to
your model in thePOLYMORPHIC_AUTH['DEFAULT_CHILD_MODEL']setting:# myproject/settings.py

AUTH_USER_MODEL = 'polymorphic_auth.User'
INSTALLED_APPS += ('myproject.usertypes.foo', )
POLYMORPHIC_AUTH = {'DEFAULT_CHILD_MODEL': 'foo.FooUser'}ADMINS and MANAGERS SettingsThe default app contains apost_migratesignal handler that will
create superuser and staff accounts for each name and email in theADMINSandMANAGERSsettings, and write the credentials tosys.stdout(configurable).Say goodbye to./manage.py createsuperuser!To add support to your custom plugins, override theAbstractUser.try_createclassmethod and have it derive values for
required fields from thenameandemailkwargs.For example:# myproject/usertypes/foo/models.py

import re

class FooUser(AbstractUser):
    ...

    @classmethod
    def try_create(self, **kwargs):
        email = kwargs.get('email', '')
        kwargs.setdefault('foo', re.sub(r'@.+', '', email))
        return super(FooUser, cls).try_create(**kwargs)AdminIf more than one plugin is installed, you will be asked which type of
user you want to create when adding a new user via the admin. If there
is only one plugin installed, it will take you directly to the change
form for that plugin.You can customise the admin class for your plugins:# myproject/usertypes/foo/admin.py

from myproject.usertypes.foo.forms import FooForm
from polymorphic_auth.admin import UserChildAdmin

class EmailUserAdmin(UserChildAdmin):

    # define custom features hereTODORegistration system for plugins, instead of hard coding the provided
ones and checkingINSTALLED_APPS.Authentication backend that checks all registered plugins, not just
the one assigned toPOLYMORPHIC_AUTH['DEFAULT_CHILD_MODEL'].Makeemailfield case insensitive.
Package: django-polymorphic-ng
Polymorphic Models for DjangoDjango-polymorphic simplifies using inherited models in Django projects.
When a query is made at the base model, the inherited model classes are returned.When we store models that inherit from aProjectmodel…>>> Project.objects.create(topic="Department Party")
>>> ArtProject.objects.create(topic="Painting with Tim", artist="T. Turner")
>>> ResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")…and want to retrieve all our projects, the subclassed models are returned!>>> Project.objects.all()
    [ <Project:         id 1, topic "Department Party">,
      <ArtProject:      id 2, topic "Painting with Tim", artist "T. Turner">,
      <ResearchProject: id 3, topic "Swallow Aerodynamics", supervisor "Dr. Winter"> ]Using vanilla Django, we get the base class objects, which is rarely what we wanted:>>> Project.objects.all()
    [ <Project: id 1, topic "Department Party">,
      <Project: id 2, topic "Painting with Tim">,
      <Project: id 3, topic "Swallow Aerodynamics"> ]This also works when the polymorphic model is accessed via
ForeignKeys, ManyToManyFields or OneToOneFields.FeaturesFull admin integration.ORM integration:support for ForeignKey, ManyToManyField, OneToOneField descriptors.Filtering/ordering of inherited models (ArtProject___artist).Filtering model types:instance_of(...)andnot_instance_of(...)Combining querysets of different models (qs3 = qs1 | qs2)Support for custom user-defined managers.Uses the minumum amount of queries needed to fetch the inherited models.Disabling polymorphic behavior when needed.Whiledjango-polymorphicmakes subclassed models easy to use in Django,
we still encourage to use them with caution. Each subclassed model will require
Django to perform anINNER JOINto fetch the model fields from the database.
While taking this in mind, there are valid reasons for using subclassed models.
That’s what this library is designed for!For more information, see thedocumentation at Read the Docs.LicenseDjango-polymorphic uses the same license as Django (BSD-like).
Package: django-pony
There is no pony in django. Here is a application to add a pony to your
django project.InstallationAdd “pony” to your pytonpath.Add this line of code somewhere in your template(s):{% include "pony/pony.html" %}That’s it! Easy what?Credits and legal noticeThe ascii art pony was made byJoan Starkand released for free fornon commercial use. See hisguidlinesfor details.
Package: django-ponydebugger
PonyDebuggeris a remote debugging toolset that uses Chrome Developer
Tools. It consists of 2 parts: a server (ponyd) and an iOS client
library so you can debug your iOS apps.This project adds a Python client for debuggingDjangoweb apps.django-ponydebugger is licensed under theMIT License.FeaturesNetwork Traffic DebuggingView all requests received by Django, including request and response
headers and bodies.ConsoleInteract with the running process with a fully functional console.Installation / Setup / UsageInstall the django-ponydebugger package and its dependencies with the
following command:pip install django-ponydebuggerUpdate your Django settings module to adddjango_ponydebugger.middleware.PonyMiddlewaretoMIDDLEWARE_CLASSES(preferably near the beginning).After receiving the first request, django-ponydebugger will connect to
ponyd. Connect to ponyd with your browser (probablyhttp://127.0.0.1:9000/), and you should see Django listed. After
clicking on Django, django-ponydebugger will report events to
PonyDebugger / Chrome Developer Tools.Known IssuesNoneFuture WorkTimeline support. It would be nice to report received HTTP requests
as well as other events related to the request (like DB queries) to
the Timeline.
Package: django-pony-forms
Django pony formsDjango-pony-formshelps you to write better html for your Django forms.Read the documentation onreadthedocs1: Better form html by defaultThe form html that Django produces is not very nice or useful. For example, the default output of a Django form is a table.Just mixinPonyFormMixinto produce better html:classExampleForm(PonyFormMixin,forms.Form):name=forms.CharField()This produces the following html:<divclass="form-row row-name"><labelfor="id_name">Name</label><inputtype="text"id="id_name"name="name"/></div>2: Write your own form templatesYou can also write your own form templates:classExampleForm(PonyFormMixin,forms.Form):name=forms.CharField()form_template='my_form.html'row_template='my_row.html'my_form.html:<divclass="my_form">{{ hidden_fields }}
    {{ top_errors }}
    {{ rows }}</div>RequirementsThe package is tested with Django 2.2 - 3.1 and Python 3.6 - 3.8.InstallationInstall the package:$ pip install django_pony_formsAdddjango_pony_formsto your installed apps insettings.py.INSTALLED_APPS=(..'django_pony_forms',)
Package: django-pooldb
django-pooldb基于DBUtils.PooledDB封装的Django数据库连接池引擎
Django database connection pool engine based on DBUtils.PooledDBpip install django-pooldbUsing django-pooldbAdd the following to yoursettings.py:DATABASES={'default':{'ENGINE':'pooldb.backends.mysql','NAME':'test','HOST':'127.0.0.1','PORT':13306,'USER':'root','PASSWORD':'123456','OPTIONS':{#  dbutils extra params'maxconnections':100,},}}
Package: django-poormanscron
Django Poor Man’s Cron is Django app which makes use of spambots, search engine indexing robots and alike to run scheduled tasks in approximately regular intervals.This app isn’t meant to be a fully-featured project, but rather a modifiable experimental concept.To install the app, do the following:Check it out and put it somewhere under python path.Add the app to INSTALLED_APPS and its PoorMansCronMiddleware class to MIDDLEWARE_CLASSES in your project settings.Run python manage.py syncdb to update the DB schema.Create management commands for scheduled tasks (probably you can also use Django Command Extensions).Create ScheduledTask objects in Django administration.INSTALLED_APPS = (# …
“poormanscron”,
)MIDDLEWARE_CLASSES = (# …
“poormanscron.middleware.PoorMansCronMiddleware”,
)The included initial_data fixture serves as an example where “cleanup” command is called every day after 3 am.
Package: django_popcorn
Add-another pop-ups a ladjango-admin.The popup views are implemented using a mixin to the generic CreateView. Also, the popups now support permissions. As a result, a user will only get theadd-anotherlink next to a ForeignKey or a ManyToMany field if he has the add permission for the target model.InstallationGet it from the cheeseshop:pip install django_popcornUsageRead on:Include the following in yourINSTALLED_APPSsettings:'popcorn',Add this to yoursettings.py(If you do not already have it):TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.contrib.messages.context_processors.messages",
    "django.core.context_processors.request",
    "popcorn.context_processors.admin_media_prefix",
)

POPCORN_MODELS = ('auth.Group', 'auth.Permission')Add the following to yourbase.htmltemplate:<script src="{{ ADMIN_MEDIA_PREFIX }}js/admin/RelatedObjectLookups.js"></script>We will create a view forauth.Userand use the utilityget_popcorn_urlsfunction to generate popcorn views and urls:urlpatterns = patterns('',
    url(r'^$', CreateView.as_view(model=User, success_url='.'), name='auth_user_create'),
    url(r'^admin/', include(admin.site.urls)),
)

urlpatterns += get_popcorn_urls()Render your forms like so:<form method="POST" action="{{ request.get_full_path }}">
    {% csrf_token %}
    {% include 'popcorn/form.html' %}
    <button type="submit">Submit</button>
    <a href="../">Cancel</a>
</form>Thats it! sync your DB, run the dev server and fire up your browser at localhost. You should see a formwthouttheadd-anotherlinks. This is because popcorn add-another links are only enabled for users who have add permission for the target model. Now log-in - possibly via admin after enabling it and hit localhost again. You should see a little+next to ForeignKey and ManyToMany fields. Click it and the add-another popup would appear. If you are having any problems, please check out the test project for a working implementation.History1.0.0 (2014-06-23)98% test coverage. Ready for big-time.0.2.0 (2013-12-9)Added support for permissions.0.1.0 (2013-12-2)First release on PyPI.
Package: django-popolo
django-popoloWelcome to the documentation for django-popolo!django-popolois a django-based implementation of thePopolo's open government data specifications.It is developed as a Django reusable app to be deployed directly within Django projects.It will allow web developers using it to manage and store data according to Popolo's specifications.The standard sql-oriented Django ORM will be used.From release 1.2.0, django-popolo includes classes that extend the model, although compatibility
with the standard is kept.Release 2.0.0 introduces a change in how Sources and Links are referred to,
that breaks compatibility with the popit importer.Release 3.0.0 main focuses have been to keep up with latest Django
versions and to "modernize" the code base, adopting latest Python features (like type hinting),
and doing some serious housekeeping. Python 2 is no longer supported.
This release also implements a lot of new models which are not part of the Popolo specification (mildly out of scope),
but we needed them in some projects which make use this package. Those new models can be safely ignored, and they could
also be removed in the future, as we are considering the option of entirely decoupling them fromdjango-popolo.See theCHANGELOG.mdfile for more details.InstallationTo installdjango-popoloas a third party app within a django project,
you need to add it to the django project's requirements.txt.
You can do this from GitHub in the usual way, or using thedjango-popolopackage on PyPI.Notes on mysociety's forkmysociety/django-popolois a fork of this project where integer IDs are used
instead of slugs.Our packages, since version 1.1 also uses numerical ids as primary keys for all entities.
Slugs are available as non-primary fields, for the 4 main classes (Person,Organization,Post,Membership).
Slugs are used through thePermalinkablebehavior, that adds theslugfield to the class, populating it according to rules defined in each class.
Package: django-popularity-mixin
django-popularity-mixinSimple integration betweendjango-cachebackanddjango-hitcountAuthored byBasil ShubinRequirementsYou must havedjango-cachebackanddjango-hitcountboth installed and configured, see thedjango-cachebackanddjango-hitcountdocumentation for details and setup instructions.InstallationFirst install the module, preferably in a virtual environment. It can be installed from PyPI:pipinstalldjango-popularity-mixinSetupMake sure the project is configured fordjango-cachebackanddjango-hitcount.Then add the following settings:INSTALLED_APPS+=('popularity',)UsageThepopularity.views.PopularityMixincan be used to do the
business-logic of counting the hits asynchronously by settingcount_hittoTrue.# views.pyfromdjango.views.generic.detailimportDetailViewfrompopularity.viewsimportPopularityMixinclassCustomDetailView(PopularityMixin,DetailView):count_hit=True# set to True if you want it to try and count the hit asynchronouslytemplate_name="template.html"...Thepopularity.viwes.PopularityMixinextends Django’s genericdjango.views.generic.detail.DetailViewand injects an additional
context variablehitcount.<!-- template.html -->{# the primary key for the hitcount object #}{{hitcount.pk}}{# the total hits for the object #}{{hitcount.total_hits}}For a more granular approach to viewing the hits for a related object you can use theget_hit_counttemplate tag.{# remember to load the tags first #}{%loadpopularity_tags%}{# Return total hits for an object: #}{%get_hit_countfor[object]%}{# Get total hits for an object as a specified variable: #}{%get_hit_countfor[object]as[var]%}{# Get total hits for an object over a certain time period: #}{%get_hit_countfor[object]within["days=1,minutes=30"]%}{# Get total hits for an object over a certain time period as a variable: #}{%get_hit_countfor[object]within["days=1,minutes=30"]as[var]%}Please seeexampleapplication. This application is used to manually test the functionalities of this package. This also serves as good example…You need Django 1.8.1 or above to run that. It might run on older versions but that is not tested.ContributingIf you like this module, forked it, or would like to improve it, please let us know!
Pull requests are welcome too. :-)
Package: django-popup-ds
django-popup_dsdjango-popup_ds is a Django app to use for stockanalyser. For each question,
visitors can choose between a fixed number of answers.Quick startAdd "fav_stock" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'popup',
]Run below command to create the popup models.::python manage.py makemigrations popup
python manage.py migrate
python manage.py createsuperuserStart the development server and visithttp://127.0.0.1:8000/admin/to create a popup (you'll need the Admin app enabled).Usage in the template::{% load popup_tags %}
{% make_popup %}If you want to see appropriate html render, please use bootstrap 5.
Package: django-portfolio-ds
django-portfolio_dsdjango-portfolio_ds is a Django app to use for demiansoft.Quick startAdd "portfolio" to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'portfolio','base',]Run below command to create the portfolio models.::python manage.py makemigrations portfolio
    python manage.py migrate
    python manage.py createsuperuser코드를 넣고자 하는 위치에 다음을 추가 한다.{% load portfolio_tags %}
{% make_portfolio %}http://127.0.0.1:8000/admin으로 접속하여 데이터베이스 자료를 입력한다.media 파일을 찾을 수 있도록 프로젝트의 url.py에 다음을 추가한다.fromdjango.confimportsettingsfromdjango.conf.urls.staticimportstaticurlpatterns=[...]+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)portfolio_detail을 찾을수 있도록 템플릿 app의 urls.py에 다음을 추가한다.fromdjango.urlsimportpath,includeurlpatterns=[...path('portfolio/',include('portfolio.urls')),]context examplecontext={"theme":"medilab_ds",'color':"default","portfolio":{'title':"케이스",'subtitle':'주목할 만한 치과 케이스 모음',}}
Package: django-portlets
IntroductionPortletsare content objects which are managed inSlots.Slotscan be
freely defined and placed anywhere within a HTML page.Portlets are usual content objects, that means they can have arbitrary fields
and functionalities.There are also some more advanced features like inheriting and blocking of
portlets.django-portlets provides just a generic engine to manage portlets. You can
find a comprehensive implementation withinLFS.Exampledjango-portlets comes with a simple example application which shows how to use it.DocumentationFor more documentation please visit:http://django-portlets.rtfd.orgChanges1.5 (2017-02-23)Add Django 1.10 support1.4 (2015-05-05)Resolves RemovedInDjango19Warnings.Removes deprecated functions.1.3 (2015-04-20)Adds Django 1.8 support1.2 (2014-07-08)Sets logging to __name__Moves utilities functions for Slots to the Slot model1.1.1 (2012-03-18)Added polish translations (Maciej Wiśniowski)Added german translations1.1 (2011-11-21)Added base class (from which can inherited)API change: changed the order of parameters for get_portlets and has_portlets1.0 (2010-08-24)First final release1.0 beta 4 (2010-07-07)Changed: cache keys are using CACHE_MIDDLEWARE_PREFIX nowBugfix caching: added language to cache key1.0 beta 3 (2010-06-28)Bugfix: make registration working for postgres; issue #1Bugfix caching: use class name instead of content type for cache key1.0 beta 2 (2010-05-21)Improved cachingAdded license1.0 beta 1 (2010-05-17)First beta release.0.4.0 (2010-04-16)Display only registered portlets0.3.2 (2009-10-15)Changed documentation to one page (for now)Example TextPortlet: madecontextparamenter ofrendermethod optional.Added tests for models0.3.1 (2009-10-14)Added testsBugfix: Check whether the content object implementsget_parent_for_portletswithinutils.has_portlets0.3.0 (2009-10-12)Added documentation0.2.0 (2009-10-12)Added simple example implementation0.1.0 (2009-10-12)Initial public release
Package: django-portmaster
Django Portmaster is a network port allocation and management
microservice. With Portmaster, you can assign port ranges to different
services and register ports to different instances of those service.
This way you can prevent assigning the same port twice, thus preventing
assignement collision.InstallationInstall using PIP.pip install django-portmasterAdd app to your Django project’s settings file and include offer
cleanup middleware.INSTALLED_APPS=[[..]'django_portmaster']MIDDLEWARE=[[..]'django_portmaster.middleware.CleanOldOffersMiddleware']Include Portmaster’s URLs into your Django project’s urls file.fromdjango_portmaster.urlsimportportmaster_urlpatternsurlpatterns+=portmaster_urlpatternsOptionally, you can override the time offers are kept before they are
deleted. Add the following code to you settings.py file.# Default value is 30 minutesPM_DELETE_OFFERS_AFTER_MINUTES=10APIDefine port range by creating a service.POST/v1/services{"name":"django","description":"Django service","start":5000,"end":10000}Request a port from the range by providing a service instance name.POST/v1/services/django/offers{"name":"web-01"}Response{"service":"django","name":"web-01","port":5000,"secret":"6f8ffc86-d98a-49ba-848a-a7cbaaea9360","created":"2017-09-08T14:16:39.277408Z"}Port will not be allocated immediately. Instead it will be reserved
until the client accepts the port by posting to the dedicated URL
using the provided secret code:POST/v1/services/django/offers/6f8ffc86-d98a-49ba-848a-a7cbaaea9360/acceptResponse{"service":"django","name":"web-01","port":5000,"created":"2017-09-08T14:18:04.094357Z"}Alternatively, you can reject the offer. Offers that are not accepted
are automatically deleted by Portmaster middleware after they reach
threshold set byPM_DELETE_OFFERS_AFTER_MINUTESsetting (default
value is 30 minutes).POST/v1/services/django/offers/6f8ffc86-d98a-49ba-848a-a7cbaaea9360/rejectYou can list all port alocations for a particular service.GET/v1/services/django/portsFind one by port numberGET/v1/services/django/ports/5000Or find one by service instance nameGET/v1/services/django/ports/web-01Safe guardsPortmaster includes multiple error checks and corner case handlers, so:Service name needs to be uniquePort ranges can not overlapPort range can not overlap with privileged ports (<1024) or IANA
defined ephemeral port range (>49152)Port can be assigned only once at any given timeService instance name needs to be unique
Package: django-postalcodes
Django Postal Codes===================A simple data model for storing postal codes with placenames and location.Installing----------You can clone the repository and install from source::python setup.py installor use `pip` to install from PyPI::pip install django-postalcodes.. note::Version 0.2+ requires a GIS backend (e.g. PostGIS). Migrating from 0.1 willnot be straightforward if you have existing data decimal data or do nothave a GIS backend.If you are using South you must use South >= 1.0 to ensure compatability withthe new `south_migrations` migrations module name.Getting data------------Postal code data is available from a number of sources, typically on a countryby country basis. The United States Census Bureau maintains the `Gazetteerdatabase <http://www.census.gov/geo/www/gazetteer/gazette.html>`_, includingdetailed zip code data. The `GeoNames geographical database<http://www.geonames.org/export/>`_ also provides postal code data forinternational postal codes (and other places).The following data file can be used to prepopulate a PostGIS database with USpostalcodes complete with location.* `US zip codes using state abbreviations <https://dl.dropbox.com/u/6515401/postalcodes/postalcodes_gis_us.sql.zip>`_ (879 KB)These files pertain to the 0.1 release but may still be useful. They are basedon location via decimal fields, rather than a GIS point field.* `International postal codes <http://dl.dropbox.com/u/6515401/postalcodes/postalcodes_international.sql.zip>`_ (9 MB)* `US zip codes using state abbreviations <http://dl.dropbox.com/u/6515401/postalcodes/postalcodes_us.sql.zip>`_ (623 KB)The data is licensed under the `Database Contents License <http://opendatacommons.org/licenses/dbcl/1.0/>`_.