Saravanan666/pypi-org huggingface dataset:
Package: django-gov
This can be used as a base to build MoJ Django applications. It includes some useful Django packages along with the Gov.uk template. It also includes flake8 code style test.IncludesDjangodjango-cors-headersdjango-extended-choicesdjango-filterdjango-moj-iratdjango-rest-swaggerdjangorestframeworkflake8openpyxlPyYAMrequestsDependenciesPython 3.5(can be installed usingbrew install python3)InstallationInstall via pypipip install django-govFeaturesgovuk_template Django template and static directory are included in the package. You can extend the GovUK Template directly{% extends 'govuk_template/base.html' %}You can also download the latest govuk_template taball and extract the contentents to a directory of you choice./manage.py update_gov_template -d /path/to/directory/to/unpack/This will add the templates and static directories from the latest release of govuk_template to the directory passed as -dYou can include the default settings for all the included apps above by including the default settings in your app settings.py filefrom django_gov.settings import *You can include the urls for the healthcheck endpointsurl(r'^', include('django_gov.urls'))TestingIf you include the whole default settings, this will add flake8 code style tests to the directory you run your apps.You can add asetup.cfgfile containing your flake8 settings to the base directory of your app.[flake8]
exclude = .git/,env/,venv/,node_modules/, manage.py
max-complexity = 10
max-line-length = 120API Docsdjango-rest-swagger is also included. The template has been modified to use the govuk_template as a base.seehttps://github.com/marcgibbons/django-rest-swaggerfor instructions on how to set up SwaggerHistory0.2.0 (2017-04-05)Update govuk template to 0.19.2.0.1.2 (2016-12-05)Add flake8 tests to READEME.0.1.1 (2016-11-18)Update READEME and HISTORY.0.1.0 (2016-11-17)First release on PyPI.
Package: django-govuk-forms
This library has not yet been updated to use the newDesign systemIt should be easy to make a Django-based service that follows Government Digital Services’ style guide and reference materials.This Django app allows forms to be output using the HTML that can be styled using GOV.UK elements.
The styles themselves are provided by another package[1].NB: Until version 1.0, there is likely going to be a lot of variation in the api, so it’s a good idea to pin a specific minor version.UsageInstalldjango-govuk-formsordjango-govuk-template[forms]Addgovuk_formstoINSTALLED_APPSInherit forms fromgovuk_forms.forms.GOVUKFormand use widgets fromgovuk_forms.widgetsSee the demo folder in this repository onGitHub, it is not included in distributions.DevelopmentPlease report bugs and open pull requests onGitHub.Usepython setup.py testto run all tests.This repository does not need to be updated for every release of GDS’s packages, only breaking changes for overridden components may need fixes.If any localisable strings change, runpython setup.py makemessages compilemessages.Distribute a new version toPyPiby updating theVERSIONtuple ingovuk_formsand runpython setup.py compilemessages sdist bdist_wheel upload.To doIs HTML creation mechanic good?CopyrightCopyright (C) 2018 HM Government (Ministry of Justice Digital Services).
See LICENSE.txt for further details.[1]https://github.com/ministryofjustice/django-govuk-template
Package: django-gp-auth
=====GP Auth=====GP Auth is a simple application Django to manage the registrationof users in a customized manner system.To customize the user account just inherit the GP Auth.Detailed documentation is in the "docs" directory.Quick start-----------1. Add "gpauth" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'gpauth',]2. Include GP Auth User Model your settings.py project like this ::AUTH_USER_MODEL = 'gpauth.User'3. Run `python manage.py migrate` to create the gp_auth models.4. Run `python manage.py createsuperuser` to create a Super User.5. Start the development server and visit http://127.0.0.1:8000/gpauth/to create a users (you'll need the Admin app enabled).
Package: django-gpg
#+TITLE: Django GPG[[https://travis-ci.org/arecker/reckerops][file:https://travis-ci.org/arecker/django-gpg.svg?branch=master]]A GPG implementation for Django.* Quick Start1. Install the =django-gpg= package#+BEGIN_SRC shgit clone https://github.com/arecker/django-gpg.git && cd django-gpgpython setup.py install#+END_SRC2. Add "django_gpg" to your INSTALLED_APPS setting#+BEGIN_SRC pythonINSTALLED_APPS = [# ...'django_gpg',]#+END_SRC3. Install [[https://www.gnupg.org/download/index.en.html][GnuPG]] on your system (e.g. =apt-get install gnupg=)4. Run =python manage.py migrate= to create the new models* ConfigurationInclude these settings in your =settings.py= to customize django-gpg.Or just leave this out entirely to use the defaults shown here.#+BEGIN_SRC pythondjango_gpg = {# Require a public key for each user'PUBLIC_KEY_REQUIRED': True}#+END_SRC* ModelsEach user will now have an associated GPG Profile.  You can add publickeys via the django admin.[[file:screenshots/admin.png]]You can encrypt messages using the model method.#+BEGIN_SRC pythonfriend = User.objects.first()secret = me.gpgprofile.encrypt('HOOCHIE MAMA')print(secret.split('\n'))['-----BEGIN PGP MESSAGE-----','','hQIMA2DlyYO6tqUPARAAjOUCQZQR4TXwQhxa7x6BcrnGkrwu4iYk5T/6BqHce0Gu','81GBVwm04e2ptHO680y1jFqipdx8YLhP2wIjUurVDvEoLLOz/ILsFh8t3vvEGzJj','NN8GR/OqiYcf66Qr/FnfPvd1+KX0zRy3LC96ovGUp1SVGHvniAW8Er20sQ8lLOvs','MCGH7oIwhGcnE7CeR6RuqPNz2IKCquq6yV3wDffBiuglVAu21woh7FL3UIG2T/Sc','YM9Yn9PIY5P4fdVv3X+6f3LL7chbRmGtttw/9UYt4QgVDouUu5NR5H8ZZ1waqfbs','E0aMn93JYMIVEW3uICyNhfLMBbuJS/a/XGwCc18/j5n6Mst+PAljjQD70V9rCYqZ','LorX/3+lx02GSwdg6Yrz/0wndh2iDx7CEEn1vo0MSF6VV7stjhaOngRFFVhUlV2E','dPNZceVk8mqS/TUQL4Rvp8U6jTB+c8vA3ofS6nYl8AGH9Khd21VEIxzgCk2kkREN','Wknj3r6HUROAhewPrX+oGA/TFkiX1XSlOGP2fUnV09wCVJUPaIl0fWv6CcAH0gZ4','gQNeQnKZTMuRg++f7K+RkXIt9p1xkBd2c3kS24LVin6/G8lY6n68Y02GRJHvq1of','yNvhiufy+Tmu30dwmjPjB+9CnD4QCTvvI7ML3H1cJ62nCjSVKqa1M20+7p6urPrS','RwE7dQd3EInA55CBWJZ4HfPmqEnScwoBO4WC3xqL+CGXlI66L70+IebnVYDncTJX','6h58GjoXS4JJdghP48VZtG5TG+XOsYSs','=inGo','-----END PGP MESSAGE-----','']#+END_SRCUse queryset methods to encrypt a message for multiple users.#+BEGIN_SRC pythonfrom django_gpg.models import GpgProfilemessage = GpgProfile.objects.filter(user=[...]).encrypt('hoochie mama')#+END_SRC
Package: django-gql
Django Graphqlgqlgengqlgen is a generator tool for GraphQL.Usage:gqlgen[OPTIONS]COMMAND[ARGS]...

