Saravanan666/pypi-org huggingface dataset:
Package: django-webp
Speeds up static file load times by generating a webp image to load to a webpage instead of a jpg, gif or pngUsageLoad thewebpmodule in your template and use thewebptemplatetag to point to the image you want to convert.{% load webp %}

{# Use webp as you would use static templatetag #}<imgsrc="{% webp 'path/to/your/image.png' %}"alt="image"/><!--
If the browser has support, generates:
<img src="/static/WEBP_CACHE/path/to/your/image.webp" alt="image" />

else, generates:
<img src="/static/path/to/your/image.png" alt="image" />
-->InstallationFirst, if you are using a version of Pillow <= 9.3.0, you must install  webp support since earlier versions of Pillow do not
have webp support built-in. In ubuntu, you can install via apt-get:apt-getinstalllibwebp-devPlease, checkthe official guidefor the other systems.Then, installdjango-webp.pipinstalldjango-webpadd it toINSTALLED_APPSconfigurationINSTALLED_APPS=('django.contrib.staticfiles','django_webp','...',)edit your installation of Whitenoise to use our slightly modded version of itMIDDLEWARE=['django.middleware.security.SecurityMiddleware','django_webp.middleware.ModdedWhiteNoiseMiddleware','...',]add the django_webp context processorTEMPLATES=[{'...''OPTIONS':{'context_processors':['...','django_webp.context_processors.webp',],},},]SettingsThe following Django-level settings affect the behavior of the libraryWEBP_CHECK_URLSWhen set toTrue, urls that link to externally stored images (i.e. images hosted by another site) are checked to confirm if they are valid image links.
Ideally, this should temporarily be set toTruewhenever theWEBP_CACHEhas been cleaned or if there has been substantial changes to your project’s template files.
This defaults toFalse.Possible Issuesdjango-webpusesPillowto convert the images. If you’ve installed thelibwebp-devafter already installedPillow, it’s necessary to uninstall and install it back because it needs to be compiled with it.This package was built specifically for production environments that use Whitenoise for serving static files so there currently isn’t support for serving files via dedicated servers or through cloud servicesCleaning the cacheYou can clean the cache running:pythonmanage.pyclean_webp_images
Package: django-webpack-bridge
Django Webpack BridgeCreates a bridge from webpack to django.How to UseAdddjango-webpack-bridgetosetup.pyorpyproject.toml, andpackage.json.Add the plugin towebpack.config.jsconstDjangoBridgePlugin=require('django-webpack-bridge');module.exports={...,plugins:[...,newDjangoBridgePlugin(),],}django-webpack-bridgewill use the variables frommodule.exports.outputAdd the following tosettings.pyINSTALLED_APPS+=['webpack_bridge',]STATICFILES_DIRS=['{same as module.exports.output.path from webpack.config.js}',]In thetemplate.html{% load webpack_bridge %}
{% render_webpack_entry 'entry point name' js='defer' %}SettingsBRIDGE_SETTINGS={# Name of the manifest file'manifest_file':'manifest.json',# Boolean to turn caching on and off'cache':notsettings.DEBUG,# Timeout duration for the cache'cache_timeout':86400,# 1 Day# Namespace for the cache'cache_prefix':'webpack_manifest',# Maps a tag group to a group of tags'group_to_extensions':{'script':('js',),'style':('css',),},# Maps a tag group to a html tag'group_to_html_tag':{'script':'<script src="{path}"{attributes}></script>','style':'<link rel="stylesheet" type="text/css"'+' href="{path}"{attributes}>',},# Time between updaing the manifest from the file while compiling'compiling_poll_duration':0.5,}group_to_extensionsandgroup_to_html_tagcombine to create a multi-key map from a group of file extensions to a html tag. Eg.(js, jsx) -> <script src="{path}" {attributes}></script>path: Will be replaced with the bundle pathattributes: Will be replaced with any attributes specfied when when calling 'render_webpack_entry'. Attributes are grouped by file extensionThe following settings can be passed toDjangoBridgePlugin{path:'defaults to module.exports.output.path',publicPath:'defaults to module.exports.output.publicPath',fileName:'defaults to manifest.json',}DevelopmentRunning testsCreate and activate a python virtual env of your choice (optional).Runpip install .RunDJANGO_SETTINGS_MODULE=test_files.settings python -m django test webpack_bridgeRunning the DemoRundocker-compose up --buildOpenlocalhost:8000
Package: django-webpack-bundle
Adjango-webpack-loadertemplate tag which optionally supports rendering chunks inline. This may be
useful e.g. for the manifest respectively the Webpack runtime.Installdjango-webpack-loaderRegister webpack bundle as a template tag somewhere:fromdjangoimporttemplatefromwebpack_bundleimportwebpack_bundleregister=template.Library()register.simple_tag(webpack_bundle)webpack_bundleassumes that it may load Webpack bundles fromsettings.WEBPACK_BUNDLE_PATHorsettings.BASE_DIR + "static/".The arguments to the{% webpack_bundle %}template tag are basically
the same as those for django-webpack-loader’s{% render_bundle %}except for the additionalinlineargument which optionally allows
rendering chunks inline if the files can be found.
Package: django-webpack-dev-server
django-webpack-dev-serverDjango Webpack Dev Server is a command line Django reusable app to setup configuration files for React. It uses webpack and webpack_dev_server to bundle your frontend code.InstallationInstall using pippip install django-webpack-dev-serverPackage SupportsReact (Javascript)React (Typescript)Quick startAdd 'django_webpack_dev_server' to your INSTALLED_APPS in
settings.py like this:INSTALLED_APPS=[...'django_webpack_dev_server',]Default django app name is frontend and template is javascript. You can provide your name and template by runningpython manage.py generate react --app_name your_app_name --template (javascript/typescript)Runpython manage.py generate reactto create a django app with the default app_name and template.Add the new django app to your INSTALLED_APPS setting like in step 1.Add the path for the new django app in the urlpatterns of the project's urls.py like this:fromdjango.urlsimportpath,includepath("",include("your_app_name.urls")),Runpython manage.py runserverto start the django's development
server.cdinto the newly created django app and runnpm startand go to
(http://localhost:8080/).Runnpm run buildto create a production build of your frontend code.Important LinksDemo Video of the PackageCheck out Tech with Tim's Youtube Playlist for a detailed explanation in building Django and React Full Stack App.Webpack DocumentationContributionsIf you find an issue or have a new feature then feel free to make a Pull Request. Your Contributions are always welcomed.Running the Package in Development ModeYou can run the package in development mode by setting the "SOFTWARE_ENVIRONMENT_MODE" environment variable equal to "development".Now you can load assets from your local system and the new changes can be tested.LicenseThis project is provided under theMIT License.
Package: django-webpack-pages
django-webpack-pagesUse webpack with your multi-page, multi-lingual django webapp.This project is based ondjango-webpack-loaderwhich handles the connection to webpack.
Consider usingwebpack-critical-pagesas well
if you are interested in speedups.Put the following in your settings file:WEBPACK_PAGES={"CRITICAL_CSS_ENABLED":True,"ROOT_PAGE_DIR":osp.join(BASE_DIR,"pages"),"STATICFILE_BUNDLES_BASE":"bundles/{locale}/",# should end in /}STATICFILES_FINDERS=("webpack_pages.pageassetfinder.PageAssetFinder",# ... and more of your choosing:"django.contrib.staticfiles.finders.FileSystemFinder","django.contrib.staticfiles.finders.AppDirectoriesFinder",)# configure the loaded page directories and add the WebpackExtensionTEMPLATES=[{"BACKEND":"django_jinja.backend.Jinja2","DIRS":[osp.join(BASE_DIR,"templates"),osp.join(BASE_DIR,"pages")]+[osp.join(BASE_DIR,app,"pages")forappinGRAZBALL_APPS]+[osp.join(BASE_DIR,app,"components")forappinGRAZBALL_APPS],"APP_DIRS":True,"OPTIONS":{# ..."extensions":[# ..."webpack_pages.jinja2ext.WebpackExtension",],}}]Usingwebpack_loader.contrib.pagesyou can register entrypoints for corresponding pages in templates.At the top of your individual page, do:{% extends "layout.jinja" %}
{% do register_entrypoint("myapp/dashboard") %}In the layout's (base template's) head, place the following:<!DOCTYPE html>
{% do register_entrypoint("main") %}
<html lang="{{ LANGUAGE_CODE }}">
<head>
  ...
  {{ render_css() }}
</head>
<body>
  ...
  {{ render_js() }}
</body>This will load the registered entrypoints in order (main, thenmyapp/dashboard) and automatically inject
the webpack-generated css and js. It also supports critical css injection upon first request visits.
Package: django-webperf
A collection of stuff to improve django web performance.Domain shardingDomain shardingis an optimization technique for parallelization of resource loading.
If you have a lot of media files on your page you might want them to be downloaded from
different domains, as web browsers have limits on how many files they can grab at once.
Domain sharding reduces the overall page load time and is widley used on rich media sites,
like Facebook, Youtube, etc.It works as a customizeddjango file storage, overriding standard url method.Installation & setupRecommended way to install is pip:pip install django-webperfMake sure to change yourDEFAULT_FILE_STORAGEinsettings.pyto use sharding site-wide:DEFAULT_FILE_STORAGE = 'web_performance.storage.DomainShardingStorage'SettingsWEBPERF_MEDIA_TEMPLATEDefault:''(empty string)A pattern to generate media_urls with a standard format placeholder.
E.g.http://img{0}.example.com/media/WEBPERF_DOMAINS_NUMBERDefault:2Number of domains you want to use to split your media content.Don’t use too many domains, becasue it will increase DNS lookup time.
Package: django-webperformers-humans
Django humansWarning - templates are built using TailwindCSS - you need to build a styles for them manuallyHumans is a Django app:Exposing humans.txt fileExposing project team over /team/ pathExposing each project team member over /team/member-name pathModel Humans is created to manage team members and their informationApp uses templates:teamComponent.html- main component of displaying team membersteamPage.html- page, including teamComponent.html component, and extending base template. Base template should have humansContent block.personPage.html- page, displaying each tem member individually, and extending base template. Base template should have humansContent block.To override them, just create same files in your templates dir humans folderQuick startAdd "humans" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [ ..., "humans", ]Include the humans URLconf in your project urls.py like this::path('', include('humans.urls')),Runpython manage.py migrateto create the humans models.Add{% block humansContent %}{% endblock %}to your base template to include pages in
Package: django-webpfield
This is a library for Django that provides a custom model field for storing WebP images.
TheWebPFieldmodel field allows you to store WebP images in your Django models
and provides convenient methods for converting between WebP and other image formats.InstallationTo install the library, simply add it to your project’s dependencies using pip:pipinstalldjango-webpfieldUsageTo use theWebPFieldmodel field, simply import it from the library and add it to your Django model:fromdjango.dbimportmodelsfromwebpfield.fieldsimportWebPFieldclassMyModel(models.Model):my_image=WebPField(upload_to="images/")SettingsThe default settings are:WEBP_FIELD_SETTINGS={"saving_kwargs":{"quality":75,"lossless":False,},"delete_original":False,"enable_svg":True,"image_field_class":{"module":"django.db.models","class_name":"ImageField"},}saving_kwargs: are the kwargs passed to pillow when saving the new imageenable_svg: if True you can upload and svg and it will remain svg as original, this achieved by updating the formfield kwargs of WebPField to file field instead of image fieldimage_field_class: The default parent class of WebPField is django ImageField, but you can override it with yoursContributingContributions to the library are welcome! If you find a bug, have a feature request, or would like to contribute code,
please open an issue or pull request on the GitHub repo.LicenseThis library is licensed under the MIT license. See the LICENSE file for more information.
Package: django-web-profiler
django-web-profiler’s documentation:Introduction:django-web-profiler is a django profiling tool which logs, stores debug toolbar statistics and also a set of URL’s statistics using a management command.  It logs request values such as device, ip address, user cpu time, system cpu time, No of queries, sql time, no of cache calls, missing, setting data cache calls for a particular url.It provides a basic UI, which will differentiate development url statistics, production level statistics which generates using a management command.Source Code is available in Micropyramid Repository(https://github.com/MicroPyramid/django-web-profiler).Modules used:Python  >= 2.6 (or Python 3.4)Django  = 1.11.2Django Compressor = 2.1.1Django Debug Toolbar = 1.8requests = 2.17.3JQuery  >= 1.7Installation ProcedureInstall django-web-packer using the following command:pip install django-web-profiler

        (or)

git clone git://github.com/micropyramid/django-web-profiler.git

cd django-web-profiler

python setup.py installAdd app name in settings.py:INSTALLED_APPS = [
   '..................',
   'compressor',
   'debug_toolbar',
   'django_web_profiler',
   '..................'
]Add ‘django_web_profiler.middleware.DebugLoggingMiddleware’ to your project middlewares:MIDDLEWARE = [
   '.....................................................',
   'django_web_profiler.middleware.DebugLoggingMiddleware',
   '.....................................................',
]

Disable 'debug_toolbar.middleware.DebugToolbarMiddleware' if you've already using it.Make sure that ‘debug-toolbar’ has enabled for your application. After installing debug toolbar, add the following details to settings.py:INTERNAL_IPS = ('127.0.0.1',)After installing/cloning, add the following details in settings file about urls,  logger names:URLS = ['http://stage.testsite.com/', 'http://stage.testsite.com/testing/']Add the following logger to your existing loggers and create a folder called ‘logs’ where all profiler log files are stored:'request-logging': {
        'level': 'DEBUG',
        'handlers': ['console', 'file_log'],
        'propagate': False,
    },

Here file_log is a handler which contains a path where log files are stored.Sample ApplicationInstall application requirements using the following command:pip install -r requirements.txtLoad the application load using the following command:python sandbox/manage.py loaddata sandbox/fixtures/users.jsonUsing the following command, we can generate url statistics in production environment i.e debug=False:python sandbox/manage.py logging_urlsWe are always looking to help you customize the whole or part of the code as you like.Visit our Django Development pageHereWe welcome your feedback and support, raisegithub ticketif you want to report a bug. Need new features?Contact us hereormailto:: “hello@micropyramid.com”
Package: django-web-secure
# Django Web SecureThe middleware that makes ponies fly with a great sense of security.![Flying pony](http://www.davidfischer.name/wp-content/uploads/2012/02/Securing-Your-Django-Site-Presentation/img/django-pony.png)## Inspiration:https://www.owasp.org/index.php/List_of_useful_HTTP_headers,https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines## What can it do:Force SSL,Exempt hosts,Enable HSTS, HSTS subdomains and HSTS preload,Enable XSS Protection,Enable nosniff,Enable Content-Security-Policy,__All of these are options that you can turn on/off.__## How to use:Follow the instructions in [INSTALL.md](../blob/master/INSTALL.md)## How to test:Using[Erik’s Pony checkup](http://ponycheckup.com)[SSL labs’ SSL test](https://www.ssllabs.com/ssltest/)## Docs:TODO:docs/
Package: django-webservice
# Thinc Webservice
Adds i18n and delta support for models to [django-restframework](http://www.django-rest-framework.org/)[![Build Status](https://api.travis-ci.org/webair/thinc.django-webservice.svg)](https://travis-ci.org/webair/thinc.django-webservice)
[![Coverage Status](https://coveralls.io/repos/webair/thinc.django-webservice/badge.svg?branch=develop)](https://coveralls.io/r/webair/thinc.django-webservice?branch=develop)## Requirements
- Django (1.8 or higher)
- djangorestframework (3.1 or higher)
- pytz (2014.10 or higher)
- django-grappelli (2.6.0 or higher)
Package: django-websettings
Django application to provide a web interface
to set a yet another django’s settings.Basic usageYou can set a setting file containing some key-value pairs
like django’s settings.py.
Then a web interface to set setting values will be provided automatically.The value in the setting file is handled as default value of web interface.
A new value set from web interface overrides that default value.The setting file will be like this:TEST_WEBSETTING='default value'SPAM='default spam'Then you can get setting values from websettings.>>>fromwebsettingsimportwebsettings>>>websettings.TEST_WEBSETTING'default value'After you set overriding value (like ‘after value’) by using
web interface…:>>>websettings.TEST_WEBSETTING'after value'InstallThis library is registered in PyPI asdjango-websettings.
You can install it as much as you like.SettingWebsettings fileThe position of the setting file is specified by a WEBSETTINGS_MODULE
in your project’s settings.py file:# In your settings.py file.WEBSETTING_MODULE='yourproject.websettings'Under project directory seems good.
You should put these setting key’s by UPPER_CASE.Web interface URLThe url to web interface to set setting values can be included like this:# In your urls.py file.url(r'^websettings/',include('websettings.urls'))The admin user can only access this page.Backenddjango-websettings is designed to correspond to multiple backend
to store settings.You can specify the back end module to set a WEBSETTINGS_BACKEND
in your project’s setting.py file:# In your settings.py fileWEBSETTINGS_BACKEND='path.to.backend_module'A DB backend (websetting.backends.db) is used by default.Testingdjango-websettings is tested by some environments,
check out theTravis CI report.
Package: django-website-showroom
Python/Django project to easily create showroom websites presenting different websites around a certain topic, originally used forhttp://opendata-tools.org(engl.) andhttp://opendata-showroom.org(german).FeaturesAdministrable via Django admin (Categories, Websites)Screenshots with automatic resize functionalityCustomizable category colorsCreation of different language editionsEdition-dependent custom static page texts (like title, subtitle, footer,…)Edition-dependent category and website selectionNo language dependent static codeResponsive, mobile-friendly designFor notes on installation and usage see thedocumentation.
Package: django-websocket-channel
# django-websocket-channelWebsocket support for Django using Redis#Installation<pre>sudo service redis-server start</pre><pre>pip install django-websocket-channel</pre>#Configuration<pre>INSTALLED_APPS = (...'websocket_channel',...)</pre><pre>WS_REDIS = {'host': 'localhost','port': 6379,'db': 0,'password': None,}</pre><pre>TEMPLATE_CONTEXT_PROCESSORS = (...'django.contrib.auth.context_processors.auth','django.core.context_processors.static','websocket_channel.context_processors.default',...)</pre>django 1.8<pre>TEMPLATES = [{''''OPTIONS': {'context_processors': [''''django.template.context_processors.static','django.contrib.messages.context_processors.messages','websocket_channel.context_processors.default','''],},},]</pre>#NGiNX<pre>server {'''location /ws/ {proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_pass http://unix:/tmp/websocket_channel_websocket.socket;}location / {include uwsgi_params;uwsgi_pass unix:/tmp/websocket_channel.socket;}'''}</pre>#uWSGI:<pre>[default]gid = www-datauid = www-dataumask = 002;virtualenv = virtualenv/pathmaster = trueenv=DJANGO_SETTINGS_MODULE=settingsenv=PYTHON_EGG_CACHE=/tmp/websocket_channelenv=LANG=zh_CN.UTF-8env=LC_ALL=zh_CN.UTF-8ignore-sigpipe = trueenable-threads = truechmod-socket = 666chdir = project/path/topythonpath = project/path/tomax-requests = 500000[runserver]ini = :defaultsocket = /tmp/websocket_channel.socketpidfile = /tmp/websocket_channel.pidmodule = wsgibuffer-size = 32768processes = 4daemonize = project/path/to/web.log[wsserver]ini = :defaulthttp-socket = /tmp/websocket_channel_websocket.socketpidfile = /tmp/websocket_channel_websocket.piddaemonize = project/path/to/websocket_web.logmodule = wsgi_websocketprocesses = 1http-websockets = truegevent=1000</pre>#Then start uWSGI:<pre>uwsgi --ini uwsgi.ini:runserveruwsgi --ini uwsgi.ini:wsserver</pre>#Client JavaScript<pre><script type="text/javascript" src="{{ STATIC_URL }}js/dj_websocket.js"></script><script type="text/javascript">var ws = new DjWebSocket({uri: '{{ WEBSOCKET_URL }}'});ws.onopen = function(){ws.subscribe("channel", function(data){//channel msg});}</script></pre>#Subscribe to Broadcast Notifications<pre>RedisPublisher("channel").publishgit _message("1111111111")</pre>
Package: django-websocket-notifications
A Django application to deliver user notifications made withdjango-snitchusing WebSockets.Quick startThis applications works using django-channels, so, you need to integrate this with
your project before to integrate django-websocket-notifications. So, to make the
quick start as quick and simple as possible, we’ve made the following assumptions:You already have integrated django-channelsYou are using a channel layer, like RedisYou have arouting.pyfileYour project uses DRF to deliver a RESTful API1Install using pip:pipinstalldjango-websocket-notifications2Add “websocket_notifications” to your INSTALLED_APPS settings like this:INSTALLED_APPS+=('websocket_notifications',)3Add the routing patterns to yourrouting.pyfile:fromchannels.authimportAuthMiddlewareStackfromchannels.routingimportProtocolTypeRouter,URLRouterfromwebsocket_notifications.routingimportwebsocket_urlpatternsapplication=ProtocolTypeRouter({"websocket":AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),})4(Optional) In order to test the integration, you can add the following view to yoururls.pyfile to be able to access to a testing view:urlpatterns+=[path("websocket-notifications/",include("websocket_notifications.urls",namespace="websocket_notifications",),),]Now, you can access to/websocket-notifications/listener/to check the integration.5Add the ViewSet to the DRF router:fromwebsocket_notifications.api.rest_frameworkimportNotificationGroupViewSetrouter=routers.DefaultRouter()router.register("websocket-notifications/groups",viewset=NotificationGroupViewSet)6Integrate withdjango-snitch:fromwebsocket_notifications.snitch.backendsimportWebSocketNotificationBackend@snitch.register(EVENT)classMyEventHandler(snitch.EventHandler):ephemeral=Truenotification_backends=[WebSocketNotificationBackend]