Saravanan666/pypi-org huggingface dataset:
Package: django-sticky-uploads
django-sticky-uploads is a progressively enhanced file input widget for Django
which uploads the file in the background and also retains value on form errors.Requirements/Installingdjango-sticky-uploads requires requires Django 1.11 or 2.0, and a Python
that is supported by the chosen version of Django.The easiest way to install django-sticky-uploads is usingpip:pip install django-sticky-uploadsBrowser SupportThis project makes use ofprogressive enhancementmeaning that while all browsers are supported, they will not all have the same user-experience. If
the browser does not support the necessary client-side features then it will fall back to the
default file upload behavior.The primary HTML5 dependencies areFile APIandXHR2meaning that the following desktop/mobile browsers should get the enhanced
experience:Chrome 13+Firefox 4+Internet Explorer 10+Safari 6+Opera 12+iOS Safari 6+Android Brower 3+Blackberry Broswer 10+Opera Mobile 12+Chrome for Android 27+Firefox for Android 22+DocumentationAdditional documentation on using django-sticky-uploads is available onRead The Docs.Running the TestsYou can run the tests with via:tox(Possibly after installingtoxwithpip install toxor alternative.)Licensedjango-sticky-uploads is released under the BSD License. See theLICENSEfile for more details.ContributingIf you think you’ve found a bug or are interested in contributing to this project
check outdjango-sticky-uploads on Github.Development sponsored byCaktus Consulting Group, LLC.
Package: django-stisla
Django Stisla is a Bootstrap 4 based admin template for Django admin interface developed using thestislafree bootstrap admin template.InstallationInstall the package from PyPi:pip install django-stislaQuick startAdd “django_stisla.apps.admin” and “widget_tweaks” with “django.contrib.admin” & “django.contrib.auth” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_stisla',
    'django.contrib.admin',
    'django.contrib.auth',
    ...
    'widget_tweaks'
]Make sure django.template.context_processors.request is enabled in project settings.py:TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
                ...
            ],
        },
    },
]Include the admin URLconf in your project urls.py like this:...
from django_stisla import admin
...
urlpatterns = [
    ...
    path('admin/', admin.site.urls),
    ...
]You can set following theme configurations in URLconf:...
admin.site.site_header = "Django administration"
admin.site.site_title = "Django site admin"
admin.site.index_title = "Site administration"
admin.site.site_short_title = "DJ"
...Start the development server and visithttp://127.0.0.1:8000/admin/to see your newly installed Django Stisla for admin.Admin Model RegistrationTo register your models in Django admin, please import “from django_stisla.admin” in your applications admin.py and register your models as follows:...
from django_stisla.admin import site
...
...
site.register(Image)
site.register(Author)
site.register(Topic)
...Theme CustomizationsTo set logo/title in admin login page, please create templates/admin/login.html file in your application and use the following code:{% extends "admin/login.html" %}

{% block login-brand %}
<div class="login-brand">
    <h1>Django Administration</h1>
</div>
{% endblock %}To add extra CSS to dashboard theme, create static/admin/assets/css/extra.css file in your app. For example you can customize Font-awesome icons in the sidebar menu as follows based on your loaded apps in django:/* Custom font awesome icon for django auth app */

.fa-auth:before {
    content: "\f023";
}

/* Custom font awesome icon for an app name cms */

.fa-cms:before {
    content: "\f0ad";
}

/* Custom font awesome icon for an app name order */