Options:--helpShowthismessageandexit.

Commands:allGenerateallschematypesfield-resolverGeneratefieldresolver.typeGenerateonetypetype-resolverGenerateallschematypesHow to use# urls.pyfromdjango.contribimportadminfromdjango.urlsimportpathfromdjgql.viewsimportGraphQLViewurlpatterns=[path('admin/',admin.site.urls),path('graphql/',GraphQLView.as_view())]# utils.pydefcontext_builder():return{'version':1}# settings.pyMIDDLEWARE=['django.middleware.security.SecurityMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware','djgql.auth.middleware.BasicAuthMiddleware',]GRAPHQL_SCHEMA_FILE=os.path.join(BASE_DIR,'starwar.gql')GRAPHQL={'SCHEMA':'starwar.schema.schema','ENABLE_PLAYGROUND':True,'CONTEXT_BUILDER':'starwar.utils.context_builder}importtypingfromenumimportEnumfromdjango.confimportsettingsfromgqlimportquery,gql,type_resolver,enum_type,field_resolverfromgql.build_schemaimportbuild_schema_from_filefromdjgql.authimportlogin_requiredfrompydanticimportBaseModeltype_defs=gql("""type Query {hello(name: String!): String!}""")@enum_typeclassEpisode(Enum):NEWHOPE=1EMPIRE=2JEDI=3classCharacter(BaseModel):id:typing.Textname:typing.Optional[typing.Text]friends:typing.Optional[typing.List[typing.Optional['Character']]]appears_in:typing.Optional[typing.List[typing.Optional[Episode]]]classHuman(Character):id:typing.Textname:typing.Optional[typing.Text]friends:typing.Optional[typing.List[typing.Optional[Character]]]appears_in:typing.Optional[typing.List[typing.Optional[Episode]]]home_planet:typing.Optional[typing.Text]classDroid(Character):id:typing.Textname:typing.Optional[typing.Text]friends:typing.Optional[typing.List[typing.Optional[Character]]]appears_in:typing.Optional[typing.List[typing.Optional[Episode]]]primary_function:typing.Optional[typing.Text]@query@login_requireddefhero(parent,info,episode:typing.Optional[Episode])->typing.Optional[Character]:request=info.context['request']print(request.user)returnHuman(id='test')@field_resolver('Human','name')defhuman_name(parent,info):return'Jack'@type_resolver('Character')defresolve_character_type(obj,info,type_):ifisinstance(obj,Human):return'Human'ifisinstance(obj,Droid):return'Droid'returnNoneschema=build_schema_from_file(settings.GRAPHQL_SCHEMA_FILE)
Package: django-graceful-session-cleanup
A simple management command that can delete expired sessions from large session tables without killing the site.The main use case is if you have a live application with millions of stale sessions in the database. Runnung the
regularpython manage.py cleanupwill potentially lock your database for hours, essentially killing your site.Withdjango-graceful-session-cleanupyou can gradually delete all the sessions.To achieve this it will always only delete a small amount of the expired sessions per query and then sleep for
a few seconds. There are commandline options to control interval, sleep time and amount of sessions to delete
per interval.Installationinstall the package:pip install django-graceful-session-cleanupadd it toINSTALLED_APPS:INSTALLED_APPS = [
    ....
    'graceful_session_cleanup',
]run the management command:python manage.py graceful_session_cleanupThere are a few options you can use:python manage.py graceful_session_cleanup --sleep-seconds 9 --delete-count 1000 --iteration-count 200This will delete1000expired session entries, wait for5seconds so other processes can use the
database and then repeat this200times. Depending on database load (assuming deleting takes1s) this
will take(9s + 1s) * 200 = 2000s.there is help on the commandline:$ python manage.py help graceful_session_cleanup
Usage: django graceful_session_cleanup [options]

Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment). Does this in a live db friendly way by never hogging the connection too long.

