Saravanan666/pypi-org huggingface dataset:
Package: django-superuser
django-superuserAt some point in development you wish you were just automatically logged into
the django admin as a super user. This middleware lets you do just that. As you
probably understand this also poses a security risk. To minimize the chances of
this middleware automatically logging someone in as a super user in a
production environment you will need to take some extra steps when installing.InstallationFirst you need enter the middleware in your setting file, it needs to be at
some line after thedjango.contrib.auth.middleware.AuthenticationMiddleware::MIDDLEWARE = (
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'superuser.middleware.SuperUserMiddleware',
    ...
)You also need to have your IP listed inINTERNAL_IPS, for example::INTERNAL_IPS = ('127.0.0.1',)Lastly you need to make sureDEBUG = Truein your settings file for the middleware to work.NotesNote that the login page (usually/admin/login/) does not log you in
automatically as a super user, this is so that you can login as a different
user if you like.  If you want to be logged in as a super user, just navigate
to any other admin view, for example/admin/.Django version < 1.10If you are using Django version < 1.10 you need to use the old style middleware
classes and you need install django-supervisor version < 0.2.0. Please set up
middleware like this instead after the line:django.contrib.auth.middleware.AuthenticationMiddleware::MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'superuser.middleware.SuperUserMiddleware',
    ...
)
Package: django-support-form
# django-support-form[![Build Status](https://travis-ci.org/cbmi/django-support-form.png?branch=master)](https://travis-ci.org/cbmi/django-support-form)[![Coverage Status](https://coveralls.io/repos/cbmi/django-support-form/badge.png?branch=master)](https://coveralls.io/r/cbmi/django-support-form?branch=master)Simple contact/support form for Django apps.## Install```bashpip install django-support-form```## SetupAdd `supportform` to `INSTALLED_APPS` along with the following Django contrib apps:```pythonINSTALLED_APPS = ('supportform',...)```Include the `supportform.urls` in the the `ROOT_URLCONF`:```pythonfrom django.conf.urls import url, patterns, includeurlpatterns = patterns('',url(r'^support/', include('supportform.urls')),...)```## Settings- `SUPPORT_EMAIL` - The recipient email address the support email will be sent to, e.g. 'support@example.com'. Default is `DEFAULT_FROM_EMAIL` Django setting.- `SUPPORT_EMAIL_SUBJECT` - Default email subject prepopulated in the support form. Default is 'Support Message'.- `SUPPORT_WAIT_SEND` - Wait until the email successfully sends. If set to false, the email will be sent in the background (via a thread). Default `True`## TemplatesThe templates that come with the django-supportform are functional, but _very_ minimal:- `supportform/form.html` - Renders the support form omitting the email field is the user is logged in. On submission if the email fails to send, a fallback message will be display to send an email directly to `SUPPORT_EMAIL`.- Context received:- `form` - `SupportForm` instance- `supportform/success.html` - Renders a static success/thank you page. This is the page redirected to after successfully sending a message.- Context received: (none)An email template is also provided and can be customized as well:- `supportform/email_body.txt`- Context recieved:- `message` - Left by the user- `request` - Request object- `user` - If the message was left by an authenticated user
Package: django-surface-theme
django-surface-themeSurface theme is built on top ofDjango Dashboard Atlantis Dark.Surface Theme variablesDefine custom title inurls.py:admin.site.site_title = "Surface Security"Define side menu navigation items by adding the following variable insettings.py:SURFACE_MENU_ITEMS = [
    {'label': ('Organisation'), 'icon': 'fas fa-building', 'items':[
        {'name': 'auth.user'}
    ]},
    {'label': ('Organisation'), 'app_label': 'auth', 'icon': 'fas fa-building', 'items':[
        {'name': 'user', 'label': 'Custom Label'},
        {'url': 'https://example.com', 'url_blank': True, 'label': 'Custom URL'}
    ]},
]Define home links and items by adding the following variable insettings.py:SURFACE_LINKS_ITEMS = [
    {'label': ('Examples'), 'items':[
        {'url': 'https://example.com', 'url_blank': True, 'name': 'Example.com'}
    ]}
]
Package: django-survey-bot
django-survey-botA Survey Bot package developed using Django to create Bots and collect leadsInstallationdjango-survey-bot requires python3 to run.
1), install using pippip install django-survey-bot2), Add "survey_bot" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
        ...
        'survey_bot',
    ]3), Include the survey_bot URL conf in your project urls.py like this::path('survey-bot/', include('survey_bot.urls')),4), Runpython manage.py migrateto create the survey_bot models.5), Start the development server and visithttp://127.0.0.1:8000/survey-bot/to create a bot.
