Saravanan666/pypi-org huggingface dataset:
Package: django-pgtransaction
django-pgtransactiondjango-pgtransactionoffers a drop-in replacement for the defaultdjango.db.transactionmodule which, when used on top of a PostgreSQL database, extends the functionality of that module with Postgres-specific features.At present, django-pgtransaction offers an extension of thedjango.db.transaction.atomiccontext manager/decorator which allows one to dynamically set theisolation levelwhen opening a transaction, as well as specifying a retry policy for when an operation in that transaction results in a Postgres locking exception. See the quickstart below orthe docsfor examples.QuickstartSet the isolation level of a transaction by usingpgtransaction.atomic:importpgtransactionwithpgtransaction.atomic(isolation_level=pgtransaction.SERIALIZABLE):# Do queries...There are three isolation levels:pgtransaction.READ_COMMITTED,pgtransaction.REPEATABLE_READ, andpgtransaction.SERIALIZABLE. By default it inherits the parent isolation level, which is Django's default of "READ COMMITTED".When using stricter isolation levels likepgtransaction.SERIALIZABLE, Postgres will throw serialization errors upon concurrent updates to rows. Use theretryargument with the decorator to retry these failures:@pgtransaction.atomic(isolation_level=pgtransaction.SERIALIZABLE,retry=3)defdo_queries():# Do queries...Note that theretryargument will not work when used as a context manager. ARuntimeErrorwill be thrown.By default, retries are only performed whenpsycopg.errors.SerializationErrororpsycopg.errors.DeadlockDetectederrors are raised. Configure retried psycopg errors withsettings.PGTRANSACTION_RETRY_EXCEPTIONS. You can set a default retry amount withsettings.PGTRANSACTION_RETRY.pgtransaction.atomiccan be nested, but keep the following in mind:The isolation level cannot be changed once a query has been performed.The retry argument only works on the outermost invocation as a decorator, otherwiseRuntimeErroris raised.Compatibilitydjango-pgtransactionis compatible with Python 3.8 - 3.12, Django 3.2 - 5.0, Psycopg 2 - 3, and Postgres 12 - 16.DocumentationCheck out thePostgres docsto learn about transaction isolation in Postgres.View the django-pgtransaction docs hereInstallationInstalldjango-pgtransactionwith:pip3 install django-pgtransactionAfter this, addpgtransactionto theINSTALLED_APPSsetting of your Django project.Contributing GuideFor information on setting up django-pgtransaction for development and contributing changes, viewCONTRIBUTING.md.Primary AuthorsPaul GilmartinWes Kendall
Package: django-pg-trunk
django-pg-trunkA PostgreSQL query profiler for Django that usespg_stat_statementsextension.Changelogv0.1.0Project is created.RequirementsPython >= 3.7PostgreSQL >= 13Django >= 2.2InstallationInstall using pip:pip install django-pg-trunkThen adddjango_pg_trunkto yourINSTALLED_APPS.INSTALLED_APPS=[...'django_pg_trunk',]django-pg-trunkwill automatically installpg_stat_statementsextension for PostgreSQL if it doesn't exist, howeverpg_stat_statementsshould be added toshared_preload_librariesin the PostgreSQL config. To do this, you can either runpostgres serveras following as in the test Docker Composeconfiguration:postgres -c shared_preload_libraries=pg_stat_statementsor you should changepostgresql.conffile manually and restart thepostgresserver. You can use thehelper scriptto changepostgresql.conf.UsageAfter installing the package, database queries can be examined underPg Trunk > Query Statisticsin Django admin.Change view have more detailed statistics. All of the columns ofpg_stat_statementscan be foundhere.A possible usecase ofQueryStatisticmodel can be running a cron job that checks if there is a query that takes more time than a specific thershold, and send related alerts (emails, Slack notifications, etc.).ContributionAs a first step, please open an issue about the feature/bug.Development environment can be created usingsource scripts/run_development.sh.Tests can be run usingpytestcommand. Tests for different environments will be run on CircleCI.Changes on Django Admin can be tested usingpython manage.py runserver 0:8000in development Docker container and navigating tohttp://127.0.0.1/admin.
Package: django-phantom-pdf
Django Phantom PDF==================A simple django app that takes the pain out of rendering PDFs from django views.Quick start-----------1. Install node and phantomjs:### On Mac OSX:brew install node npmnpm install -g phantomjs### On Ubuntu:apt-get install node npmsudo npm install -g phantomjs2. Install django-phantom-pdf:pip install django-phantom-pdf3. That's it, you can now start using it in your django views like so and rendering PDFs!from phantom_pdf import render_to_pdffrom django.http import HttpResponsedef home(request):# If 'print=pdf' in GET params, then render the PDF!if request.GET.get("print", None) == "pdf":basename = 'output'  # `.pdf` will be appended to this string.return render_to_pdf(request, basename)# If you want to change default format and orientation for this view# return render_to_pdf(request, basename, format='A3', orientation='portrait')else:return HttpResponse("Hello World!")Advanced Use------------For more advanced use and control, you can set the following variables in your setting.They are already set to sane defaults, so it's not necessary unless you are looking formore fine grained control.PHANTOMJS_COOKIE_DIR = Directory where the temp cookies will be saved.PHANTOMJS_PDF_DIR = Directory where you want to the PDF to be saved temporarily.PHANTOMJS_BIN = Path to PhantomsJS binary.PHANTOMJS_GENERATE_PDF = Path to generate_pdf.js file.keep_pdf_files = Option to not delete the PDF file after rendering it.PHANTOMJS_FORMAT = Page size to usePHANTOMJS_ORIENTATION = How the page will be positioned when printing.
Package: django-phantom-theme
Django Phantom ThemePhantom is an admin theme for Django Framework. It allows for registering custom database options and provides a clean and modern web interface.
The application is designed to be responsive and adopt to mobile and tablet devices. To achieve this we have used the twitter bootstrap 3.x framework grid. The application is constantly evolving so make sure you checkout github for the latest updates and fixes.FeaturesA clean and modern user interfaceHand-written pure HTML5/CSS3 code with indented HTML outputResponsive interface, optimized for mobile phones and tabletsRegister custom database settings (options) editable from the UI. You can use all standard Django form fields for these settingsRegister your applications to the top-bar navigationRefurbished original django admin widgetsAdded new django admin widgetsAutoCompleteTextInputBootstrapRadioRendererBootstrapCurrencyDecimalWidgetBootstrapPercentageDecimalWidgetURLThumbWidgetSelect2MultipleWidgetSelect2WidgetBasic profile model and views ready to extendMechanism for opening the original Django admin popup windows with fancyboxZinnia Blog admin indexScreenshotsDjango Phantom Theme - login:https://raw.github.com/eggforsale/django-phantom-theme/master/screenshoots/login.pngDjango Phantom Theme - dashboard:https://raw.github.com/eggforsale/django-phantom-theme/master/screenshoots/dashboard.pngDjango Phantom Theme - password change:https://raw.github.com/eggforsale/django-phantom-theme/master/screenshoots/password_change.pngDjango Phantom Theme - pagination:https://raw.github.com/eggforsale/django-phantom-theme/master/screenshoots/pagination.pngAuthors and Contributorsbespider (@bespider) for EggForSale (@eggforsale) created Django Phantom Theme.LicenceDjango Phantom Theme is licensed under Creative Commons Attribution-NonCommercial 3.0 license.Licence and pricing:http://www.eggforsale.com/catalogue/django-phantom-theme_15/Support or ContactHaving trouble with Django Phantom Theme? Check out the detail page athttp://www.eggforsale.com/catalogue/django-phantom-theme_15/or contactsupport@eggforsale.comand we’ll help you sort it out.Documentation athttp://django-phantom-theme.readthedocs.org/en/latest/
Package: django-phased
A simple two-phase template rendering application useful for caching of authenticated requests.How it worksThis technique has been desribed by Adrian Holovatyin this blog postand previously by Honza Kral. The idea is to first render the template with
certain blocks denoted as “phased,” such that they will not be rendered, and
will remain valid template code that can be rendered with a second pass.The second pass fetches the partially-rendered template from the cache and
performs a second render on it, using RequestContext to provide user-specific
context to the template. This enables very fast generation of pages that have
user-specific content, by bypassing the need to use theCACHE_MIDDLEWARE_ANONYMOUS_ONLYsetting.This implementation uses a secret delimiter that makes it safe against the
possibility of template code injection vulnerabilities, as it only passes any
given text through the template parser once. The phased blocks can also contain
cached context.Basic Implementationdjango-phased contains a templatetag,phased, which defines blocks that
are to be parsed during the second phase. A middleware class,
PhasedRenderMiddleware, processes the response to render the parts that were
skipped during the first rendering.A special subclass of UpdateCacheMiddleware that drops the “Vary: Cookie”
header from response when it updates the cache is also included, which, if
used in place of the standard UpdateCacheMiddleware will prevent the cache
middleware from varying the cache key based on cookies, thus enabling caching
of pages in authenticated sessions.
Package: django-phaxio
Django PhaxioDjango WebHooks forPhaxiocallbacks.InstallationSimply install the latest stable package using the commandpipinstalldjango-phaxioadd'django_phaxio',toINSTALLED_APPs in your settings.pyand addpath('phaxio/',include('django_phaxio.urls',namespace='phaxio')),to yoururlpatternsin your URL root configuration.You will also need to set thePhaxiocallback token for security.PHAXIO_CALLBACK_TOKEN(required):Callback token provided by Phaxio to verify the request origin.Seehttps://www.phaxio.com/docs/security/callbacksDocumentationThe latest documentation can be found atRead the Docs.ContributionPlease read theContributing Guidebefore you submit a pull request.
Package: django-phenotype-ontologies
Django app to parse/load phenotype ontologies (OncoTree, HPO, MONDO, etc)DocumentationThe full documentation is athttps://django-phenotype-ontologies.readthedocs.io.QuickstartInstall Django Phenotype Ontologies:pip install django-phenotype-ontologiesAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'phenotype_ontologies',...)Add Django Phenotype Ontologies’s URL patterns:fromphenotype_ontologiesimporturlsasphenotype_ontologies_urlsurlpatterns=[...url(r'^',include(phenotype_ontologies_urls,namespace='phenotype_ontologies')),...]Featuressyncs OBO from MONDO, HPO, and NCIT (OncoTree)REST API to interact with modelsGraphQL Nodes to be incorporated to existing GraphQL setups with graphene_djangoRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2018-04-10)Models for Phenotype OntologiesREST APIGraphQL NodesSync methods for PURL of MONDO, HPO, NCIT0.1.1 (2018-04-10)0.1.1 ChangelogUpdated sync to sync_ontology to make it more descriptive0.1.2 (2018-04-10)0.1.2 ChangelogAdded better support for MONDO. A few oddities were causing errors w/ pronto.0.1.3 (2018-04-18)0.1.3 ChangelogUpdated 3rd party libs0.1.4 (2018-05-16)0.1.4 ChangelogUpdated setup.py to read from requirements.txt0.2.0 (2018-06-01)0.2.0 ChangelogRemoved support for GraphQL0.2.1 (2018-07-27)0.2.1 ChangelogUpdated NCIT to be OncoTree - since we are using the onco tree specific ontology0.2.2 (2018-08-13)0.2.2 ChangelogUpdated 3rd party requirements. Some requirements had changed so it was causing failures0.2.3 (2018-10-29)0.2.3 ChangelogUpdated 3rd party requirements.0.2.4 (2018-11-27)0.2.4 ChangelogUpdated 3rd party requirements.0.2.5 (2019-02-08)0.2.5 ChangelogUpdated 3rd party requirements.Updated tests to use py.test fixtures0.2.6 (2019-04-10)0.2.6 ChangelogUpdated 3rd party requirements.Updated travis to use xenial distribution. Django 2.1 dropped support for SQLite < 3.8.30.2.7 (2019-05-31)0.2.7 ChangelogUpdated package to use latest cookiecutter template0.2.8 (2019-07-26)0.2.8 ChangelogUpdated 3rd party requirements.0.2.9 (2019-08-09)0.2.9 ChangelogUpdated 3rd party requirements.0.2.10 (2019-09-09)0.2.10 ChangelogUpdated 3rd party requirements.1.0.0 (2019-11-01)1.0.0 ChangelogFirst production release1.0.1 (2019-11-01)1.0.1 Changelogpronto > v1.0.0 is not compatible1.1.0 (2019-11-26)1.1.0 ChangelogUpdated dependencies
Package: django-phone-auth
A Django library that addresses authentication, registration, and account management using phone-number/email/username.
It usesdjango-phonenumber-field[phonenumbers]to store phone numbers.Source codehttps://github.com/samyakjain101/django-phone-authDocumentationhttps://django-phone-auth.readthedocs.io/en/latest/FeaturesLogin through phone, email, or username.User Registration.Phone/Email verification.Password reset using phone/email.Change password.Add new email/phone.Running teststox needs to be installed. To run the whole test matrix with the locally
available Python interpreters and generate a combined coverage report:tox
Package: django-phone-field
django-phone-fieldLightweight model and form field for phone numbers in DjangoView and edit phone numbers in forms and the Django admin in pretty format:(415) 123-4567Store all phone numbers canonically in the database for easy searching & uniqueness:+14151234567Built-in support for simple extensions:(415) 123-4567, press 88Doesn't choke on international numbers (but doesn't format them, either)Automatically format phone numbers in templatesThis package is simple, lightweight, and without dependencies. However, it doesn't attempt to solve fancy
problems or deal with international phone numbers. For a full-featured phone number package, take a look atdjango-phonenumber-field.InstallationThis package is designed for Python 3 and Django 1.10+. Install via:pip install django-phone-fieldThen add'phone_field'to yourINSTALLED_APPSsetting.UsageIn yourmodels.py:from django.db import models
from phone_field import PhoneField