Options:
  -v VERBOSITY, --verbosity=VERBOSITY
                        Verbosity level; 0=minimal output, 1=normal output,
                        2=all output
  --settings=SETTINGS   The Python path to a settings module, e.g.
                        "myproject.settings.main". If this isn't provided, the
                        DJANGO_SETTINGS_MODULE environment variable will be
                        used.
  --pythonpath=PYTHONPATH
                        A directory to add to the Python path, e.g.
                        "/home/djangoprojects/myproject".
  --traceback           Print traceback on exception
  -s SLEEP_SECONDS, --sleep-seconds=SLEEP_SECONDS
                        How long to sleep between each delete operation.
  -c DELETE_COUNT, --delete-count=DELETE_COUNT
                        How many expired sessions to delete per iteration.
  -i ITERATION_COUNT, --iteration-count=ITERATION_COUNT
                        How many iterations to run.
  --version             show program's version number and exit
  -h, --help            show this help message and exit
Package: django-grafico-db
====django-grafico-db====Para poder ejecutar la aplicacion deberas instalar django-extensions y grafico-dben INSTALLED_APPS en tu archivo settings.pyINSTALLED_APPS = (...'django_extensions','grafico-db',...)Escribe el siguiente codigo en settings.pyGRAPH_MODELS = {'all_applications': True,'group_models': True,}Incluye la url de la aplicacion en tu archivo urls.pyurl(r'^myblog/', include('grafico_db.urls'))
Package: django-grains
This reusable Django app lets you
store snippets of text (“grains”) in the database
keyed by arbitrary strings.
It’s the same idea implemented previously
indjango-chunks,django-flatblocks,django-tinycontentandothers.UsageInstall withpip installdjango-grains.AddgrainstoINSTALLED_APPSin your project’s Django settings.Runmanage.py syncdbormanage.py migrate(if you’re using South)
to create the database tables.In your templates, create placeholders for grains:{% load grains_tags %}

