Saravanan666/pypi-org huggingface dataset:
Package: django-usda-mongo
Overviewdjango-usda-mongo imports and maps the USDA National Nutrient Database for Standard Reference (SR22) to Django models using MongoDB with mongoengine.
It also integrate django-mongonaut to admin the MongoDB database.RequirementsPython 2.5.xDjango 1.2.x (import_sr22 will not work with early versions)mongoenginedjango-mongonautInstallationpip install django-usda-mongo or copy theusda_mongofolder to a location available on yourPYTHONPATH.Add ‘usda’ toINSTALLED_APPSinsettings.pyOptionally, add(r’^usda/’, include(‘usda.urls’)),to yoururlpatterns.Data ImportTo import the latest SR22 data.  Simply use theimport_sr22management command
as follows:./manage.py import_sr22The above assumes that thesr22.zipfile is in the current folder.  To specify
an alternative location specify-f <filename>.Theimport_sr22command takes several options:–database <dbname> – Specify an alternative database to populate.–food – Create/update all foods.–group – Create/Update food groups.–nutrient – Create/Update nutrients.–weight – Create/Update weights.–footnote – Create/Update footnotes.–datasource – Create/Update data sources.–derivation – Create/Update data derivations.–source – Create/Update sources.–data – Create/Update nutrient data.’–all – Create/Update all data.All of the above options can be combined to only create/update the desired
data.  If no options are specified,-allis assumed.Also note that all data is loaded in a single transaction to ensure that
database consistency is maintained.NotesThe USDA National Nutrient Database for Standard Reference (SR22) can be found
here:http://www.ars.usda.gov/Services/docs.htm?docid=18879.History0.1.0 (2015-03-31)First release on PyPI.
Package: django-usda-nutrition
# django-usda-nutritionThis is a Django application which includes models corresponding to the USDANutrition Database, as well as import scripts to pull the current version ofthe dataset (SR28) into the Django-managed database.NOTE: [django-usda](https://github.com/notanumber/django-usda) also exists,but imports an older (SR22) dataset.## DependenciesThis packaged has only been tested with Python 3.5+ and Django 1.9+, but shouldwork with other versions. Feel free to submit pull requests for compatibility.## InstallInstall from `pip`:pip install django-usda-nutrition## UsageAdd `usda_nutrition` to your `INSTALLED_APPS` and then:./manage.py import_usda## Notes- The USDA database includes comprehensive information on how all nutritionaldata is calculated and references to the corresponding source datasets. Becausethat data is out of scope to use-cases that simply want to include the rawnutritional content in an application, those tables are not imported with thispackage. Nonetheless, the source CSV files, stubbed out models, and referencesto them in the import management command and checked in. The corresponding codeis commented out and could be a starting point to anyone wanted to use thatdata in a Django app.- A single bad datapoint from `FOOTNOTE.txt` was manually removed.
Package: django-use-email-as-username
A Django app to use email as username for user authentication.FeaturesCustom User model with no username fieldUse email as usernameIncludes a django-admin command for quick installFollow Djangobest practicesfor new Django projects and User models.QuickstartInstallDjango use Email as Username:# Run in your terminalpipinstalldjango-use-email-as-usernameAdd it to yourINSTALLED_APPS:# In your settings.py fileINSTALLED_APPS=(...'django_use_email_as_username.apps.DjangoUseEmailAsUsernameConfig',...)Create your new django app:# Run in your terminalpythonmanage.pycreate_custom_user_appAdd the new app to yourINSTALLED_APPS:# In your settings.py fileINSTALLED_APPS=(...'django_use_email_as_username.apps.DjangoUseEmailAsUsernameConfig','custom_user.apps.CustomUserConfig',...)Now instruct Django to use your new model:# In your settings.py fileAUTH_USER_MODEL='custom_user.User'Create and run migrations:# Run in your terminalpythonmanage.pymakemigrationspythonmanage.pymigrateYou now have a new Django app which provides a custom User model.You can further modify the new User Model any time in the future, just remember
to create and run the migrations.NotesThis app gives you a custom User model, which isgood practicefor new
Django projects.Changing to a custom user model mid-projectis not easy.It is recommended to always create a custom User model at the beginning of every
Django project.CreditsTools used in rendering this package:CookiecutterCookiecutter Django Packagebyjmfederico
Package: django-usefathom
django-usefathomFathom Analytics integration with Django projects. Provides ability to integrate
page view tracking and goal reporting.InstallationInstall the package:pip install django-usefathomAddusefathomto yoursettings.pyfile:INSTALLED_APPS=[# ..."usefathom",# ...]Add template processor to yoursettings.pyfile:TEMPLATES=[{# ...."OPTIONS":{"context_processors":[# ..."usefathom.context_processors.usefathom",# ...],},},]Add your fathom site id to yoursettings.pyfile:FATHOM_SITE_ID="XXXX1234"Include tracking snippet in your templates:{% include "usefathom/usefathom.html" %}From this point your site visits will be tracked.Custom domain for Fathom Analytics scriptIf you want to use the custom domain for Fathom Analytics add to yoursettings.py:FATHOM_SCRIPT_URL=https://cname.yourdomain.com/script.jsGoal TrackingPythonOptionally, add your goals dictionary to yoursettings.pyfile:FATHOM_GOALS={"registration":"XXXO9X","add_to_card":"YYYO9X,# ....}Now if you want to report a goal from your backend service to Fathom analytics:fromusefathom.apiimporttrackdefsome_view(request,*args,**kwargs):# anywhere you have request object, most likely views are a good place for thistrack(request,"add_to_card","2999")# Third parameter is optional, attaches the monetary value to the goal. 29.99 in exampleAnd the goal will be reported to Fathom analytics on the next page load.HTML+JSYou can use template tags to track the goals from the html. It's useful when tracking external link clicks, etc.{% load fathom }
......with link
<a href="https://go-somewhere.com/link" {% click_goal "somewhere_link_clicked" 100 %}>Go somewhere?</a>
......with form
<form method="POST" {% submit_goal "registration_submit" %}>
Package: django-useful
A collection of reusable Django snippets.Unlike other similar packages, I’ll try to keep it fully tested, documented,
and compatible with several Django and Python versions.Travis CI build status:Work in progress:
Currently this package is still under development, and intended mainly for my
personal use. New features will be added gradually.Compatible with:Python:2.6, 2.7Django:1.3, 1.4Celery:2.5, 3.0(optional)InstallationInstall by using pip or easy_install:pip install django-usefulOr install from source:git clone git@github.com:yprez/django-useful.git
cd django-useful
python setup.py installTo add this application into your project, just add it to yourINSTALLED_APPSsetting:INSTALLED_APPS = (
    ...
    'useful',
)For more details, see theDocumentation.
Package: django-useful-enums
Useful Enums - a library for creating Enums in a DRY way in PythonThis library grew out of me getting fed up with having to create Django
choices that were lists of tuples. I far preferred nicely contained enums of
the form:class MyEnum:

    VALUE_1 = 1
    VALUE_2 = 2However, most of the time you don'tneedto create all of the IDs yourself.
You should just be able to define the key names and have the Enum class do the
work for you.usefulenumsdoes that.The syntax is very similar to the Django idiom for creating a tuple of choices:from usefulenums import Enum

MyEnum = Enum(
    ("MY_FIRST_VALUE", "My First Display Text"),
    ("MY_SECOND_VALUE", "My Second Value"),
)However, you can now refer to those items by name in a more Pythonic fashion,
rather than having to use hard-coded strings:>>> MyEnum.MY_FIRST_VALUE
0Note that here,Enum()has given automatic values to the enum items. You can
set these values yourself by passing a three-tuple toEnumwhen you create
it:>>> MyEnum = Enum(
...     ("VALUE_1", "MY_FIRST_VALUE", "My First Value"),
...     ("VALUE_2", "MY_SECOND_VALUE", "My Second Value"),
... )
>>> print(MyEnum.MY_FIRST_VALUE)
VALUE_1You can also extract the Django-style choices from theEnumso that you use
it as you've always used choices:>>> MyEnum.as_choices()
(('VALUE_1', 'My First value'), ('VALUE_2', 'My Second Value'))Testingdjango-useful-enumscomes with unit tests that cover its behaviour. You can
run them usingnose:$ pip install nose
$ nosetests
Package: django-useful-fields
I found myself copying a few Django database field classes from project to project so I decided to bundle them togetherand release them as an open source package instead. Here are the fields that are currently included:TimeZoneFieldThis field stores a reference to a time zone in the database and automatically instantiates the correct pytz timezone object on retrieval. Useful for recording a user’s default time zone.MarkdownCharFieldThis field is meant to be used in collaboration with a regular CharField. The regular CharField stores the Markdown-formatted source text and this field will store the rendered HTML version of that same text. Use thepopulate_fromargument to indicated which field on the same model contains the source text. If theallow_htmlargument isFalse(the default), any HTML tags present in the source text will be removed using thebleach library. Theextensionsargument can be used to enable any desiredextensionsfor theMarkdown library. One extension is enabled by default:SmartyPants. SmartyPants is configured to use thecorrect Unicode characters (e.g. “) rather than HTML entities (e.g.&ldquo;). Since CharFields don’t normallycontain paragraphs of text, MarkdownCharField strips the<p></p>tags that Markdown always includes.MarkdownTextFieldThis field is meant to be used in collaboration with a regular TextField. The regular TextField stores the Markdown-formatted source text and this field will store the rendered HTML version of that same text. Use thepopulate_fromargument to indicated which field on the same model contains the source text. If theallow_htmlargument isFalse(the default), any HTML tags present in the source text will be removed using thebleach library. Theextensionsargument can be used to enable any desiredextensionsfor theMarkdown library. One extension is enabled by default:SmartyPants. SmartyPants is configured to use thecorrect Unicode characters (e.g. “) rather than HTML entities (e.g.&ldquo;).UUIDPrimaryKeyFieldUUIDs are, in many ways, better primary keys than automatically incrementing integer fields. Unfortunately, thedefault Django implementation—UUIDField—requires some boilerplate (including importing theuuidmodule) beforeit can be used as a primary key. UUIDPrimaryKeyField manages the boilerplate for you. Just addid = UUIDPrimaryKeyField()to your model and everything will just work.
Package: django-user-accounts
Table of ContentsAbout PinaxOverviewFeaturesSupported Django and Python versionsRequirementsDocumentationTemplatesContributeCode of ConductConnect with PinaxLicenseAbout PinaxPinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. This collection can be found athttp://pinaxproject.com.django-user-accountsOverviewdjango-user-accountsprovides a Django project with a very extensible infrastructure for dealing with user accounts.FeaturesFunctionality for:Log in (email or username authentication)Sign upEmail confirmationSignup tokens for private betasPassword resetPassword expirationAccount management (update account settings and change password)Account deletionExtensible class-based views and hooksetsCustomUsermodel supportSupported Django and Python versionsDjango / Python3.83.93.103.113.2  |  *  |  *  |  *   |
       4.2  |  *  |  *  |  *   |  *RequirementsDjango 3.2 or 4.2Python 3.8, 3.9, 3.10, 3.11django-appconf (included ininstall_requires)pytz (included ininstall_requires)DocumentationSeehttp://django-user-accounts.readthedocs.org/for thedjango-user-accountsdocumentation.
On September 17th, 2015, we did a Pinax Hangout ondjango-user-accounts. You can read the recap blog post and find the video herehttp://blog.pinaxproject.com/2015/10/12/recap-september-pinax-hangout/.The Pinax documentation is available athttp://pinaxproject.com/pinax/. If you would like to help us improve our documentation or write more documentation, please join our Slack team and let us know!TemplatesDefault templates are provided by thepinax-templatesapp in theaccountsection of that project.Reference pinax-templatesinstallation instructionsto include these templates in your project.View livepinax-templatesexamples and source atPinax Templates!See thedjango-user-accountstemplatesdocumentation for more information.ContributeFor an overview on how contributing to Pinax works read thisblog postand watch the included video, or read ourHow to Contributesection. For concrete contribution ideas, please see ourWays to Contribute/What We Need Help Withsection.In case of any questions we recommend you join ourPinax Slack teamand ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course also valid but we are usually able to help you faster if you ping us in Slack.We also highly recommend reading our blog post onOpen Source and Self-Care.Code of ConductIn order to foster a kind, inclusive, and harassment-free community, the Pinax Project
has acode of conduct.
We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.Connect with PinaxFor updates and news regarding the Pinax Project, please follow us on Twitter@pinaxprojectand check out ourPinax Project blog.LicenseCopyright (c) 2012-present James Tauber and contributors under theMIT license.
Package: django-user-action-confirmation
django-user-action-confirmation===============================Overview~~~~~~~~Easy and simple way to confirm user actions.This one can be used with email or sms confirmation, but not provide this functional.Installation~~~~~~~~~~~~Install developer version using PIP::pip install -e git+https://github.com/alekam/django-user-action-confirmation#egg=user_action_confirmationChange ``settings.py`` of your project. Add ``user_action_confirmation`` to``INSTALLED_APPS``. Add required options (see: Settings).Run ``manage.py syncdb`` or ``manage.py migrate options`` if you use Southand restart your project server.Settings~~~~~~~~CONFIRMATION_OPERATION_CHOICES - required, list of tuples witch contains operation ID and short descriptionCONFIRMATION_MAX_DAYS - optional, default is 3 daysUsage~~~~~Install it, plug-in to your project and add required settings. Have fun!Usage example (somethere in FormView.form_valid):name = sa_setting('SOCIAL_AUTH_PARTIAL_PIPELINE_KEY','partial_pipeline')backend = self.request.session[name]['backend']email = form.cleaned_data['email']token = Confirmation.objects.create(None, settings.OPERATION_REGISTER)token.params = {'email': email,'backend': backend}token.save()mail.send([email, ],settings.DEFAULT_FROM_EMAIL,template='confirm_registration',context={'user': {'first_name': self.request.session.get('saved_first_name', '')},'site': Site.objects.get_current(),'token': token.token,'confirm_url': reverse('auth_confirm_email',args=[token.token, ])})Provided template tags and libraries~~~~~~~~~~~~~~~~~~~~~~~No any templeate tags providedProvided management commands~~~~~~~~~~~~~~~~~~~~~~~~~~~~No any management commands providedTesting~~~~~~~If this application is installed in your project you can run this inside yourproject::python manage.py test user_action_confirmationor instead run inside this package::python run_tests.py
Package: django-user-activities
Django app for dealing with User activities (likes, tags, comments, etc.)DocumentationThe full documentation is athttps://django-user-activities.readthedocs.io.QuickstartInstall Django User Activities:pip install django-user-activitiesAdd it to yourINSTALLED_APPS(along with DRF and django-filters):INSTALLED_APPS=(...'rest_framework','django_filters',...'user_activities',...)Add Django User Activities’s URL patterns:fromuser_activitiesimporturlsasuser_activities_urlsurlpatterns=[...url(r'^',include(user_activities_urls,namespace='user_activities')),...]Using Activity, Comment, or Review in your models:fromdjango.contrib.contenttypes.fieldsimportGenericRelationfromdjango.dbimportmodelsclassExampleModel(models.Model):...comments=GenericRelation('user_activities.Comment')user_activities=GenericRelation('user_activities.Activity')FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.2.0 (2017-12-28)First release on PyPI.Initial models and REST API.0.3.0 (2017-01-05)0.3.0 ChangelogImproved REST API filters.0.3.1 (2017-01-09)0.3.1 ChangelogFixed issues with migrations.0.3.2 (2017-01-12)0.3.2 ChangelogFixed route names for SimpleRouter.0.4.0 (2017-02-06)0.4.0 ChangelogOptimized APIAdded additional filters to APIMade updates to dependencies library0.4.1 (2017-02-09)0.4.1 ChangelogFixed changelogMade updates to dependencies library0.5.0 (2017-04-07)0.5.0 ChangelogFixed changelogMade updates to dependencies library0.5.1 (2017-04-18)0.5.1 ChangelogMade updates to dependencies library0.5.2 (2017-05-16)0.5.2 ChangelogUpdated setup.py to read requirments.txt0.5.3 (2018-08-13)0.5.3 ChangelogUpdated 3rd party requirements. Some requirements had changed so it was causing failures0.5.4 (2018-10-29)0.5.4 ChangelogUpdated 3rd party requirements.0.5.5 (2018-12-18)0.5.5 ChangelogMinor model change to make text not required in Comment/Review models0.5.6 (2019-02-08)0.5.6 ChangelogUpdated 3rd party requirements.Updated testing to properly use py.text fixtures0.5.7 (2019-04-10)0.5.7 ChangelogUpdated 3rd party requirements.Updated travis to use xenial distribution. Django 2.1 dropped support for SQLite < 3.8.30.5.8 (2019-05-31)0.5.8 ChangelogUpdated packaged to mirror new cookiecutter template0.5.9 (2019-07-26)0.5.9 ChangelogUpdated 3rd party requirements.0.5.10 (2019-08-09)0.5.10 ChangelogUpdated 3rd party requirements.0.5.11 (2019-09-09)0.5.11 ChangelogUpdated 3rd party requirements.1.0.0 (2019-11-01)1.0.0 ChangelogFirst production release1.1.0 (2019-11-26)1.1.0 ChangelogUpdated character limit to comments/reviews1.2.0 (2020-01-24)1.2.0 ChangelogChanged comment fields to TextField
Package: django-user-activity-log2
This django app intended for writing HTTP log to database and/or watch last user activity.Features:DB router for writing logs to another database.Filters for ignoring some queries by URL, HTTP methods and response codes.Saving anonymous activity as fake user.Autocreation log DB (for postgresql)Install:$ pip install django-user-activity-log2settings.py:INSTALLED_APPS=(...'activity_log',)MIDDLEWARE_CLASSES=(...'activity_log.middleware.ActivityLogMiddleware',)# For writing log to another DBDATABASE_ROUTERS=['activity_log.router.DatabaseAppsRouter']DATABASE_APPS_MAPPING={'activity_log':'logs'}# If you set up DATABASE_APPS_MAPPING, but don't set related value in# DATABASES, it will created automatically using "default" DB settings# as example.DATABASES={'logs':{...},}# Create DB automatically (for postgres, and may be mysql).# We create log database automatically using raw SQL in pre_migrate signal.# You must insure, that DB user has permissions for creation databases.# Tested only for postgresqlACTIVITYLOG_AUTOCREATE_DB=False# App settings# Log anonymous actions?ACTIVITYLOG_ANONYMOUS=True# Update last activity datetime in user profile. Needs updates for user model.ACTIVITYLOG_LAST_ACTIVITY=True# Only this methods will be loggedACTIVITYLOG_METHODS=('POST','GET')# List of response statuses, which logged. By default - all logged.# Don't use with ACTIVITYLOG_EXCLUDE_STATUSESACTIVITYLOG_STATUSES=(200,)# List of response statuses, which ignores. Don't use with ACTIVITYLOG_STATUSES# ACTIVITYLOG_EXCLUDE_STATUSES = (302, )# URL substrings, which ignoresACTIVITYLOG_EXCLUDE_URLS=('/admin/activity_log/activitylog',)account/models.py:fromdjango.contrib.auth.modelsimportAbstractUserfromactivity_log.modelsimportUserMixin# Only for LAST_ACTIVITY = TrueclassUser(AbstractUser,UserMixin):pass$ python manage.py migrate & python manage.py migrate --database=logsIf you use ACTIVITYLOG_AUTOCREATE_DB migrations to logs database
will be run automatically.
Package: django-userapp
Django userapp integrationThis is a Django integration with Userapp.ioTo use this project your settings should containINSTALLED_APPS=[..."django_userapp"]AUTHENTICATION_BACKENDS=["django_userapp.backends.UserappBackend","django.contrib.auth.backends.ModelBackend"]USERAPP_ID="YOUR_USERAPP_ID"USERAPP_USE_FEATURES=True# if USERAPP_USE_FEATURES = True then# checks will happen againts USERAPP_FEATURE.value=true (enabled/disabled)USERAPP_FEATURES=["USERAPP_FEATURE"]# Will be taken when we have not set user email in Userapp# default untitled@email.comUSERAPP_DEFAULT_EMAIL="default@email.com"NoteAt Userapp.io you must set first name, last name, email fields for each
user. Emails should be unique and do not intersect with already existing
non-userapp emails.Django versionDjango>=1.7LinksSee for full api documentation of Userapp.TODOAdd more tests,Add more readme,Bring more Userapp features,Sync Userapp permissions and features
Package: django-user-assets
Allow users to create site assets with django adminDocumentationThe full documentation is athttps://django-user-assets.readthedocs.io.QuickstartInstall Django User Assets:pip install django-user-assetsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django.contrib.sites',...'user_assets.apps.UserAssetsConfig',...)FeaturesAdd different assets (script, style, e.t.c) to your site from admin panelPlace your assets to any place on page with Asset GroupsAttach your assets to specific sites from Django Sites FrameworkRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-11-16)First release on PyPI.
Package: django-user-auth-all
User Auth is a Django app to conduct web-based User Auth. For each question,
visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick start1. Dependency you have to install: pip install django-phonenumber-field djangorestframework djangorestframework-simplejwt phonenumbers django-rest-passwordreset Pillow
1. Add “User Auth” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_rest_passwordreset',
    'phonenumber_field',
    'user',

]Include the User Auth URLconf in your project urls.py like this:path('api/user/', include('user.urls')),Runpython manage.py migrateto create the User Auth models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a user (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/api/user/to participate in the user auth.all the url for particular action is given below,user registration, url:http://127.0.0.1:8000/api/user/users/, method: post, body:
login, url:http://127.0.0.1:8000/api/user/auth/, method: post, body: username,password
update profile ,http://127.0.0.1:8000/api/user/update_profile/, method: post
get user role,http://127.0.0.1:8000/api/user/user_role/, method: get
path(‘change_password/’,change_password),path(‘token/refresh/’, TokenRefreshView.as_view(), name=’token_refresh’),
path(‘password_reset/’, include(‘django_rest_passwordreset.urls’, namespace=’password_reset’)),