.fa-order:before {
    content: "\f07b";
}
Package: django-stomp-debug-callback
Django stomp debug callbackThis functionality helps you comprehend and enhance your callback code used with theDjango STOMPlibrary.As this project uses aviewto call your callback function, it's possible to extract quite essential data that you can use to optimize your implementation.See an example of this approach in action thanks toDjango Debug Toolbar:Installationpip installdjango-stomp-debug-callbackDjango stomp debug callback configurationBasically the configuration is simple, just insert thedjango_stomp_debug_callbackonINSTALLED_APPSand
in your application'surlscode include the debug callback view route.fromdjango.confimportsettingsifsettings.DEBUG:urlpatterns+=[path("debug-callback/",include("django_stomp_debug_callback.urls")),# django stomp callback urls]Check ifdjango-stompstay intoINSTALLED_APPSHow to use ?This route is a simplePOSTtype route that expects to receive some parameters to trigger the callback function.body parameter:callback_function_path: The path to callback function to be calledpayload_body: payload body to be sent to de callback functionpayload_headers: headers to be sent to de callback functioncurl examplecurl --request POST \
  --url http://0.0.0.0:8000/debug-callback/debug-function/ \
  --data '{
	"callback_function_path": "path.to.the.callback.function",
	"payload_body": {
		"fake": "body"
	},
	"payload_headers": {
		"fake": "headers"
	}
}'How to use with django-debug-toolbar ?Configuration for thedjango-debug-toolbarhere.The first step isinstall de django-debug-toolbarin your apppipinstalldjango-debug-toolbarThe second step is to configure the urls (Recommended only insert this rule idDEBUGisTrue)fromdjango.confimportsettingsifsettings.DEBUG:urlpatterns+=[path("debug-callback/",include("django_stomp_debug_callback.urls")),# django stomp callback urlspath("debug-toolbar/",include("debug_toolbar.urls"))# django debug toolbar]The third step is to check the settings, these settings will include the middleware and debug apps to main settingsin your.env###################### DEBUG LIB CONFIGURATIONDEBUG_APPS=debug_toolbar,django_stomp_debug_callbackDEBUG_MIDDLEWARE=debug_toolbar.middleware.DebugToolbarMiddlewarein yoursettingimportosDEBUG=True# only to developer mode never in production app# DEBUG CONFIGURATIONifDEBUG:DEBUG_TOOLBAR_CONFIG={"SHOW_TOOLBAR_CALLBACK":(lambdarequest:True)}INTERNAL_IPS=["0.0.0.0"]DEBUG_APPS=os.getenv("DEBUG_APPS")ifDEBUG_APPS:INSTALLED_APPS+=DEBUG_APPS.split(",")DEBUG_MIDDLEWARE=os.getenv("DEBUG_MIDDLEWARE")ifDEBUG_MIDDLEWARE:MIDDLEWARE+=DEBUG_MIDDLEWARE.split(",")Now you can see the debug panel in your admin url (localhost:8000/admin) and you can choose the route you want to see the requests to the bank in a given view with timing details and explain options and see the most problematic query of your stream.TestsYou can run the tests with dockerdocker-composeuptestsOr usingtoxpipenvruntoxLint + code formatterThe use of.pre-commit-config.yamlflake8,black,isortandpylint.You can run the.pre-commit-config.yamlwith dockerdocker-composeuplint-formatterOr usingpre-commitpre-commitrun--all-files
Package: django-stopwatch
api metrics collector middleware for djangoThis package provides a django middleware to collect API metrics.InstallationUsageConfiguration and DefaultLicenseInstallation$ pip install django-stopwatchUsageMIDDLEWARE_CLASSES += (
    'stopwatch.middleware.StopWatchMiddleware',
)Configuration and DefaultSTOPWATCH_KEYBUILDER = 'stopwatch.keybuilders.RestApiKeyBuilder'
STOPWATCH_BACKENDS = (
    'stopwatch.backends.StatsDStopWatchBackend',
)
STOPWATCH_STATSD_PREFIX = stopwatch
STOPWATCH_STATSD_HOST = None
STOPWATCH_STATSD_PORT = NoneLicenseThis software is licensed under theApache License 2.0. See theLICENSEfile in the top distribution directory for the full license text.
Package: django-storage-qcloud
django-storage-qcloudDjango storage for qcloud's COS介绍django-storage-qcloud 是一个服务于腾讯云存储的 Django 自定义存储系统。安装使用 pip 安装pip install django-storage-qcloud或者直接从 git 安装pip install git+https://github.com/fordguo/django-storage-qcloud.git添加 requirements.txtgit+https://github.com/fordguo/django-storage-qcloud.git配置 setting.py:将上传文件存放到云DEFAULT_FILE_STORAGE = 'django_storage_qcloud.storage.QcloudStorage'将静态文件存放到云STATICFILES_STORAGE = 'django_storage_qcloud.storage.QcloudStorage'替换 SecretId， SecretKey, Region, Bucket 的值QCLOUD_STORAGE_OPTION = {
    'SecretId': 'SecretId 是开发者拥有的项目身份识别 ID，用以身份认证',
    'SecretKey': 'SecretKey 是开发者拥有的项目身份密钥。',
    'Region': '域名中的地域信息',
    'Bucket': '存储桶是 COS 中用于存储数据的容器，每个对象都存储在一个存储桶中',
}其他配置：COS_URL = 'https://www.qixincha.com' # 自定义域名， 不配置将使用 COS 默认域名COS_FAST_CDN = False # 默认加速域名是否开启同步静态文件到云python manage.py collectstatic要求支持 Python3.4
Package: django-storages-folder
Aboutdjango-storage-folder is a small extension to thedjango-storages-redux(a
python3 compatible fork of django-storages) project that allows you to specify
different directories for storing media and static files.It currently only supports the s3boto backend.How To UseSet the static files or media files storage backendSet the static files or media files storage directoryExampleSTATICFILES_STORAGE='storages_folder.backends.s3boto.StaticStorage'STATICFILES_STORAGE_DIR='static'MEDIAFILES_STORAGE='storages_folder.backends.s3boto.MediaStorage'MEDIAFILES_STORAGE_DIR='media'
Package: django-storages-s3-env
Installation$[sudo]pipinstalldjango-storages-s3-env$[sudo]npmi-gdjango-storages-s3-envProscompatible withdjango-storages S3 settingscreate env with one commandHow it workshard-coded environment variables names:AWS_STORAGE_BUCKET_NAMEAWS_STORAGE_USERAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYExamplesMakefile, create envMEDIA_BUCKET:=BUCKET_NAME
all:test-s.env.prod.media||storages-s3-create-env$(MEDIA_BUCKET)>.env.prod.mediaLinksdjango-storagesreadme42.com
Package: django-storages-s3upload
Direct (client-side) HTTP POST file upload to S3 using Django forms/views.This project is under development, and so should be used in production
environments with a high degree of caution.Docs:http://django-storages-s3upload.readthedocs.org/Please beVERYcareful with security considerations, and check you know
exactly what is happening. S3 HTTP POST upload will overwrite existing files if
the key matches. You will want to limit uploads to trusted users, and use
unique key prefixes. You will want to make sure that any processing of uploaded
files is safe.See also:https://docs.djangoproject.com/en/dev/topics/security/#user-uploaded-contentFeaturesCreate signed forms for client-side uploading of files directly in to Amazon
S3 buckets using HTTP POST:http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTForms.htmlA view to handle/validate the returned parameters from the upload, and a hook
to process the uploaded file.An extended form/view which uses dropzone.js for handling multiple uploads
with thumbnails and progress bars.RequirementsYou’ll need to set-up & configure an Amazon S3 Boto storage backend usingdjango-storages:http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.htmlInstallationInstall django-storages-s3upload by running:pipinstalldjango-storages-s3uploadContributeIssue Tracker:https://github.com/mattaustin/django-storages-s3upload/issuesSource Code:https://github.com/mattaustin/django-storages-s3uploadLicenseThe project is licensed under the Apache license 2.0.
Package: django-storage-timestamps
This django app allows to automatically addRFC
3161time-stamps to uploaded files.
This way you can prove that the files have existed at a specific point in time
and have not been modified since. It is based onrfc3161ng.InstallationAdapt the settings:INSTALLED_APPS=[…'storage_timestamps',…]STORAGES={'default':{'BACKEND':'storage_timestamps.storage.TimestampedFileSystemStorage',},…}TIMESTAMP_AUTHORITY='https://freetsa.org/tsr'# or any other TSAVerify timestamps$django-admints_dumpmyfile.pdf
TimeStampTokenwaswrittento"myfile.pdf.ts".

