Saravanan666/pypi-org huggingface dataset:
Package: django-sr
The siple way to resolve some data defined on settings. You can easy to use it on
any part of you python code on your django project.Also, this exposeses templatetags for django template engine and jinja template enjine
for easy use it from templates. See examples to better understand how it works.How to installYou can also install it with:pip installdjango-srConfigurationAdd the sr app to your installed apps and define your settingsSRvariable as a dictionary.Example:# settings.pySR={'footer':{'phone':'+34 987654321','address':'Foo Bar Street, 32','other_text':'Text with parameters{0}',},'header':{'logo':{'alt':'Logo image','src':'http://foo.bar/images/logo.png'}}}Usage examplesUse it directly from your code.fromsrimportsrlogo_alt=sr('header.logo.alt')# Logo imageother_text=sr('footer.other_text','parameter')# Text with parameters parameterAlso, from django templates with thesrtemplate tag:{%loadsr%}<span class="phone">{%sr'footer.phone'%}</span>
<span class="other">{%sr'footer.other_text''text'%}</span>And you can use it from jinja templates using thesrglobal function:<span class="phone">{{sr('footer.phone')}}</span>
<span class="other">{{sr('footer.other_text','text')}}</span>For jinja template integration for django you need usedjango-jinja
Package: django-sri
Django SRISubresource Integrityfor Django.Installationpip install django-sriAnd addsrito yourINSTALLED_APPS.UsageTemplate TagsNote: By default, integrity hashes are not output whenDEBUGisTrue, as static files change a lot during local development. To override this, setUSE_SRItoTrue.django-sriis designed to primarily be used through template tags:{% load sri %}

{% sri_static "index.js" %}<!-- Will output "<script src='/static/index.js' integrity='sha256-...'></script>" -->{% sri_static "index.css" %}<!-- Will output "<link rel='stylesheet' href='/static/index.css' integrity='sha256-...'/>" -->For performance, the hashes of files are caches in Django'scaching framework. It will attempt to use the "sri" cache, but fall back to "default" if it doesn't exist. The cache keys are the hash of the file path in the specified algorithm in hex. Caches are stored for as long asDEFAULT_TIMEOUTis set to.AlgorithmsThe SRI standard supports 3 algorithms: sha256, sha384 and sha512. By default, SHA256 is used. To override this, supply an additionalalgorithmargument to thesritemplate tag (or the specific ones):{% load sri %}

{% sri_static "index.js" algorithm="sha512" %}<!-- Will output "<script src='/static/index.js' integrity='sha512-...'></script>" -->The default algorithm can be changed by settingSRI_ALGORITHMto the required algorithm.Additional attributesTo add additional attributes to the output tag (such asasync/defer), specify them as additional arguments to the template tag:{% load sri %}

{% sri_static "index.js" 'defer' 'async'%}
{% sri_static "index.woff2" preload as="font" %}Just the integrity valueTo retrieve just the integrity hash (the contents of theintegrityattribute), you can use the{% sri_integrity_static %}tag, which supports the same arguments as the other tags.{% load sri %}