{% grain "front-page-title" %}The default title of the front page{% endgrain %}

{% grain "front-page-subtitle" "text/plain" %}The default subtitle of the front page{% endgrain %}

{% grain "front-page-content" "text/html" %}
    <p>This is the default HTML content of the front page.</p>
{% endgrain %}The first argument to{% grain %}is the unique identifier of the grain.
The second argument is the content type
which could be used to choose the editor widget for the value
in Django’s admin interface.
The second argument can be omitted in which case it defaults totext/plain.A WYSIWYG editor is automatically used in the admin interface
for grains with thetext/htmlcontent type,
if you havedjango-wysiwyginstalled and added toINSTALLED_APPS.
Package: django-grainy
django-grainyGranular permissions for djangoSupported Django VersionsDjango 3.2Django 4.0Django 4.2Documentationhttps://20c.github.io/django-grainyLicenseCopyright 2019-2023 20C, LLCLicensed under the Apache License, Version 2.0 (the "License");
you may not use this softare except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: django-granular-access
Granular access is django app for giving permissions on set of models for users
or groups.Quick startAdd “granular_access” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'granular_access',
)Run south command for createing tables in database:./manage.py migrate granular_access3. Create permission for user or group on some set of models via admin or usingcreate_permissionfunction:>>> from granular_settings import create_permission
>>> create_permission(user=joker, action='kill_and_rob', app_label='auth',
...     model_name='user', conditions=[{'username__startswith': 'victim'}])You can find more examples in tests.Filter available models using filter_available function:>>> from granular_settings import filter_available
>>> available_users = filter_available(to=joker, action='kill_and_rob',
...     queryset=User.objects.all())Profit.SettingsYou can define some settings for customize app behaviour:GRANULAR_ACCESS_USER_MODEL – user model in your project for assigning
permissions.Example: ‘users.Profile’.
Default: ‘auth.User’.GRANULAR_ACCESS_GROUP_MODEL – group model in your project for assigning
permissions.Example: ‘groups.UserGroup’.
Default: ‘auth.Group’.GRANULAR_ACCESS_USER_GROUP_RELATED_NAME – related name in user model for
relatinon with groups. So you can get user groups by calling
>>> user_instance.related_name.all()It will be used if GRANULAR_ACCESS_GET_USER_GROUPS_FUNCTION settings is not
set or set to None.Example: ‘user_groups’.
Default: ‘groups’.GRANULAR_ACCESS_GET_USER_GROUPS_FUNCTION – path to function, witch receives
user instance as first argument and return iterable with groups or group
ids. You can use this function if you have more complex logic for gettings
user groups, than via related_name.Example: ‘project_name.users_app.helpers.get_user_groups’.
Default: None.GRANULAR_ACCESS_CONSIDER_SUPERUSER – boolean value, which indicates should
superusers get all permissions on all models or not.Default: True.ExtrasYou can use AccessManager in your model:from granular_access import AccessManager