inspect:opensslts-reply-in"myfile.pdf.ts"-token_in-text
verify:opensslts-verify-in"myfile.pdf.ts"-token_in-data"media/myfile.pdf"-CAfile"/etc/ssl/certs/ca-certificates.crt"Cleanup unused timestampsSometimes, the original file is no longer available, so the timestamp is no
longer useful. Timestamps are not deleted automatically in order to prevent
unintended data loss. However, you can delete such timestamps manually usingdjango-admin ts_cleanup.AlternativesInstead of storing the timestamp separately, you could also embed it in the PDF
(see ISO 32000-2:2017 section 12.8). Such a timestamp would be easy to validate
with compatible PDF readers. However, it would be much more complicated to
create and also be restricted to PDF documents.
Package: django-storage-webdav
Django Storage System for WebDAVDjango Storage System for WebDAV is a storage system for Django that allows
the user to use a WebDAV server as file storage for media files and also
static files.This work is licensed under the 3-clause BSD license,
for more information see LICENSE.txtPrerequisitesDjango v2.2 and Python v3.5 (or higher)Building and installing from sourceTo install the module in the current virtual environment.python3 setup.py clean --all installTo instead install in your home directory.python3 setup.py clean --all install --userConfiguration SettingsFollowing parameters are used by the generic file storage system to
connect and authenticate against the WebDAV server.STORAGE_WEBDAV_URL = "https://www.example.org/media/"
STORAGE_WEBDAV_USERNAME = "username"
STORAGE_WEBDAV_PASSWORD = "password123"To enable the storage system, seeManaging filesin the Django documentation.In short; the actual configuration for the generic file storage isDEFAULT_FILE_STORAGE, i.e.DEFAULT_FILE_STORAGE = "django_storage_webdav.WebDavStorage"To use the storage system for static files, use the following parameters.STATIC_STORAGE_WEBDAV_URL="https://www.example.org/static/"
STATIC_STORAGE_WEBDAV_USERNAME="username"
STATIC_STORAGE_WEBDAV_PASSWORD="password123"And then activate the storage system by setting theSTATICFILES_STORAGEparameter.STATICFILES_STORAGE = "django_storage_webdav.StaticWebDavStorage"Installation in local package index (e.g. DevPi)The commands below builds and install the artifacts in a local package index
(DevPi) athttp://devpi.myserver.lan/under thestagingindex.python3 setup.py clean --all sdist bdist_wheel
python3 -m pip install --upgrade twine
python3 -m twine register --verbose --repository staging dist/*tar.gz
python3 -m twine upload --repository-url http://devpi.myserver.lan/ --repository staging dist/*
Package: django-stored-settings
It often happens that we need to be able dynamically to create/edit some
settings and site variables, for example site title, logo and counter
code.stored-settingsmodule is tailored specifically for these purposes
allowing dynamically to create and further on to edit via django-admin
records of the following types:CharTextHTML textBooleanImageRequirementsDjango stored-settings requires Django 1.3 or later and Pillow. Also has
TinyMCE integration.Getting ItYou can get Django stored-settings by using pip or easy_install:$ pip installdjango-stored-settingsor$ easy_installdjango-stored-settingsIf you want to install it from source, grab the git repository from
GitHub and run setup.py:$ git clone git://github.com/zvadim/django-stored-settings.git
$ cd stored_settings
$ python setup.py installInstalling ItTo enablestored-settingsin your project you need to add it toINSTALLED_APPSin your projectssettings.pyfile:INSTALLED_APPS=(...'stored_settings',)And also add new content processorTEMPLATES=[{...OPTIONS': {'stored_settings.context_processors.stored_settings',...},}]Last step is db migration$ python manage.py migrateUsing Itin template{{ stored_settings.my_key }}TinyMCEFor HTML fields TinyMCE can be applied. To enableTinyMCEsupport instored-settingsyou need to add tosettings.pythe following:STORED_SETTINGS_TINYMCE_ENABLE=True
Package: django-storybook
django-storybookA Django module to intergrate the Storybook pattern library and djangoInstallationpip install django-storybook && pip install django-cors-headersFollow the setup for django-cors-headershere.ConfigSettings.devPlease note django_storybook disables CSRF protection to allow for local development using Docker. This should not be used in production.# Enable django_storybook
    CORS_ORIGIN_ALLOW_ALL = True
    CORS_ALLOW_HEADERS = default_headers + ("Access-Control-Allow-Origin", "csrftoken")Installed appsAdd the following to your installed apps:INSTALLED_APPS =[
    ...
    "django_storybook",
    "corsheaders",
    ...
]URLsAdd the following to your debug urls:if settings.debug:
            urlpatterns += url(r"", include(django_storybook_urls)),StorybookAdd the following to your webpack.config.js:"django-storybook": "start-storybook -p 6006 & webpack --mode development --progress --watch",While your development environment is running:npm run django-storybookCreating templatesTo create Storybook stories that django-storybook can interpret you need to add the following Javascript file titled "base-template.js"import React from 'react'

    const baseUrl = "http://0.0.0.0:8000/compile_django/"

    class BaseTemplate extends React.Component {
        constructor() {
        super()
          this.state = {
            data: null,
          };
        }

        componentDidMount() {
            var xhr = new XMLHttpRequest();
            xhr.open("POST", baseUrl, true);
            xhr.setRequestHeader('Content-type',    'application/json')
            xhr.onload = () => {
                var template = xhr.response;
                console.log(template);
                this.setState({ template });
            }

            xhr.send(JSON.stringify( this.props ));
        }

        render() {
      if (this.state.template) {
        return  <div dangerouslySetInnerHTML={{__html:this.state.template}} />;
      }
      else {
        return <div>Loading...</div>
      }
    }
  }

  export default BaseTemplate;TemplatingTo render django templates, template tags and pass in context you simply import the base template and create props that mimic the expected context. The template variable is the relative path to you desired template.import React from 'react';
    import BaseTemplate from '../path/to/your/base-template.js';

    // Set storybook title
    export default { title: 'Example' };

    // Create props for context
    var props = {
        template: 'path/to/your/html.html',
        context: {
            card: {
                description: "A Description",
                url: "https://wwww.williamblackie.com",
                button_title: "Vist website"
                },
            card_image: {
            url: "https://via.placeholder.com/250x150?text=William+Blackie"
            }
        },
    }


    // Export 
    export const example = () => (
        <BaseTemplate {...props}/>

    )DeploymentDue to disabling CSRF django_storybook is not safe for production. However, deploying a static storybook usingstorybook deployeris a good alternative.
Package: django-story-map
Django Story MapA django app to create/edit/publish story maps usinghttps://storymap.knightlab.com/installpip install django-story-mapaddstory_maptoINSTALLED_APPSin your settings-file( see e.g. the example project./djangobaseproject/settings.py)add the story_maps urls to your project's urls (see e.g. the example project./djangobaseproject/urls.py)featurescreate story maps via django-admin interfacedonwload/copy story-maps created via knightlab's interfacepython manage.py story_map_from_url --url https://uploads.knightlab.com/storymapjs/dc9e2f8d24c3bafe928fc52fb4d03df3/whatever/published.json --story "My awesome story map"show storymaps{whatever}/stories/{story-pk}/provide storymaps data via JSON-API-Endpoint{whatever}/stories/data/{story-pk}/This project was bootstraped bydjangobase-cookiecutter
Package: django-strategy-field
Set of custom fields useful to implement theStrategy Patternwith Django models.The Strategies are displayed in SelectBoxes as standard choice fieldThis package provides the following custom fields:StrategyFieldMultipleStrategyFieldStrategyClassFieldMultipleStrategyClassFieldThe StrategyField can be accessed as instance of the model with an attributecontextthat points to model that ‘owns’ the field (inverse relation). So:Examplefromstrategy_field.fieldsimportStrategyFieldfromdjango.core.mail.backends.filebased.EmailBackendclassEvent(models.Model):backend=StrategyField()Event(sender='django.core.mail.backends.filebased.EmailBackend')Use caseAs example we can imagine an application that managesEventsthat need to be notified to users.
EachOccurrenceofEventcan be notified using different transport, (email, sms,…).
We want to be able to add/change the way we send notification, per event basis, simply using
the Django admin panel.fromstrategy_field.fieldsimportStrategyFieldfromstrategy_field.registryimportRegistryclassTransportRegistry(Registry)passclassAbstractStrategy(object):def__init__(self,context):self.context=contextdefsend(self):raiseNotImplementedErrorclassEmailStrategy(AbstractTransport):defsend(self):...classSMSStrategy(AbstractTransport):defsend(self):...registry=TransportRegistry(AbstractStrategy)registry.register(EmailStrategy)registry.register(SMSStrategy)classEvent(models.Model):sender=StrategyField(registry=registry)Event.objects.get_or_create(sender=EmailStrategy)......e=Event.objects.get(sender=EmailStrategy)e.sender.send()# e.sender.context == eMore examplesUse callablefromstrategy_field.fieldsimportStrategyFieldfromstrategy_field.registryimportRegistryregistry1=Registry()registry2=Registry()classA(model):sender=StrategyField(registry=lambdamodel:model._registry)classMeta:abstract=TrueclassC1(A):_registry=registry1classMeta:abstract=TrueclassC2(A):_registry=registry2classMeta:abstract=TrueProject linksStableDevelopmentProject home page:https://github.com/saxix/django-strategy-fieldIssue tracker:https://github.com/saxix/django-strategy-field/issues?sortDownload:http://pypi.python.org/pypi/django-strategy-field/