Saravanan666/pypi-org huggingface dataset:
Package: django-province
=====Province=====Province is a simple Django app to show province, town, city and shahrak in Iran with API. For eachquestion, visitors can choose between a fixed number of answers.Detailed documentation is in the "docs" directory.Quick start-----------1. Add "province" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'province',]2. Include the province URLconf in your project urls.py like this::path('api/v1/province/', include('province.api.urls')),3. Run `python manage.py migrate` to create the province models.4. Start the development server and visit http://127.0.0.1:8000/admin/to create a province (you'll need the Admin app enabled).5. Visit http://127.0.0.1:8000/api/v1/province/ to participate in the poll.
Package: django-proxy-crsf
Django HTTP Proxydjango 代理服务，格式为 url('proxy/(?P\d+)/(?P.*)', proxy_view),  http为1时表示是http协议  0为https协议加入了crsf，避免跨域问题http代理访问地址为https://xxx/proxy/1/www.baidu.com/https代理访问地址为https://xxx/proxy/0/www.baidu.com/完全支持put post 等方法带参InstallationInstall with$pipinstalldjango-proxy-crsfOverviewForward as close to an exact copy of the request as possible along to a
given url.  Respond with as close to an exact copy of the resulting
response as possible.Includes a view function that can be used directly from a URL spec:fromproxy.viewsimportproxy_viewurlpatterns=patterns(...url('proxy/(?P<http>\d+)/(?P<url>.*)',proxy_view),...)LicenseCopyright © blackjack0v0All rights reserved.
Package: django-proxy-overrides
Allow overriding foreign key fields on Proxy models.Mostly, you won’t want to do this. However, I did have a situation where it would
be useful, mainly for reducing the numbers of queries I was having to run.You can read about it at:http://schinckel.net/2015/05/13/django-proxy-model-relations/Usage is pretty simple:fromproxy_overrides.relatedimportProxyForeignKeyclassProxyModel(ParentModel):related=ProxyForeignKey(OtherProxyModel)You may only override fields that exist, although in the future, it may be possible to create a relation with a different name (enabling you to keep the standard relation to the non-proxy model).
Package: django-proxy-users
===================Required components.--------------------Within the application we have integral components that are necessaryto run this app.* Forms* django_proxy_users.forms.AuthenticationForm (extends django.contrib.auth.forms.AuthenticationForm, django.core.paginator.Paginator)* django_proxy_users.forms.AuthenticateAsForm (extends django.contrib.auth.forms.Form)* Backends* django_proxy_users.auth.backends.LoginAsBackend* django_proxy_users.auth.backends.LogBackInAsBackend* Context Processors* django_proxy_users.context_processors.login_asSample Components and Open Source Libraries.--------------------------------------------* Open Source Libraries* Jquery 1.8.2* Twitter Bootstrap* Views* django_proxy_users.views.home* django_proxy_users.views.login* django_proxy_users.views.login* django_proxy_users.views.logout* django_proxy_users.views.login_as* django_proxy_users.views.log_back_in_asInstall & Configure===================Required Steps to get it working.----------------------------1. Get the code source from either:* Download and place within your django app.* http://pypi.python.org/pypi/django-proxy-user/* https://github.com/jturo/django-proxy-users* OR PIP install* pip install django-proxy-users2. Install the app in setttings.py.::INSTALLED_APPS = (...'django_proxy_users',...)3. Add context processors.::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.core.context_processors.tz","django.contrib.messages.context_processors.messages","django_proxy_users.context_processors.login_as",...)4. Add Authentication Backends.::AUTHENTICATION_BACKENDS = (..."django_proxy_users.auth.backends.LoginAsBackend","django_proxy_users.auth.backends.LogBackInAsBackend","django.contrib.auth.backends.ModelBackend",...)Enable the example.-------------------1. Enable the django admin panel to add some testing users.2. Update the urls.py file.```urlpatterns = patterns('',...url(r'^django/proxy/users/', include('django_proxy_users.urls')),)```2. Syncronize the database.python manage.py syncdb3. Create some testing users.Additional and Optional Configuration Options (settings.py).-------------------------------------------------------------**ORIGINAL_USER_KEY**  session key where the original user is stored
Package: django-prune-uploads
Installdjango-prune-uploadsusing pip and addprune_uploadsto yourINSTALLED_APPS.Run./manage.py prune_uploadsand have a look at the output (does
not change anything in the database or the file system!)Run./manage.py prune_uploads-v2for a potentially much more
verbose report.Run./manage.py prune_uploads--helpto learn about the available
options for actually changing and/or removing files and records.
Package: django-psdb-engine
django-psdb-engineThis package helps you interact with yourPlanetScaledatabases in your Django projects in an easier way.UsageInstall the package by running the following command.pipinstalldjango-psdb-engineAnd finally, update yourDATABASESconfiguration and change theENGINEfield.DATABASES={'default':{'ENGINE':'django_psdb_engine',...'OPTIONS':{'ssl':{'ca':...}}}}Note: Since Django uses theUTF-8charset and it points toutf8mb3in MySQL and this charset is deprecated in MySQL 8, you may need to add{"charset": "utf8mb4"}and migrate your chanegs with no problem.- 'OPTIONS': {'ssl': {'ca': ...}}+ 'OPTIONS': {'ssl': {'ca': ...}, 'charset': 'utf8mb4'}Requirementsdjango >= 2.2mysqlclient >= 2.1.0LicenseFree software:MIT license
Package: django-pserver
This is a drop-in replacement for Django’s runserver command for the impatient.Django’s development server restarts itself whenever it detects a change in any loaded module, which is great.
What’s not so great is that during the restart, there is a window of time where, if you’re like me, you’d be hitting Ctrl+R key repeatedly on the browser only to be greeted withECONNREFUSEDbecause the server is not ready.Django-pserver solves this problem by reusing the listening socket when it restarts, so you can just hit refresh once and wait (retaining your sanity.)UsageTo use it, simply addpserverto yourINSTALLED_APPS, and runmanage.py runserveras usual.TODOI’ve tested this on Django 1.2.4 and 1.3, but it could well work with other versions.Tested on OS X only, but should work on any UNIX variant. It will probably break horribly on Windows.
Package: django-pseudo-cms
A real basic, fake kind of CMS. Allows you to add just a tiny bit
of dynamic content to your pages.OverviewI often find as a developer I want full control of the page, but there
are small pieces I want a non-technical person to be able to change, or
myself be able to change without additional code / deployment.This allows you to let a user customize the title tag, meta description,
page title, page body, and a single page image. It will only allow you
to save acontentmodel to an existing url path that is resolvable
in your django project.Installationpip install django-pseudo-cmsUsageaddpseudo_cmsto yourINSTALLED_APPSsetting.If you want to change the image and/or thumbnail size of the page’s
content image, add the following directives to your settings as they apply.PSEUDO_CMS_IMAGE_SIZE = (300, 300)
PSEUDO_CMS_THUMBNAIL_SIZE = (150, 150)The tuple refers to (width, height). If you’d like to force the image to
a particular size without maintaining its aspect ratio, add a third itemTrueto your tuple.
Package: django-psycopg2-extension
Django-psycopg2-extensionLibrary contains django commands which helps to prepare and manage PostgreSQL database.QuickstartInstall djjango-psycopg2-extensionpipinstalldjango-psycopg2-extensionAdd psycopg2_extension to yourINSTALLED_APPS:INSTALLED_APPS=[# Django apps...'psycopg2_extension',]CommandspsqlinitDjango command psqlinit create a database defined in django settings.You can define specific database settings with standard djangoDATABASEsettings:DATABASES={'default':{...'EXTENSIONS':['postgis','unaccent'],# extensions to be installed with psqlinit command'SNAPSHOT_FILE':Path('data','sql','local','init_default.sql'),# SQL which will be loaded after database initialization},}Snapshot and extensions are automatically loaded when database is preparing for tests too.psqlcleanPostgreSQL database requires often callVACUUMandREINDEX. The commandpsqlcleanperforms these operations.You can define specific database settings for psqlclean command with standard djangoDATABASEsettings:DATABASES={'default':{...'VACUUM':{'EXCLUDE':['users_user'],# list of excluded tables'TABLES':['users_permission'],# list of tables to vacuum, all tables are selected if the setting is not set'TABLES_FULL':['users_permission'],# list of tables to vacuum full'TABLES_REINDEX':['users_permission'],# list of tables to reindex}},}psqlsnapshotCommand which creates SQL dump withpg_dumpscript and store it to the database'SNAPSHOT_FILE'setting.psqlviewsCommand which creates views defined in'VIEWS'setting.DATABASES={'default':{...'VIEWS':{'MODELS':{'auth.users':['id','email','first_name','last_name'],# Model name and list of fields},'SCHEMA':'public',# Schema name}}}Now you can callpsqlviewscommand to create or remove views../manage.pypsqlviews--create
./manage.pypsqlviews--delete
Package: django-psycopg2-pool
# django-psycopg2-pool--------------------## Features-----------* Basic postgres connection pool for Django using gevent** assumes you monkeypatch somewhere when using this backend## Installing the app----------------------clone via git and python setup.py installOReasy_install django-psycopg2-pool## Setting up the app----------------------Assuming you have Django installed and this app installed,1. add 'django-psycopg2-pool.gevent' as your db backend2. this may be required if you have south: in settings.py, have a line like:SOUTH_DATABASE_ADAPTERS = {'default': "south.db.postgresql_psycopg2",}## NOTES---------This package includes a modified version of the gevent example psycopg2_poolThank you to the author(s) of gevent and psyocopg2_pool# CONTRIBUTE-----------* feel free to contribute!* maybe this can be done in eventlet as well? I welcome pull requests
Package: django-pt
pt is a simple, Django-powered project tracking solution.[![Build Status](https://travis-ci.org/fstraw/django-pt.svg?branch=master)](https://travis-ci.org/fstraw/django-pt)DocumentationComing soon!Demo[http://www.lowestfrequency.com/pt](http://lowestfrequency.com/pt“PT Demo”)QuickstartAddpttoINSTALLED_APPSinsettings.py:>               INSTALLED_APPS = {
>               …
>               ‘pt’
>               }Add ‘pt/templates/pt’ toTEMPLATESinsettings.py:>       TEMPLATES = [
>           {
>               ‘BACKEND’: ‘django.template.backends.django.DjangoTemplates’,
>               ‘DIRS’: [‘pt/templates/pt/’],
>               …
>               }Include theptURLconf in urls.py:>       url(r’^pt/’, include(‘pt.urls’))Runpython manage.py migrateto migrate pt’s models.Runpython manage.py createsuperuserto set up initial login.Start tracking!
Package: django-ptpython
django-ptpythonPtPython as the Default Django Shell.Getting StartedInstall the PackageInstall it via pip:pipinstalldjango-ptpythonInstall the AppAdddjango-ptpythonto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ..."django_ptpython",# ...]Usage./manage.pyshellLicenseDistributed under the Apache License. SeeLICENSEfor more information.ContactEmail: tell.reganto[at]gmail[dot]com
Package: django-ptree-extra-views
Django’s class-based generic views are great, they let you accomplish a large number of web application design patterns in relatively few lines of code.  They do have their limits though, and that’s what this library of views aims to overcome.InstallationInstalling from github.pip install -e git://github.com/tomchristie/django-extra-views.git#egg=django-extra-viewsFeatures so farFormSet and ModelFormSet views - The formset equivalents of FormView and ModelFormView.InlineFormSetView - Lets you edit formsets related to a model (uses inlineformset_factory)GenericInlineFormSetView, the equivalent of InlineFormSetView but for GenericForeignKeysCreateWithInlinesView and UpdateWithInlinesView - Lets you edit a model and its relationsSupport for generic inlines in CreateWithInlinesView and UpdateWithInlinesViewNotesNamedFormsetMixin removed - context behavior baked directly into views, withinline_context_namesandformset_context_name.RemovedMultiFormView,SearchableMixin,SortableListMixin,CalendarMonthView.TheInlineFormSetandGenericFormSetclasses are now just regular classes, not views.Still to doAdding support for pagination in ModelFormSetView and its derivatives should now be simpler.ExamplesDefining a FormSetView.from extra_views import FormSetView


class AddressFormSet(FormSetView):
    form_class = AddressForm
    template_name = 'address_formset.html'Defining a ModelFormSetView.from extra_views import ModelFormSetView


class ItemFormSetView(ModelFormSetView):
    model = Item
    template_name = 'item_formset.html'Defining a CreateWithInlinesView and an UpdateWithInlinesView.from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSet
from extra_views.generic import GenericInlineFormSet


class ItemInline(InlineFormSet):
    model = Item


class TagInline(GenericInlineFormSet):
    model = Tag


class CreateOrderView(CreateWithInlinesView):
    model = Order
    inlines = [ItemInline, TagInline]


class UpdateOrderView(UpdateWithInlinesView):
    model = Order
    inlines = [ItemInline, TagInline]


# Example URLs.
urlpatterns = patterns('',
    url(r'^orders/new/$', CreateOrderView.as_view()),
    url(r'^orders/(?P<pk>\d+)/$', UpdateOrderView.as_view()),
)
Package: django-ptvsd-debug
Django PTVSD DebugA little manage.py tweak to attach a PTVSD debugger during runserver.
Built with WSL development in mind since we have to treat it like remote in apps like VSCode (for now...)UsageAdd django_ptvsd to your INSTALLED_APPSaboveDjangoINSTALLED_APPS = (
    'django_ptvsd',
    ...
)pass--ptvsdflag to runserver commanddjango-admin runserver --ptvsdDjango SettingsPTVSD_ENABLE = FalseAttach PTVSD by default. No need for--ptvsdflagPTVSD_REMOTE_ADDRESS = '0.0.0.0'- Which address to listen onPTVSD_REMOTE_PORT = 5678- Which port to listen onPTVSD_WAIT_FOR_ATTACH = False- Whether or not to wait for attach before continuing
Package: django-public-admin
Django Public AdminA public and read-only version of theDjango Admin. A drop-in replacement for Django's nativeAdminSiteandModelAdminfor publicly accessible data. Check thedocumentationfor more information on how to use it.ContributingWe usetoxto Run tests with Python 3.6, 3.7 and 3.8, and with Django 2 and 3. Also we use Black andflake8:$poetryinstall$poetryruntoxDocsTo build the docs we useSphinx:$ poetry run sphinx-build docs docs/_build/Them just jump todocs/_build/index.html.License & CreditsThis package is licensed underMIT licenseand acknowledgeSerenata de Amor(©Open Knowledge Brasiland, previously, ©Data Science Brigade).
Package: django-publications-bootstrap
Bootstrap-powered scientific publications for DjangoA Django app for managing scientific publications, providing a
Bootstrap-powered UI.ScreenshotsFeaturesautomatically creates lists for individual authors and tagsBibTex import/exportRIS export (EndNote, Reference Manager)unAPI support (Zotero)customizable publication categories/BibTex entry typesPDF uploadRSS feedssupport for imagesembeddable referencesin-text citations, inspired by LaTeXautomatic bibliography, inspired by LaTeXRequirementsPython >= 3.4Django >= 1.10.8Pillow >= 2.4.0django-countries >= 4.0django-ordered-model >= 1.4.1six >= 1.10.0Bootstrap v4.0.0-betadjango-echoices >= 2.2.5InstallationUsingPyPIRunpip installdjango-publications-bootstrap.Using the source codeMake sure`pandoc<http://pandoc.org/index.html>`__ is installedRun./pypi_packager.shRunpip installdist/django_publications_bootstrap-x.y.z-[...].wheel,
wherex.y.zmust be replaced by the actual version number and[...]depends on your packaging configurationConfigurationAddpublications_bootstrapto theINSTALLED_APPSin your
project’s settings (usuallysettings.py).Add the following to your project’surls.py:url(r'^publications/', include('publications_bootstrap.urls')),Run./manage.py migrate publications_bootstrap.In your project’s base template, make sure the following blocks are
available in the<head>tag:head, to provide xml contentcss, to provide CSS specific to this applicationThe content itself will be inserted in thecontentblock.CreditsThis is a fork ofdjango-publicationsfromlucastheis.
Package: django-public-project
Django Public Project (DPP) is a custom CMS for making large public projects, political processes and enquiry commissions
more transparent.Current languages available: EN | DEDocumentationRead more about DPP in the ReadTheDocs documentation:http://django-public-project.readthedocs.org/Getting Help/ContactThere is a Google Group you can use for asking questions or giving suggestions:http://groups.google.com/d/forum/django-public-projectFeel free to get in touch on Twitter or follow for updates on new releases:https://twitter.com/DjPublicProject
Package: django-publish
django-publish - cli publishing fordjango-articlesblogsdjango-publishallows you to publish to yourdjango-articles-powered
blog via the command line. Currently only supports documents written in reST
(though why would you use anything else?! ;)). For more information, consult thedocumentation.Creditsdjango-articlesNews1.0.5Release date: 28 FEB 2011Really never, ever require login to view new posts (by default).1.0.4Release date: 16 NOV 2010By default, don’t require login to view new posts.1.0.3Release date: 16 NOV 2010Another setup.py issue.1.0.2Release date: 16 NOV 2010Removed distribute from setup.py1.0.1Release date: 15 NOV 2010Basic functionality
Package: django-publishable
# Django Publishable 🦄[![PyPI version](https://badge.fury.io/py/django-publishable.svg)](https://badge.fury.io/py/django-publishable) [![CircleCI](https://circleci.com/gh/Ilyes-Hammadi/django-publishable.svg?style=svg)](https://circleci.com/gh/Ilyes-Hammadi/django-publishable)## What is Django-Publishable?Django library that add to your models the draft/publish features.## Instalation```shell$ pip install django-publishable```## Quick start1. Add "publishable" to your INSTALLED_APPS setting like this::```pythonINSTALLED_APPS = [...'publishable',]```2. Run `python manage.py migrate` to create the publishable models.3. Try to replicate this with your models:```pythonfrom django.db import modelsfrom publishable.models import Publishable, Publisher# A Publisher is responsible for triggering# the publish all drafts that he containsclass User(Publisher):pass# Overdide the Publishable to implement the logic# of broadcast_need_to_publishedclass MyPublishable(Publishable):class Meta:abstract = Truedef broadcast_need_to_published(self):"""This function will return a Draft instancethen it's up to you select your Publisherand add it to it's draft"""draft = super(MyPublishable, self).broadcast_need_to_published()chatbot, _ = User.objects.get_or_create(pk=1)chatbot.add_draft(draft)# After setting up your Publishable# then inherit from it into the model that you need to receie# draft/publish featuresclass Article(MyPublishable):title = models.CharField(max_length=255)content = models.TextField()comments = models.ManyToManyField('Comment', related_name='comments')highlighted_comment = models.ForeignKey('Comment', related_name='highlighted_comment', null=True)class Comment(MyPublishable):content = models.CharField(max_length=255)```4. By default now all your model will store changes into the draft```python# Add changes and publish one model>>> a = Article.objects.create()>>> a.title = "foo">>> a.publish()>>> a.published.titlefoo# Let's add changes and publish using a publisher>>> a.title = "boo">>> a.save()>>> a.published.titlefoo>>> user = User.objects.get(pk=1)>>> user.publish()# You can track the status of the publishing process>>> user.publishing_statusPUBLISHED```## Using the Context ManagerIn order to keep your code clean and avoid replication of code by doing `article.published` all the time, you can use the `PublishedContextManager`. Every operation that you do inside the `with` will target the published version of the model. But be carful do not do any changes to the `published`, you're only supposed to read data, inserting the data should target the `draft`.```python>>> from publishable.context_managers import PublishedContextManager>>> a = Article.objects.create(title="foo")>>> a.publish()>>> a.title = "boo">>> a.save()>>> with PublishedContextManager():print(a.title)foo>>> print(a.title)boo```
Package: django-publishable-model
Make your models publishable in an easy way, the admin will be smart and easily configurableDocumentationThe full documentation is athttps://django-publishable-model.readthedocs.io.QuickstartInstall Django Publishable Model:pip install django-publishable-modelAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'publishable_model',...)FeaturesHandle of Django Model’s publication.Example of usagefrompublishable_model.modelsimportPublishableModelclassNews(PublishableModel,models.Model):title=models.CharField(_("Title"),max_length=64,)content=models.TextField(_("Content"),blank=True,default="")def__str__(self):returnself.titleclassMeta(PublishableModel.Meta):verbose_name=_('News')verbose_name_plural=_('News')Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

or

./manage.py test testsDevelopment commands::pip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.4 (2021-11-11)Fix on readme and license.0.1.3 (2021-11-11)Fix on readme.0.1.2 (2021-11-11)Fix on readme.0.1.1 (2021-11-11)Add tox configuration.0.1.0 (2020-09-21)First release.
Package: django-publishing
Publishing is a simple publishing tool for django to make changes on your
models based on a workflow.Detailed documentation is in the “docs” directory.Quick startAdd “publishing” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'publishing',
]Add the model mixinPublishModelMixinto your model class.Add the admin mixinPublishAdminMixinto your admin class.Runpython manage.py migrateto add publishing related fields to models.
Package: djangopubsub
Django pubsubDjango Pubsub wrapper.Installation with requirements.txtdjangopubsubWith PIP$pipinstalldjangopubsubAdd app to django settingsINSTALLED_APPS = (
    ...,
    'djangopubsub'
)Available settings and defaults:BASE_DIR=''# Root directory for handlers lookupEVENT_HANDLERS_DIR_NAME='event_handlers'#  Directory with handlers on every app moduleHANDLER_FILES_PREFIX='handlers_'# handlers file prefixREDIS_HOST='localhost'REDIS_PORT=6379PUB_SUB_EMIT=True# Avoid to emit message when emit is called (for tests)Decorator@on_event('EVENT_NAME')deffunc_to_execute(data):passPubsub emitfromdjangopubsub.djangoPubSubimportDjangoPubSubDjangoPubSub().emit('EVENT_NAME',{})Pubsub receiverNeeds redis running on port:REDIS_PORTpython manage.py runpubsubreceiver --settings=your_proyect.settings