Package: django-surveys
A reusable Django app that lets users write feedback for any modelDocumentationThe full documentation is athttps://django-surveys.readthedocs.io.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistoryUnreleased1.1.0 (2018-06-04)Add support for Django 2.01.0.0 (2018-06-01)Drop support for Django <1.11 and Python <3.50.4.2 (2017-06-09)Addon_delete=models.CASCADEon foreign keys for Django 2.0Django 1.11 support0.4.1 (2017-05-09)[BUG]#16Fix package of the library to include all templates0.4.0 (2017-03-10)[FEATURE] Template tags to send rating related emailsRun tests against Django 1.11 and master[DOC] Added pull request template with basic checklist0.3.1 (2017-01-04)[BUG] Fix migration for replaceable foreign keyReview.user0.3.0 (2016-12-23)[IMPROVEMENT] Addedon_delete=models.CASCADEto all ForeignKeys,
it’ll become required in Django 2.0.[FEATURE] Addedcreatedandupdatedfields to all models using
theTimeStampedModelfromDjango model utils. generated 3
migrations to preserve the existingtimestampthat was present on
theReviewmodel.[DOC] Corrected links in Changelog0.2.0 (2016-12-23)#5[FEATURE] Ability to customise the reviewer model[IMPROVEMENT] Namespaced the app settings a la DRF0.1.1 (2016-12-23)#6[BUG] Fix error message when rating is out of bounds0.1.0 (2016-12-22)First release on PyPI.
Package: django-suspense
Django SuspenseDjango Suspense is small package to easily display a fallback in templates until children have finished loading.Quick start1. Install package:To get started, install the package frompypi:pipinstalldjango-suspenseNow you can addsuspenseto your django project. Change yourINSTALLED_APPSsetting like this:INSTALLED_APPS=[...,"suspense",]Optionally, you can specifysuspenseas builtins and this will be available in any of your templates without additionally specifying{% load suspense %}:TEMPLATES=[{"BACKEND":"django.template.backends.django.DjangoTemplates","DIRS":[BASE_DIR/"templates"],"APP_DIRS":True,"OPTIONS":{"context_processors":["django.template.context_processors.debug","django.template.context_processors.request","django.contrib.auth.context_processors.auth","django.contrib.messages.context_processors.messages",],"builtins":["suspense.templatetags.suspense"],},},]If you choose not use it as a built-in, you will need to add{% load suspense %}to the top of your template whenever you want to use suspense.2. Addsuspensetourls.py:This is necessary because some parts of the pages will be loaded asynchronously (via http).fromdjango.urlsimportinclude,pathurlpatterns=[...,path('/_suspense/',include('suspense.urls'))]3. Create view with slow lazy load object:Because django executes database queries lazily, they may sometimes not work as expected. Let's try to create a very slow but lazy object and write a view function:# app/views.pydefview(request):defobj():importtimei=0whilei<10:yieldii+=1time.sleep(1)returnrender(request,'template.html',{'obj':obj})4. Usesuspensein your template:Let's now add the output of the received data to the template. At this point, we still haven't made a database query, so we can easily and quickly show the template right away.{% load suspense %}<divclass="list">{% suspense %}
        {% fallback %}<divclass="skeleton">Loading ...</div>{% endfallback %}<ul>{% for data in obj %}<li>{{ data }}</li>{% endfor %}</ul>{% endsuspense %}</div>Once obj is ready for use, we will show it. But until it is ready, fallback works. While we are waiting for the data to be displayed, a request is made on the client side.5. Hooray! Everything is ready to use it.ContributingIf you would like to suggest a new feature, you can create an issue on the GitHub repository for this project.