class MyModel(models.Model):
    name = models.CharField(max_length=128)
    phone = PhoneField(blank=True, help_text='Contact phone number')PhoneFieldaccepts standard options for a DjangoCharField. By default it setsmax_length=31. Feel
free to override this, setblank=True, etc. as you would otherwise.There is one special argument,E164_only=False, which adds a form validator to only accept numbers in
the E164 format (currently, only supported for US phone numbers).In your template:User {{ obj.name }} has phone number {{ obj.phone }}Result:User Ted has phone number (415) 123-1233Database representationPhoneFieldattempts to coerce all phone numbers to the following format:+[country code][number]x[extension]
+12223334444x55where the extension part is optional. If the input phone number can't be coerced to this
format,PhoneFieldgives up and simply stores it as-is.Because all phone numbers are stored without formatting, you can set this field to be unique
on a Django model and it will actually work.ExtrasUse the|phonetemplate filter to attempt to display a formatted phone number from arbitrary text. Use
the|raw_phonetemplate filter to display the raw, un-formatted value.Use property.is_E164to check if a PhoneNumber object is in E164 format.Also provided are.is_standard(E164 but with extensions allowed) and.is_usa.
Package: django-phone-login
Django Phone LoginDjango-phone-login uses django-sendsms to send sms.Django Phone Login provides phone number login with no additional
passwords to remember. It’s a easy way to grow your customer base.
Without any hassle.Installing Django Phone LoginDjango Phone Login was built for django.PyPi, install using PIP:pipinstalldjango-phone-loginIf you want to install manually:gitclonegit@github.com:wejhink/django-phone-login.gitcddjango-phone-login/pipinstall-rrequirements.txtpythonsetup.pyinstallInstructionsINSTALLED_APPS+=[...# Make sure to include the default installed apps here.'phone_login','rest_framework','rest_framework.authtoken',]REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework.authentication.BasicAuthentication','rest_framework.authentication.TokenAuthentication',)}AUTHENTICATION_BACKENDS=['phone_login.backends.phone_backend.PhoneBackend','django.contrib.auth.backends.ModelBackend']# Make sure you also have backend Django Templates and APP_DIRS True, if you want to use default OTP Template.TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','APP_DIRS':True,...},]# Configure the SENDSMS_BACKEND (for django-sendsms integration)SENDSMS_BACKEND='myapp.mysmsbackend.SmsBackend'#(defaults to 'sendsms.backends.console.SmsBackend')SENDSMS_FROM_NUMBER="+XXxxxxxxxxxx"SENDSMS_ACCOUNT_SID='ACXXXXXXXXXXXXXX'SENDSMS_AUTH_TOKEN='xxxxxxxx'Adding to URLsAdd the Belowurls.pyurlpatterns=[url(r'^phone_login/',include('phone_login.urls',namespace='phone_login'),),]Customizable Fields in Settings.PHONE_LOGIN_ATTEMPTS=10PHONE_LOGIN_OTP_LENGTH=6PHONE_LOGIN_OTP_HASH_ALGORITHM='sha256'FlowUser enter thephone_numberand sends request to generatesecret code.django-phone-loginsends asecret_codeas SMS to the phone
number.User sendssecret_codeto the server to verify.django-phone-loginverifies and sendtokenas response usingDRF3.Why use django-phone-login?Phone number login, no password required.Registration through phone number.Mobile based user authentication.
Package: django-phone-login-fix-version
Django Phone LoginDjango-phone-login uses django-sendsms to send sms.Django Phone Login provides phone number login with no additional
passwords to remember. It’s a easy way to grow your customer base.
Without any hassle.Installing Django Phone LoginDjango Phone Login was built for django.PyPi, install using PIP:pipinstalldjango-phone-loginIf you want to install manually:gitclonegit@github.com:wejhink/django-phone-login.gitcddjango-phone-login/pipinstall-rrequirements.txtpythonsetup.pyinstallInstructionsINSTALLED_APPS+=[...# Make sure to include the default installed apps here.'phone_login','rest_framework','rest_framework.authtoken',]REST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework.authentication.BasicAuthentication','rest_framework.authentication.TokenAuthentication',)}AUTHENTICATION_BACKENDS=['phone_login.backends.phone_backend.PhoneBackend','django.contrib.auth.backends.ModelBackend']# Make sure you also have backend Django Templates and APP_DIRS True, if you want to use default OTP Template.TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','APP_DIRS':True,...},]# Configure the SENDSMS_BACKEND (for django-sendsms integration)SENDSMS_BACKEND='myapp.mysmsbackend.SmsBackend'#(defaults to 'sendsms.backends.console.SmsBackend')SENDSMS_FROM_NUMBER="+XXxxxxxxxxxx"SENDSMS_ACCOUNT_SID='ACXXXXXXXXXXXXXX'SENDSMS_AUTH_TOKEN='xxxxxxxx'Adding to URLsAdd the Belowurls.pyurlpatterns=[url(r'^phone_login/',include('phone_login.urls',namespace='phone_login'),),]Customizable Fields in Settings.PHONE_LOGIN_ATTEMPTS=10PHONE_LOGIN_OTP_LENGTH=6PHONE_LOGIN_OTP_HASH_ALGORITHM='sha256'PHONE_LOGIN_DEBUG=True# will include otp in generate response, default is False.FlowUser enter thephone_numberand sends request to generatesecret code.django-phone-loginsends asecret_codeas SMS to the phone
number.User sendssecret_codeto the server to verify.django-phone-loginverifies and sendtokenas response usingDRF3.Why use django-phone-login?Phone number login, no password required.Registration through phone number.Mobile based user authentication.
Package: django-phonenumber-field
A Django library which interfaces withpython-phonenumbersto validate, pretty print and convert
phone numbers.python-phonenumbersis a port of Google’slibphonenumberlibrary, which
powers Android’s phone number handling.Documentationhttps://django-phonenumber-field.readthedocs.io/Running teststox needs to be installed. To run the whole test matrix with the locally
available Python interpreters and generate a combined coverage report:toxrun a specific combination:tox -e py310-djmain,py39-djmain
Package: django-phonenumber-field-for-garpix-user
GarpixCMS Empty TemplateCookiecutter template for GarpixCMS == 1.0.0.Makefile installInstall Docker and docker-compose.For Debian, Ubuntu:su
apt update; apt upgrade -y; apt install -y curl; curl -sSL https://get.docker.com/ | sh; curl -L https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-composeDon't forget press CTRL+D to exit from super user account.Apply environment variables:cp example.env .envInstall python dependenciesmake venvRun the projectmake installInstallInstall Docker and docker-compose.For Debian, Ubuntu:su
apt update; apt upgrade -y; apt install -y curl; curl -sSL https://get.docker.com/ | sh; curl -L https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-composeDon't forget press CTRL+D to exit from super user account.Apply environment variables:cp example.env .envChange a random string forSECRET_KEYandPOSTGRES_PASSWORDin.env.Install dependencies:pipenv install
pipenv shellRun make command to install pre-commit hook:make precommitUp docker-compose, migrate database and create super user:docker-compose up -d
python3 backend/manage.py makemigrations
python3 backend/manage.py migrate
python3 backend/manage.py createsuperuserRun the server:python3 backend/manage.py runserverEnjoy!
Package: django-phonenumber-filter
Django Phone Number Filter==========================.. image:: https://circleci.com/gh/foundertherapy/django-phonenumber-filter.png:target: https://circleci.com/gh/foundertherapy/django-phonenumber-filterAbout-----``django-phonenumber-filter`` is a Django app that will format and print aphonenumber in a template.Getting Started---------------$ pip install django-phonenumber-filterAdd "phonenumber_filter" to your INSTALLED_APPS setting like this:INSTALLED_APPS = (...'phonenumber_filter',)Then, in your template, load the ``phonenumber_filter`` template tag library:{% load phonenumber_filters %}To format and print a phone number, use the ``phonenumber`` filter:{{ raw_phone_number|phonenumber }}If you want to format the phone number for a particular country, include theoptional country code:{{ raw_phone_number|phonenumber:"IL" }}International and E164 formats are also supported:{{ raw_phone_number|phonenumber_international:"IL" }}{{ raw_phone_number|phonenumber_e164:"IL" }}