{% sri_integrity_static "index.js" "sha512" %}<!-- Will output "sha512-..." -->Supported FilesFor automatic tag output, the following files are supported:.js.cssUnknown extensions will emit alinktag with the URL as thehrefattribute.sri_integrity_staticis unaffected by this limitation.APIfrompathlibimportPathfromsriimportcalculate_integrity,calculate_integrity_of_static,Algorithmcalculate_integrity(Path("/path/to/myfile.txt"))# "sha256-..."calculate_integrity_of_static("index.js")# "sha256-..."calculate_integrity_of_static("index.js",Algorithm.SHA512)# "sha512-...""Does this work withwhitenoiseor alike?"Yes.django-srioutputs the static file URL in the same way the builtinstatictemplate tag does. This means the correct cachebusted URLs are output.When using a manifestSTATICFILES_STORAGE,django-sriwill automatically retrieve the hashed and post-processed file as opposed to the original.
Package: django-sse-wrapper
Django SSE wrapper is an easy way to implement Server-Sent Events in a Django application.
You can find details about SSE athttp://www.html5rocks.com/en/tutorials/eventsource/basics/InstallationInstalling from PyPI:$ pip install django-sse-wrapperUsageDjango SSE Wrapper exposes a view calledEventStreamViewthat implements the SSE logic.
In yoururls.pyyou will specify a pattern like:fromdjango.conf.urlsimportpatterns,urlfromsse_wrapper.viewsimportEventStreamViewurlpatterns=patterns('',url(r'^an-event-stream/$',EventStreamView.as_view(channel='some-channel-name'),name='an_event_stream'),)You can also specify a channel extension. This may be useful, for example, when you have an event stream called course_state_stream, but that needs to differ from one course to another (by course_id, for example). The url pattern would look like:fromdjango.conf.urlsimportpatterns,urlfromsse_wrapper.viewsimportEventStreamViewurlpatterns=patterns('',url(r'^course-state-stream/(?P<channel_extension>[\w]+)/$',EventStreamView.as_view(channel='course-state'),name='course_state_stream'),)BrokersFor now, I only support two backend brokers: Memory (testing purpose only) and Redis. Soon I’ll be adding support to RabbitMQ, ZeroMQ, and others.In your settings.py you must specify the broker and its properties:SSE_BACKEND_CLASS='sse_wrapper.backends.redis_based.RedisBasedBackend'SSE_BACKEND_CONNECTION_SETTINGS={'host':'localhost','port':6379,'db':0,}Production Environment NotesBecause Server-Sent Events are streams of data, they require long-lived connections. You’ll want to use a server can handle large numbers of simultaneous connections. I strongly recomend you to use some gevent WSGI server.ContributingInstallVagrantin order to run the example app and test the code.LicenseBSD LicenseNote: this project is based ondjango-ssewritten byniwibe.
The reason I started a new project instead of forking is that I decided to change the whole design of the code. I like the idea of omitting the broker from the app code, this way when you decide to change from one broker to another, you just have to change your settings.py.
Package: django-ssheepdog
django-ssheepdog is a public ssh key management tool for teams of programmers.
Different people need different privileges to different servers.  Ssheepdog
allows you to specify these relationships and then sync the keys to the
appropriate servers.Developmentdjango-ssheepdog is distributed as a pluggable django app.  The meat of the
application is contained in thessheepdogdirectory.  Thesrcdirectory
contains a django project that uses the app.When you are developing, you should install ssheepdog into your virtual
environment with the following command:$ python setup.py developThis will create a symlink between the source and the environment’s site
packages.  Once the link is created, you can edit the source code inssheepdog/as usual.InstallationTo install the latest version, run:$ pip install -e git+git://github.com/sheepdoginc/django-ssheepdog.git@dev#egg=django-ssheepdogThen, addssheepdog` to your ``INSTALLED_APPSand add thessheepdog.urlsto your project’s urls.Install from PyPI:$ pip install django-ssheepdogDocumentationLatest documentation can be found onReadTheDocs.Testing vagrant VMWe have provided a vagrant VM configuration for testing the ssh syncing.Boot it up:$ vagrant upLog in:$ ssh ssheepdog@127.0.0.1 -p 2222 -i deploy/cookbooks/ssheepdog/files/default/id_rsa
Package: django-sshkm
# django-sshkm [![Build Status](https://travis-ci.org/sshkm/django-sshkm.svg?branch=master)](https://travis-ci.org/sshkm/django-sshkm)django-sshkm is a Django based ssh-key management tool.It stores ssh-public-keys in a database and combines them in groups (Development, Operations, Externals, ...). You can assign these groups to operating system users on target hosts and are able to deploy your configurations.Do you have hundreds of hosts/servers and dozens of users or other systems which want to connect to these using SSH?Do you know the problem when an employee leaves the company but knows many passwords of OS-users and now you should better change all your passwords?Do you want to have better control over who can connect to your hosts using SSH?Then django-sshkm is perfect for you.## DemoThere is a demo available:URL: [http://sshkm.guruz.at](http://sshkm.guruz.at)USER: adminPASSWORD: admin## Requirements- Linux- RabbitMQ- Python >= 2.7- Django >= 1.8- Celery >= 4.0.0- Django compatible database like (SQLite, MySQL/MariaDB, PostgreSQL, ...)## Used Technologies- [Linux](https://www.kernel.org)- [Python](https://www.python.org)- [Django](https://www.djangoproject.com)- [RabbitMQ](https://www.rabbitmq.com)- [Celery](http://www.celeryproject.org)- [Bootstrap](http://getbootstrap.com)- [jQuery](https://jquery.com)- [DataTables](https://datatables.net)## Setup- Install a RabbitMQ server.- Install a Django compatible database.- Install SSHKM:you will need some development tools and libraries: gcc python python-devel python-pip mariadb-devel postgresql-devel openldap-devel httpd-devel```bashpip install django-sshkm```- Configure /etc/sshkm/sshkm.conf (create it if it does not exist)You can find an example in your install directory (example: /usr/lib/python2.7/site-packages/sshkm/sshkm.conf).If you use sqlite make sure that the user running celery (see next step) has read and write permissions to the db-file.- Install a webserver which runs wsgiExample Apache httpd:```Alias /static/ /usr/lib/python2.7/site-packages/sshkm/static/<Directory /usr/lib/python2.7/site-packages/sshkm/static/>Require all granted</Directory>WSGIScriptAlias /sshkm /usr/lib/python2.7/site-packages/sshkm/wsgi.py/WSGIDaemonProcess sshkm user=apache group=apacheWSGIProcessGroup sshkm<Directory /usr/lib/python2.7/site-packages><Files wsgi.py>Require all granted</Files></Directory>```- Run celery```cd /usr/lib/python2.7/site-packagescelery worker -A sshkm -l info```## Firewall & SELinuxBe aware of firewall and SELinux issuesYou can find more informations in the wiki: https://github.com/sshkm/django-sshkm/wiki
Package: django-ssify
License-------![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png)Copyright © 2014,2015 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>For full list of contributors see AUTHORS section at the end.This program is free software: you can redistribute it and/or modifyit under the terms of the GNU Affero General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public Licensealong with this program.  If not, see <http://www.gnu.org/licenses/>.Dependencies============* Python >= 2.6* Django >= 1.5Installation============1. Add 'ssify' to INSTALLES_APPS.2. Add middleware classes:* ssify.middleware.SsifyMiddleware on top,* if using UpdateCacheMiddleware, addssify.middleware.PrepareForCacheMiddleware after it,* ssify.middleware.LocaleMiddleware instead of stock LocaleMiddleware.3. Make sure you have 'django.core.context_processors.request' in yourTEMPLATE_CONTEXT_PROCESSORS.4. Configure your webserver to use SSI ('ssi=on' with Nginx).Usage=====1. Define your included urls using the @ssi_included decorator.2. Define your ssi variables using the @ssi_variable decorator.Authors=======* Radek Czajka <radekczajka@nowoczesnapolska.org.pl>
Package: django-ssl-admin
Make the Django admin only available via https. For Django versions >= 1.7.InstallationYou can installdjango-ssl-adminusing pip:$ pip install django-ssl-adminUsageTo enabledjango-ssl-adminyou need to add it to MIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES=(...'ssladmin.middleware.SSLAdmin',....)If your admin path is not/admin/you can change theADMIN_PATHsetting like so:ADMIN_PATH='^/staff/'If you have a reverse proxy set up remember to let Django know how it can detect a secure connection, e.g.:SECURE_PROXY_SSL_HEADER=('HTTP_X_SCHEME','https')LicenseCopyright © 2015Matt Deacalion Stevens, released under TheMIT License.
Package: django-ssl-auth
SSL authentication backend and middleware for Django for authenticating users
with SSL client certificatesLicenseMIT license, see LICENSE.txt for full text.SetupSSLSet up nginx and create SSL certificates for your server and set up the paths
to server private key, server certificate and CA certificate used to sign
the client certificates. Example configuration file is in samples/nginx.confIf you are on OS X, I suggest OS X KeyChain access for doing this for
testing, as it will automatically make your client certificates available in
all both Google chrome & Safari. Instructions can be found e.g.http://www.dummies.com/how-to/content/how-to-become-a-certificate-authority-using-lion-s.htmlOn other platforms, there are many tutorials on how to do this with OpenSSL
e.g.http://pages.cs.wisc.edu/~zmiller/ca-howto/Restart your ngninx (sudo nginx -s restart), make sure your green unicorn is
running and check that yourhttps://url loads your application and theserver certificate is valid.This modulerun setup.py (sudo python setup.py install) or install the latest release
usingpip install django_ssl_authedit yoursettings.pyadd"django_ssl_auth.SSLClientAuthMiddleware"to yourMIDDLEWARE_CLASSESadd"django_ssl_auth.SSLClientAuthBackend"to yourAUTHENTICATION_BACKENDSConfigurationThere are two things you need to do insettings.pyDefine a function that can return a dictionary with fields that are required
by your user model, e.g.USER_DATA_FN = 'django_ssl_auth.fineid.user_dict_from_dnis a sample
implementation that takes the required fields from the DN of a Finnish
government issued ID smart card for thecontrib.auth.models.User.To automatically createUser``sfor all valid certificate holders, set ``AUTOCREATE_VALID_SSL_USERS = True. Auto-created users will be set to
inactive by default, consider using theUser.is_activefield in yourLOGIN_REDIRECT_URLview to notifying the user of their status.For details, seetestapp/ssltest/settings.pyOptional ConfigurationIf you want to use the standard login url, setSSLCLIENT_LOGIN_URL = Noneor leave it undefined.
For cases where you want a seperate login URL for SSL auth, setSSLCLIENT_LOGIN_URL = “/YOUR_URL/”.SSLCLIENT_LOGIN_URLis designed for use cases where some users login via the regular Django login
without using SSLCLIENT auth, but you have a seperate login URL for users that login with SSLCLIENT auth.If you want to allow insecure request (eg. your django app is behind a proxy or load balancer) setSSLCLIENT_ALLOW_INSECURE_REQUEST = True. If not set, secure connection will be required by default.Smart Card supportFor (Finnish) instructions seedoc/fineid/FINEID.mdTODOActive directory integration.How to get helpPlease do ask your questions onhttp://stackoverflow.com/I am active there, and more likely to answer you publicly.
Also, you can try catching TheJoey on#django@freenode
Package: django-sslify-admin
django-sslify-adminForce SSL on your Django admin siteInstallTo installdjango-sslify-admin, simply runpip installdjango-sslify-adminand you’ll get the latest version
installed automatically.UsageModify your Djangosettings.pyfile, and prependsslifyadmin.middleware.SSLifyAdminMiddlewareto yourMIDDLEWARE_CLASSESsetting:MIDDLEWARE_CLASSES=('sslifyadmin.middleware.SSLifyAdminMiddleware',# ...)NOTE: Make suresslify.middleware.SSLifyMiddlewareis the first
middleware class listed, as this will ensure that if a user makes an
unsecure request (over HTTP), they will be redirected to HTTPs before
any actual processing happens. If you plan to use`i18n_patterns<https://docs.djangoproject.com/en/dev/topics/i18n/translation/#django.conf.urls.i18n.i18n_patterns>`__
on admin urls, this middleware needs to be appended AFTER`django.middleware.locale.LocaleMiddleware<https://docs.djangoproject.com/en/dev/ref/middleware/#django.middleware.locale.LocaleMiddleware>`__!Custom admin url?If you are using a custom admin url, you have to setSSLIFY_ADMIN_NAMESPACEin yoursettings.py:# SSLIFY_ADMIN_NAMESPACE = "admin" # defaultSSLIFY_ADMIN_NAMESPACE="myadminurl"# customEnabling/DisablingBy default, the admin is sslfying if settings.DEBUG is False, but for
some reason (ie. local, test suite) you may want remove debugging and not trigger the sslify.
You have to setSSLIFY_ADMIN_DISABLEin yoursettings.py:SSLIFY_ADMIN_DISABLE=TrueBehind a Proxy? (Heroku)If your Django app is behind a proxy (like Heroku), though, the proxy
may be “swallowing” the fact that a request is HTTPS, using a non-HTTPS
connection between the proxy and Django.In this situation, you’ll want to configure the proxy (Heroku already
does that for you) to set a custom HTTP header that tells Django whether
the request came in via HTTPS, and you’ll want to setSECURE_PROXY_SSL_HEADERso that Django knows what header to look
for, like this:SECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO','https')NotesThis code was taken and modified fromthis StackOverflow
thread.
This Project is also influenced by Randall Deggesdjango-sslify, use this,
if you want to secure your whole site, and not only the admin interface
of Django.If you like this project please consider giving me agittip, thanks! :)Tests$gitclonehttps://github.com/return1/django-sslify-admin.git$cddjango-sslify-admin$pythonsetup.pydevelop...$pythonsetup.pytestCreatingtestdatabaseforalias'default'.....----------------------------------------------------------------------Ran2testsin0.003sOKDestroyingtestdatabaseforalias'default'...Licensehttp://return1.mit-license.org/
Package: django-sslserver2
django-sslserver2Django package to support both HTTP and HTTPS as runserver commandUsageInstall this package in you Django projectpipinstalldjango-sslserver2Update Django'ssettings.pyINSTALLED_APPS=(...'django_sslserver2',...)Execute you Django server:pythonmanage.pyrunsslserver--certificatecert.pem--keykey.pemDevelopmentRequirementsPython v3.10.0PipenvUpdaterequirements.txtAs this project uses Pipenv on development, to keep compatibility with other
environments is recommended to generate the correspondingrequirements.txtfile on every integration.Run the following command to generate or overwrite therequirements.txtfile:pipenvlock-r>requirements.txtReleasingInstalltwinepipinstalltwineBuild package distributionpythonsetup.pysdistbdist_wheelUpload distributiontwineupload--repository-urlhttps://upload.pypi.org/legacy/dist/*
Package: django-sslserver-v2
Django SSL Server v2 is a SSL-enabled development server for the Django Framework, a clone ofdjango-sslserver. This project is actively maintained and supports the latest version of Django and Python.Please note that thisshould not be used for production setups. This
app is intended for special use-cases. Most people should instead do a properproduction deploymentwhere a real
webserver such as Apache or NGINX handles SSL.Getting StartedInstall the module in your Python distribution or virtualenv:$ pip install django-sslserver-v2Add the application to yourINSTALLED_APPS:INSTALLED_APPS = (...
"sslserver",
...
)Start a SSL-enabled debug server:$ python manage.py runsslserverand access app onhttps://localhost:8000or start server on specified port:$ python manage.py runsslserver 127.0.0.1:9000IPv6 support:$ python manage.py runsslserver -6 [::]:7443You’ll now be able to access your Django app onhttps://localhost:9000/Browser Certificate ErrorsUsing the default settings, your local browser will make all sorts of noise that itdoesn’t trust the certificate.This is expected.Django SSL Server ships “batteries included” with a self-signed server certificate. With self-signed certificates,
the server is effectively telling the user, “I’m such-and-such server, because I said so”. Whereas, with a commercial
SSL certificate, the server tells the user, “I’m Bank of America, because VeriSign said so (or any other commercial certificate authority).”There are two options for making the certificate warning go away in development:Option 1: Tell your browser to explicitly trust the certificate. You can do this in your browser’s “advanced settings”
tab, by installingsslserver/certs/development.crtas a trusted certificate. The mechanism for this varies from browser to browser.Option 2: Use a certificate from a CA that your browser trusts, for exampleLetsencrypt.
If you have a certificate/key pair from a certificate authority,
you can tell Django SSL Server to use it with the following arguments:$ python manage.py runsslserver --certificate /path/to/certificate.crt --key /path/to/key.keyThird-Party Static File HandlersIf you’re using a wrapper around your WSGI application such as dj_static or WhiteNoise, you probably want to let it handle serving
static files. Otherwise, you may see 404s when requesting static files. You can disable the default behavior by using the--nostaticoption.Getting InvolvedFeel free to open pull requests or issues. GitHub is the canonical location of this project.Special ThanksSpecial thanks to@teddziubafor buildingdjango-sslserverand all thecontributers
Package: django-ssl-slapper
Django SSL Slapper===================Django-SSL-Slapper is a middleware that allows you to set urls to ssl only.  It can also redirects anonymous users off your https service onto your http.  Logged-in users may also be directed to https.Django-SSL-Slapper can also use cache to count the number of login attempts and slap away excessive entries (default more than 20 per minute).  THe user account is temporary locked for a timer period (default 1 minute).  The default settings should disrupt automated attempts for entry without bothering even the quickest users.Installation------------```pip install django-ssl-slapper```Add     ```'ssl_slapper.middleware.ssl_redirect'``` to middleware in your django settings file for redirectionAdd     ```'ssl_slapper.middleware.rate_limit'``` to middleware in your django settings file for rate_limiting.  You will want to enable memcache for this.It is recommended that you set ```SESSION_COOKIE_SECURE = True``` to ensure that your site is secured to use https only for authenticated users.That's it!  The middleware shuld automatically detect your login pages and slap away!SSL_Redirect Settings--------```SSL_SLAPPER_SSL_ONLY_PAGES = (reverse(django.contrib.auth.views.login), [[any admin pages]])``` Add to this list any pages that you want to always redirect to https.```SSL_SLAPPER_SSL_REDIRECT_ANONYMOUS=True```  Set to true to redirect anonymous users to http.```SSL_SLAPPER_SSL_REDIRECT_AUTHENTICATED=True```  Set to true to redirect authenticated users to https.```SSL_REDIRECT_COOKIE= 'logged-in'``` Set to the name you want for the cookie to identify logged-in users```SSL_SLAPPER_SSL_IGNORE_PAGES=None```  Set to a list containing any urls, for examples API url, that should not be redirected.SSL_Rate_Limit Settings--------```SSL_SLAPPER_RATE_LIMIT_PAGES = SSL_ONLY_PAGES``` Add to this list any pages that you want to ratelimit.```SSL_SLAPPER_RATE_LIMIT_MINUTES=1``` = Minutes to wait before login counter is reset```SSL_SLAPPER_RATE_LIMIT_KEY_FIELD='username'```  Field, if present, to track login attemps.  If missing, then will use ip address```SSL_SLAPPER_RATE_LIMIT_MAX_REQUESTS=20``` Set to the maximum number of requests within the RATE_LIMIT_MINUTES before the account will be locked.```SSL_SLAPPER_RATE_LIMIT_CACHE_PREFIX='rl-'``` Cache prefix for rate limit cache
Package: django-ssl-smtp
Django SSL SupportSSL SMTP email backend for Django Web FrameworkVersion: 1.1.0Installationpip install django-ssl-smtpand add following to yoursettings.py:EMAIL_BACKEND = 'django_ssl_smtp.SSLEmailBackend'
EMAIL_HOST = 'mail.example.com'
EMAIL_PORT = 465
DEFAULT_FROM_EMAIL = user@example.com**DEFAULT_FROM_EMAIL **	 is optional, But most of the ssl 	smtp do not allow random sender name.For any kind of bug or update. Request tocontact@himelrana.com