Also you can fork the repository and submit a pull request with your changes.LicenseThis project is licensed under the MIT License. See the LICENSE file for more information.
Package: django-suuze-upload
=========django-suuze-upload=========|Build Status|django-suuze-upload is a simple app that allows you to get suuze private file upload servicesuptoken. Using this uptoken you can easily upload file with js-sdk in your project.============Requirements============* `Django <https://www.djangoproject.com/>`_ (1.9+)* `requests <http://docs.python-requests.org/en/master/>`_ (2.11.1+)============Installation============* Install ``django-suuze-upload`` (or `download from PyPI <>`_):.. code-block:: pythonpip install django-suuze-upload -i http://p.int.cdnzz.net:19883/simple/* Add ``django_suuze_upload`` to ``INSTALLED_APPS`` in ``settings.py``:.. code-block:: pythonINSTALLED_APPS = (# other apps"django_suuze_upload",)* Configure your queues in django's ``settings.py``.. code-block:: pythonSUUZE_UPLOAD_CONFIG = {# domain provide upload file service'domain': 'http://upload-file.cdnzz.com',# web app namn'app': 'upload-file-demo',# direction where holds uploaded file'path': 'app/upload',# access_key to generate uptoken'access_key': 'xxxxxxxx',# optional, in second, default is 1800# 'expire': 1800,}=====Usage=====Fetch uptoken in your project-------------------------`django-suuze-upload` allows you to upload file to suuze file store easily... code-block:: pythonfrom django.views import Viewfrom django_suuze_upload import fetch_uptokenfrom django_suuze_upload import is_uptoken_expirefrom django_suuze_upload import upload_fileclass Dome(View):def post(self, request):...uptoken = fetch_uptoken()['uptoken']....# some logic to process upload file .etc# check uptoken is expire or not# is_uptoken_expire(uptoken)file_object = request.FILES['filw']rv = upload_file(uptoken, file_object)....
Package: django-svg-icons
Django SVG Icons================Simple django templatetag to display `SVG` icons in your django application.Icon paths will loaded from a provided `JSON` file, formatted according the icomoon format.More info: [Icomoon website](http://icomoon.io/)Installation------------Installation from pypi via pippip install django-svg-iconsConfiguration-------------In your django project add `svg_icons` to your installed apps and set the `SVG_ICONS_SOURCE_FILE` setting to your source file.INSTALLED_APPS = [# ...'svg_icons',]SVG_ICONS_SOURCE_FILE = '/path/to/source_file.json'Usage-----In your templates you can load the templatetag and start including your icons.{% load svg_icons %}{% icon 'icon_name' %}The templatetag accepts some kwargs for icon configuration as well.- **size** for setting both width and height- **width** for only setting a specific width- **height** for only setting a specific height- **className** css classnames applied on the `<svg>` objectAll kwargs are optional, when not provided the deaults are used.{% icon 'icon_name' size=50 className="css classnames" %}Todo----- Write tests
Package: django-svg-image-form-field
A form field to handle validation of image + svgQuickstartInstall Django SVG Image Field:pip install django-svg-image-form-fieldModels:fromdjango.dbimportmodelsclassArticle(models.Model):title=models.CharField(max_length=100)image=models.ImageField(upload_to='images/articles')text=models.TextField()Forms:fromdjangoimportformsfrom.modelsimportArticlefromdjango_svg_image_form_fieldimportSvgAndImageFormFieldclassArticleForm(forms.ModelForm):classMeta:model=Articleexclude=[]field_classes={'image':SvgAndImageFormField,}Example usage:fromdjango.contribimportadminfrom.formsimportArticleFormfrom.modelsimportArticle@admin.register(Article)classSectionAdmin(admin.ModelAdmin):list_display='id','title'search_fields='title',form=ArticleFormCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2021-04-15)First release on PyPI.1.0.0 (2021-04-15)Stable version (tested on demo project).1.0.1 (2021-06-14)Fix when the input is the temporary file path instead the BytesIO (thanksfbuccioni).
Package: django-svg-templatetag
Inject a SVG file into your Django template.DocumentationThe full documentation is athttps://django-svg-templatetag.readthedocs.org.QuickstartInstall Django SVG templatetag:pip install django-svg-templatetagThen use it in a project:{% load svg %}FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory1.0.1 (2016-12-21)Fix open file not being closed, thanks to @leeuwr.1.0.0 (2016-08-09)First release on PyPI.
Package: django-svnlit
A Subversion browser forDjangothat can track and display the
contents multiple repositories.ContentsInstallationSettingsSVNLIT_CLIENT_TIMEOUTSVNLIT_CACHE_TIMEOUTSVNLIT_SVN_CONFIG_PATHSVNLIT_CHANGESETS_PER_PAGESVNLIT_AUTO_SYNCSVNLIT_SYNC_INTERVALManagement commandsThesvnaddcommandThesvnsynccommandThesvncleancommandInstallationUsing svnlit in your Django siteOnce you’ve installed the svnlit source into your Python site
environment:Put'svnlit'in yourINSTALLED_APPSsetting.Run the commandmanage.py syncdb.Add Subversion repositories either through the Django
admin application or through the svnlit management commandmanage.py svnadd.SettingsSome of the application’s behaviour can be configured by adding the
appropriate settings to your project’s settings file.The following settings are available:SVNLIT_CLIENT_TIMEOUTDefault:20Amount of time in seconds to allow a prolongedpysvnAPI call
before cancelling.SVNLIT_CACHE_TIMEOUTDefault:86400Amount of time in seconds to retained data cached by svnlit.SVNLIT_SVN_CONFIG_PATHDefault:NoneOptionally specify a subversion config file that can be passed topysvn.Client.SVNLIT_CHANGESETS_PER_PAGEDefault:50Number of changesets to display on the changeset list view.SVNLIT_AUTO_SYNCDefault:TrueIf this setting is enabled, svnlit will sync repositories’
changesets’ on most views. How often the syncing happens when a view
is served depends on theSVNLIT_SYNC_INTERVALsetting.SVNLIT_SYNC_INTERVALDefault:60WhenSVNLIT_AUTO_SYNCis set toTrue, this setting controls
how often the syncing happens. Every time a view is served, the time
elapsed since the last sync is checked. If it has exceeded the number
of seconds specified by this setting, svnlit will sync the
changesets of the repository being viewed.Management commandssvnlit comes with some commands you can use withmanage.py.ThesvnaddcommandAdd a repository. Thelabelis the name of the repository to be
used in the URLs. Therootargument is the repository URI, such asfile:///var/svn/myrepositoryorsvn://code.example.com/myrepository.
The command has several additional options. See details by runningmanage.py help svnadd.ThesvnsynccommandGet repository changes. If no arguments are specified, all
repositories tracked by svnlit are synced. Alternately you can specify
individual repositories by passing their labels as arguments.ThesvncleancommandClean up expired cache data generated by svnlit. This command can be
used as a job in a crontab.
Package: django-swagger
.. Django Swagger documentation master file, created bysphinx-quickstart on Sat Oct 19 12:30:34 2013.You can adapt this file completely to your liking, but it should at leastcontain the root `toctree` directive.Django Swagger's Documentation==============================Contents:.. toctree:::maxdepth: 4Indices and tables==================* :ref:`genindex`* :ref:`modindex`* :ref:`search`
Package: django-swagger-render
Django Swagger RenderGetting StartedPrerequisitespython >= 3.5Django >= 2.0InstallationInstall using pippip install django-swagger-renderAdd 'swagger_render' to your INSTALLED_APPS setting.INSTALLED_APPS = [
    ...
    'swagger_render',
]Create the folder where you will store your documentationmkdir docsCreate theindex.ymlfile with someOPENAPIorSwaggerspecificationstouch docs/index.ymlServe your documentation filesurlpatterns += static('/docs/', document_root='docs')AddSWAGGER_YAML_FILENAMEsetting to yoursettings.pySWAGGER_YAML_FILENAME = '/docs/index.yml'Add theSwaggerUIViewto your urlsfrom swagger_render.views import SwaggerUIView