class MyModel(models.Model):
    objects = AccessManager()Or if you already have some special manager for your model, you can use
AccessManagerMixin in it.ALso you can utilize AccessQuerySet or AccessQuerySetMixin.
Package: django-grapesjs
django_grapesjsA small library allows you to integrate the page builder “grapesjs” into django adminInstallpipinstalldjango_grapesjsThen add it to your INSTALLED_APPS:INSTALLED_APPS=('django_grapesjs',...'django.contrib.admin',)To work with the “template_choices”, need to add a url-template in the urls.py fileurlpatterns=[path('get_template/',GetTemplate.as_view(),name='dgjs_get_template'),]UsingJust import the field and add to your modelfromdjango.dbimportmodelsfromdjango_grapesjs.modelsimportGrapesJsHtmlFieldclassExampleModel(models.Model):html=GrapesJsHtmlField()...# default_html - path to the html file to display the default value# for the field when the form page is receivedhtml=GrapesJsHtmlField(default_html='default.html')# or default - if the page is simply statichtml=GrapesJsHtmlField(default=render_to_string('default.html'))...# use the redactor_config argument to select the configuration of the editor# Available:#     - redactor_config='base' - basic setting, most widgets are used#     - redactor_config='min' - minimum setting, only the most necessaryhtml=GrapesJsHtmlField(redactor_config='base')...# use apply_django_tag = True, if you want to apply render django or jinja tagshtml=GrapesJsHtmlField(default_html='default.html',apply_django_tag=True)...# use template_choices to select multiple templateshtml=GrapesJsHtmlField(template_choices=(('django_grapesjs/default.html','default'),))And then inherit “GrapesJsAdminMixin”, in the admin class of the current modelfromdjango.contribimportadminfromdjango_grapesjs.adminimportGrapesJsAdminMixin@admin.register(ExampleModel)classExampleAdmin(GrapesJsAdminMixin,admin.ModelAdmin):passYou can use special tags in your templates, for flexible customization<ignore></ignore>If you need to comment out some of the html code during the save,
but execute or display at the time editing in page builder - use this tag.
For example, if your template that uses django or jinja tags does not have any styles or javascript
(because they are in another place, for example, in “footer.html”), you can put css and js in this
tag, styles and javascript code in the editor will work, but when saved and used on the site there
will not be repeating fragments<hidden></hidden>If you are editing in the editor with apply_django_tag, you might be distracted by the additional:
{% exclude %}, {% include %}, {% for <expression> %}, etc; - use this tag. He temporarily hides
information, embedded in it during editing, and during the save returns to the original formCustom Settings# True if you want to save html and cssGRAPESJS_SAVE_CSS=False# default value# use the value of the field from the db - True, or use the global save editorGRAPESJS_DEFAULT_MODELS_DATA=True# default value# redefine the path to the html file, the markup from this file will be used by defaultGRAPESJS_DEFAULT_HTML='django_grapesjs/default.html'# default value# Add or redefine the configuration of the editorREDACTOR_CONFIG={'base':'django_grapesjs/redactor_config/base.html'}# default valueWarningthe library does not work in “inlines”Referencegrapesjs
Package: django-graph-api
This is an implementation ofGraphQLinPython, designed to work with theDjangoweb framework. The project began atDjangoCon US 2017.Why Django Graph API?We see GraphQL as a promising alternative to REST.In order to increase its usage amongst Python developers, we are trying to create a library that stays up to date with the GraphQL specs and that embraces all of the things we love about Python:simple, readable, and elegantgreat documentationsupportive open-source communityContributingWe welcome contributions to this project!
Check thecontribution guidelinesfor detailed information on how to contribute, including how to get up and running and submitting your changes.Code of conductThis project adheres to and supports theDjango Code of Conduct.Style guideThis project uses theDjango coding style guide.DocumentationYou can find thefull documentationfor Django Graph API on ReadTheDocs.
Package: django-graph-auth
django-graph-auth=======================django-graph-auth is a Django application which provides simple mutations and queries for managing users with GraphQL. It can register users, log in, reset users, and expose `JSON web tokens`_.Documentation can be found on `GitHub`_... _Django Rest Framework: http://www.django-rest-framework.org/.. _JSON web tokens: http://getblimp.github.io/django-rest-framework-jwt/.. _GitHub: https://github.com/morgante/django-graph-auth/blob/master/docs/api.mdRequirements------------This has only been tested with:* Python: 3.5* Django: 1.10Setup-----Install from **pip**:.. code-block:: shpip install django-graph-authand then add it to your installed apps:.. code-block:: pythonINSTALLED_APPS = (...'graph_auth',...)You will also need to edit your base schema to import the mutations and queries, like this:.. code-block:: pythonimport graphenefrom graphene import relay, ObjectTypeimport graph_auth.schemaclass Query(graph_auth.schema.Query, ObjectType):node = relay.Node.Field()class Mutation(graph_auth.schema.Mutation, ObjectType):passschema = graphene.Schema(query=Query, mutation=Mutation)Credits-------``django-graph-auth`` was created by Morgante Pell (`@morgante<https://github.com/morgante>`_). It is based on `django-rest-auth`_... _django-rest-auth: https://github.com/Tivix/django-rest-authHistory=======Pending-------* New release notes go here.0.3.1 (2016-11-13)-----------------* Add installation dependencies. (https://github.com/morgante/django-graph-auth/pull/2)0.3.0 (2016-10-16)-----------------* Add user changing functionality.0.0.1 (2016-10-10)-----------------* Initial release
Package: django-graphene-authentication
IntroductionCustomizable backend that uses graphql to authenticate users.
Abstraction of a graphql authentication mechanism.
This is an modification ofdjango-graphql-jwt: I drop some functionalities that I did not care
and add capabilities that I needed.Capabilities dropped:cookies;Capabilities added:custom names and exceptions for authentication graphql mutrations/queries (needed for federations);ability to customize authentication mechanism;ability to work with graphene-federations when there are multiple authentication mechanisms;ability to be easily extended;MotivationI needed to work with graphene federations wehere there werre multiple graphqlk mutations with names like
“login”, “me”, “refresdh_tokens” and so on.django-graphql-jwtwas more an hindrance than anything else since I need to authenticate via
a token rather tha username and password. In the end I ported the feature I needed fromdjango-graphql-jwtand created this variant.This apps does not rely on its oiwn authentication mechanism, but just relay all the information
it knows about the graphql request to the auithentication backend. In this wayyouare in charge
to perform authentication.Still, the package provides some standard authentication mechanism you can use.Installationpip install django-graphql-apitokenConfigurationYou need to add this app to the INSTALLED_APPS:INSTALLED_APPS += "django_graphql_apitoken"The second step is to create the authentication classes that graphene needs to be aware of.
Create a new file in your project root and add the following:
Package: django-graphene-crud-generator
IntroductionThis package allows you to generate CRUD operation in a compact way.
It is extensible but has sane default (at leastfor my project :] ).This library isnota django application, although it works with it.Installationpip install django-graphene-crud-generatorUsageTLDRdffGuideThe project is basically a factory that generates graphene types repersenting queries and mutations.
Each step of the generation process is extensible.