urlpatterns = [
    ...
    path('swagger/', SwaggerUIView.as_view()),
]Voila!
Package: django-swagger-ui
Django swagger UI is a viewer for Swagger YAML files as html.  based onswagger-yaml-to-html.py.Quick startAdd “swagger_ui” to yourINSTALLED_APPSsetting like this:INSTALLED_APPS = [
    ...
    'swagger_ui',
    ...
]Include the swagger ui URLconf in your projecturls.pylike this:path('', include('swagger_ui.urls')),Add this variableSWAGGER_YAML_FILEtosettings.pypointing to your YAML fileYou will find the swagger api documentation in/api-doc/.
Package: django-swapfield
django-swapfield
================Easy! When you use django-swapfield if the value is saved in other
record, values are swapped! You can configure whatconditions must be repeated in both records to make the change.How to~~~~ {.sourceCode .bash}$ pip install django-swapfield$ # Define a SwapIntegerField in your model with unique_for_fields
param (fields coincidence to can swap values)$ # That SwapIntegerField can’t be a part of unique_together or
unique restriction.~~~~Uses e.g.Uniform number in sport team.Race number in an athletic competition.Any scenario when you want to swap values without reordering.example~~~~ {.sourceCode .bash}from swapfield.fields import SwapIntegerFieldclass Player(models.Model):name = models.CharField(max_length=30)team = models.ForeignKey(Team)number = SwapIntegerField(unique_for_fields=[‘team’])# can swap “number” if “team” has the same value~~~~Available fieldsSwapIntegerFieldMethodCurrent status allow swap values if not exists
unique/unique_together restriction. First, get the registry (if
exists)
what contains the new value to assign it the old value from registry
what currently is saving. When current registry is
saved, replace the other registry with old value.In next versions, other method will be used when exists
unique/unique_together restriction.to-do list[ ] Two or more django-swapfield in the same object.[ ] Alternative method when exists unique/unique_together
restriction[ ] Friendly validation error with Django Admin (no Fatal error)[ ] Abstract django-swap-field[ ] SwapCharField[x] Tests for functionality[ ] Tests for migrations[ ] Config setting to choose swap value when a new record (not
edited) get a value that exists in database: choose the
max value +1 or the first available.
Package: django-swappable-tasks
Django swappable tasksIntroductionConsidering you have a django project running on different servers each with its own asynchronous tasks handler this project helps you have one way to process the tasks while converting to the respective handler in the background. Currently Google Cloud Tasks and Celery are supported.Code SamplesTo set up you will need to add the following to your settings.py fileDEFAULT_ASYNC_TASKS_HANDLER = env('DEFAULT_ASYNC_TASKS_HANDLER')This can either beCELERYorGOOGLE_CLOUD_TASKS.If you are using celery remember to set up other settings such asCELERY_BROKER_URL,CELERY_RESULT_BACKEND,CELERY_ACCEPT_CONTENT,CELERY_TASK_SERIALIZER,CELERY_RESULT_SERIALIZER,CELERY_TIMEZONEFor google cloud tasks remember to set up the following settingsGOOGLE_CLOUD_PROJECT_ID,GOOGLE_CLOUD_TASKS_LOCATION_NAME,GOOGLE_APPLICATION_CREDENTIALSAdd the view to your projects urls.py file as belowfrom django.urls import path, include
urlpatterns = [
          ...
          path('tasks/', include('django_swappable_tasks.urls')),    
          ...    
]Assume you have a task as belowfrom myproject.celery_app import app

@app.task
def my_blocking_task(name, age):
      import time
      import random
      sleep_seconds = random.randint(20, 45)
      time.sleep(sleep_seconds)
      print("Hello {}, your age is {}".format(name, age)To process a task asynchronously do it as belowfrom django_swappable_tasks.utils import process_task_asynchronously
from my project.tasks import my_blocking_task
task_kwargs = {"name": "John Doe", "age" : 18}
process_task_asynchronously(my_blocking_task, "google_default_queue", task_args=[], task_kwargs= task_kwargs)InstallationTo install the package dopip install django_swappable_tasksYou can also directly install fromThe GitHub Repository
Package: django-sweet-autocomplete
Django Sweet AutocompleteThe purpose of Sweet Autocomplete is to simplify autocomplete
functionalities implementation in your Django project.Quick startAdd "sweetautocomplete" to your INSTALLED_APPS setting::INSTALLED_APPS=[...'sweetautocomplete',]Include the autocomplete URLconf in your projecturls.py:urlpatterns=[...path("",include("sweetautocomplete.urls")),...]Create a file calledautocomplete.pyin your app:fromsweetautocomplete.autocompleteimportautocompletefactory,AbstractAutocompletefrom.modelsimportMyModelclassMyModelAutocomplete(AbstractAutocomplete):model=MyModelfield="field_name"classSerializer(serializers.ModelSerializer):label=serializers.CharField(source="field_name")classMeta:model=MyModelfields=["label"]autocompletefactory.register("model_name",MyModelAutocomplete)Use autocomplete endpoints in your templates:"{% url 'autocomplete' 'model_name' %}?query=..."
Package: django-sweetcaptcha
Django SweetCAptcha================**Django SweetCaptcha form field/widget integration app.**django-sweetcaptcha provides a form field to integrate the `sweetCaptcha <http://www.sweetcaptcha.com/>`_ service.Installation------------#. Install or add ``django-sweetcaptcha`` to your Python path.#. Add ``sweetcaptcha`` to your ``INSTALLED_APPS`` setting.#. Register your sweetCaptcha account `here <http://www.sweetcaptcha.com/accounts/signup>`_.#. Add ``SWEETCAPTCHA_APP_ID`` and ``SWEETCAPTCHA_APP_KEY`` settings to the project's ``settings.py`` file. These settings are provided by the previous step.Usage-----Field~~~~~The quickest way to add sweetcaptcha to a form is to use the included ``SweetCaptchaField`` field type. A ``SweetCaptcha`` widget will be rendered with the field validating itself without any further action required from you. For example:.. code-block:: pythonfrom django import formsfrom sweetcaptcha.fields import SweetCaptchaFieldclass FormWithCaptcha(forms.Form):sweetcaptcha = SweetCaptchaField()To allow for runtime specification of keys:.. code-block:: pythonsweetcaptcha = SweetCaptchaField(app_id='your_app_id_here',app_key='your_key_here')If specified these parameters will be used instead the ones specified in your project settings.Credits-------``client.py`` taken from `sweetcaptcha <https://pypi.python.org/pypi/sweetcaptcha>`_ by Jaime Wyant.Thanks to `sweetcaptcha <http://www.sweetcaptcha.com/>`_
Package: djangosweet-jwt
OverviewThis package provides JSON Web Token Authentication support for
Django REST framework.RequirementsPython (2.7, 3+)Django (1.8, 1.9, 1.10, 1.11, 2+)Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6, +)InstallationInstall usingpip…$pipinstalldjangosweet-jwtCredit tojpadilla author of djangorestframework-jwt