Saravanan666/pypi-org huggingface dataset:
Package: django-secret-parametrizer
=====
Secret ParametrizerStop saving your secrets in files and start parametrizing dynamically
inside django admin.Detailed documentation is in the "docs" directory.Quick startAdd "secret_parametrizer" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'secret_parametrizer',
]Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a param (you'll need the Admin app enabled).Call your params inside your code just get the Queryset.
Package: django-section
Django SectionDjango app for determining site section by request.ContentsDjango SectionInstallationUsageAuthorsChangelogInstallationAddsection.context_processors.sectionto yourTEMPLATE_CONTEXT_PROCESSORSsetting:TEMPLATE_CONTEXT_PROCESSORS = (
    ...other context processors...,
    "section.context_processors.section",
)AddSECTIONSsetting to your settings file in the form:# Tuple of dictionaries used to match URL pattern names to site sections.
# example: ({'name': '<section name>', 'matching_pattern_names': ('<url_name1>', '<url_name2>')},)
SECTIONS = (
    {'name': 'home', 'matching_pattern_names': ('home',)},
)UsageIf you’re using generic views orRequestContextyou’ll now automagically have asectionvariable added to context and available in your templates containing the value ofnameas defined for the current view in yourSECTIONSsetting.NOTE: If the current path can not be resolved to a defined section, the first section as defined in theSECTIONsettings is returned. This allows you to setup a global fallback section, i.e.home.AuthorsPraekelt FoundationShaun SephtonChangelog0.0.2 (2011-08-24)Docs, tests.
Package: django-sections
=======================Ghostery New Generation=======================develop: |BuildStatusDevelop|_ master: |BuildStatusMaster|_-----------------------------------------------------------.. |BuildStatusDevelop| image:: https://ci.revsquare.com/projects/18/status.png?ref=develop.. _BuildStatusDevelop: https://ci.revsquare.com/projects/18?ref=develop.. |BuildStatusMaster| image:: https://ci.revsquare.com/projects/18/status.png?ref=master.. _BuildStatusMaster: https://ci.revsquare.com/projects/18?ref=master
Package: django-secup
# django-secupAllow django users to securely communicating sensitive files over the internet.Only django users which is staff can invite an external user to upload a sensitive file.Ordinary django users can send file with description to the django staff users if have valid emails. If invalid email address is used, secup managers defined in the settings will be notified.Signed urls created to navigates users to secup.## WarningIf we want to securly serve files from Cloud, it is easy. But if we don't use a cloud provider, the best solution requires cooperation of django and web server like X-Sendfile. Other methods not included web servers is not completely secure or should not prefered if the file sizes are large.This application package uses a secure method not included web servers, but it's not ideal way to serve large files expecting high traffic.## Todos- Create a new flow for staff to sends files to external users.- Create a structure to sign files which uploaded by staff with GnuPG.- Write tests with high coverage.## Quick start1. Install the secup module::```shpip install django-secup```2. Add "secup" to your INSTALLED_APPS setting like this::```pythonINSTALLED_APPS = [...'secup',]```3. Include the secup URLconf in your project urls.py like this::```pythonpath('secup/', include('secup.urls')),```4. Run migrations to create the secup models::```shpython manage.py migrate```5. You have to define secup managers in the settings.py, superusers or a tuple of users::```pythonSUPERUSERS_AS_SECUP_MANAGERS = True# orCUSTOM_SECUP_MANAGERS = (('Yusuf Ozer', 'realsby@gmail.com'),)```6. You can set secure media folder in the settings.py, default is 'secure-media' folder::```pythonSECURE_MEDIA_URL_PREFIX = '/secure-media/'SECURE_MEDIA_ROOT = os.path.join(BASE_DIR, 'secure-media/')```7. To send notification mails with signed urls to related users set::```pythonSEND_SECUP_NOTIFICATION_MAILS = True```8. Edit notification email templates if you set true previous setting. All templates included related 'SecureUpload' object as context::- templates/secup/email_invited.html- templates/secup/email_invited.txt- templates/secup/email_managers.html- templates/secup/email_managers.txt- templates/secup/email_uploaded.html- templates/secup/email_uploaded.txt9. Set default timeout for signed urls::```pythonSECUP_LINKS_VALID_SECONDS = 7200  # default is 2 hours```## To Check Locally```shpython manage.py runserver 127.0.0.1:8000```To invite external user to upload file (django staff required):http://127.0.0.1:8000/secup/create-invite/To see files uploaded to you (django user required):http://127.0.0.1:8000/secup/files/To upload files to staff members (django user required):http://127.0.0.1:8000/secup/upload-to-secup/
Package: djangosecure
djangosecureSecure Django settings (Works with
other Python scripts)This module creates a cryptokey outside the django project directory,
encrypts with that cryptokey your django sensible settings and stores
the encrypted values.You can use it at your project settings.py file * Note: Before running
the django site with gunicorn or similar for the first time, you must
run somme manage command to be prompt for the sensible settings *
Developed for Linux/Python2.7, Python3.5InstallLinux required packages: python-dev (python3.5-dev if python==3.5)
libgmp-dev gccpip install djangosecureExamplesSECRET_KEYsettings.pyfrom djangosecure import DjangoSecretKey


SECRET_KEY_FILE_PATH = '/some/path/to/store/file.secret'
secret_key = DjangoSecretKey(SECRET_KEY_FILE_PATH)
SECRET_KEY = secret_key.keyNote: If the secret key file path does not exist it will try to
create it. (write permissio required @SECRET_KEY_FILE_PATH origin)Note: The secret file will be automatically created the first time
you call secret_key.keyThe cryptographic key is stored by default at
~/.private/django_secure.key you can change this by passing
crypto_key_file= to the DjangoSecretKey constructor:secret_key = DjangoSecretKey(SECRET_KEY_FILE_PATH,crypto_key_file='path/to/your/cryptokey')DjangoDatabaseSettings and EncryptedStoredSettings accept
crypto_key_file parameter too.DATABASESThe first time you run python manage.py runserver you will be prompted
for your database settings. They will be saved encrypted with the
generated cryptokey generated by django-secure module.You can have as many database configurations, change the parameter to
change the configuration and runningpython manage.py runserveryou
will be prompted again for the new settingsfrom djangosecure import DjangoDatabaseSettings
databases = DjangoDatabaseSettings(os.path.join(PROJECT_ROOT, 'databases.cnf'), crypto_key_file='path/to/your/cryptokey)

DATABASES = {
    'default': 'default': databases.settings('production'),
}Other settingsTo encrypt any other setting use EncryptedStoredSettings, for example:from djangosecure import EncryptedStoredSettings
encripted_settings = EncryptedStoredSettings('./hidden/settings/path'))

CELERY_BROKER = 'amqp://{0}:{1}@localhost//'.format(
    encripted_settings.get('celery', 'broker_username', config_file="config/file/path/here.cfg"),
    encripted_settings.get('celery', 'broker_password')
    )Runing testsnosetests –with-coverage –cover-htmlnosetests –with-coverage –cover-html –cover-inclusive –cover-package=djangosecureNote: File and path are automatically created at first call
Package: django-secureadmin
Django SecureAdmin==================django-secureadmin is a package for secure your django administration.How It Works ? it save real admin ip , after new logins it check new and last ip. if the last ip and new ip not equeals, it send email to user email and that email has verification code and date and ip of logged in user.in the admin page , user see Login code text field and user shoud enter the login code in that field. then the secureadmin verify that and if it equals login code, then user enters the administration page.compatible with python3Requirements============Django >= 1.7python 2.7 or 3.xInstallation============You can install the latest stable package running this command::$ pip install django-secureadminfor python3 :$ pip3 install django-secureadminConfiguration=============First of all, you must add this project to your list of INSTALLED_APPS insettings.py::INSTALLED_APPS = ('django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites',...'django-secureadmin',...)Next, install the ipcheck middleware::MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','secureadmin.middleware.ipcheck')Run python manage.py syncdb.  This creates the appropriate tables in your databasethat are necessary for operation.Customizing SecureAdmin-----------------------You can customize SecureAdmin Email options and templates ,* SECUREADMIN_MAILSUBJECT : the subject of emails sent from secureadmin , Default : Unusual sign in attempt prevented* SECUREADMIN_MAILFROM : define mail from option. Default : security@localhost* SECUREADMIN_LOGOUTURL : define logout url , user can access it when under login pass code.* SECUREADMIN_TEMPLATE : template for view when unusual login detected. its require for secureadmin work ! - in you template you should created a form , in the form you should have a input named code for login code input. you can check login code true or false. example : {% if errorcore %}<p style="color:red">login code false</p>{% endif %}  -- it login code true , it redirect to admin page.
Package: django-secure-auth
Module which provide secure authentication by TOTP/SMS/Codes/Question.
Login protected by IP ranges and with captcha, when login attempt will fail.Demo installation:$sudoapt-getinstall-yvirtualenvwrapperredis-servergitpython-dev||brewinstallpyenv-virtualenvwrapperredisgitgeoip$source/usr/share/virtualenvwrapper/virtualenvwrapper.sh||source/usr/local/bin/virtualenvwrapper.sh$mkvirtualenvdjango-secure-auth$workondjango-secure-auth$gitclone--depth1https://github.com/gotlium/django-secure-auth.git$cddjango-secure-auth$pipinstall-rrequirements.txt$pythonsetup.pydevelop$cddemo$pipinstall-rrequirements.txt$pythonmanage.pysyncdb--noinput$pythonmanage.pymigrate--noinput$pythonmanage.pycreatesuperuser--usernameadmin--emailadmin@local.host$wgethttp://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz$gunzipGeoLiteCity.dat.gz$mkdir-p/usr/share/geoip/;mvGeoLiteCity.dat/usr/share/geoip/$cd../Open settings:$vimdemo/settings.pyReplace Twilio credentials inAUTH_SMS_BACKEND_AUTHto your demo account settings or change SMS_FORCE to False.Run Redis server and Celery daemon(or remove ‘djcelery’ fromINSTALLED_APPS):$makerun_redis$makerun_celeryRun test server:$makerun_serverNow you can openhttps://127.0.0.1:8000/accounts/register/and register
new account and setup all available authentication methods.Note: activation link will be output to console.CrontabWhen you are using TOTP auth method, please update your server time.
If your server time is behind from real time, user cannot be authenticated by authenticator app.
You can run ntpd clients, or update time on server by cron job:SHELL=/bin/bashPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gamesMAILTO=root@localhost# Update time0*/6***ntpdatentp.ubuntu.com>&/dev/nullScreenshotsCompatibilityPython: 2.7Django: 1.4, 1.8, 1.11
Package: django-securebox
Django SecureBoxDjange SecureBox implementation – encrypts data for a Django User, but allows for transparent access within a SessionFree software: GNU Lesser General Public License v3Documentation:https://django-securebox.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.2 (2018-08-29)Fix missing import.0.1.1 (2018-08-03)Packaging fix: Add missing migrations.0.1.0 (2018-07-29)First release on PyPI.
Package: django-secured-accounts
Accounts is a Django app handles essential user securityEmail verification upon registerPhone is enforced and mandatory “handled by Twilio sms service”Device access location “handled by geoip2 and maxmind db”Activity stream for user accessIndeed it is opinionated user app as follows:User class is AbstractUser has a Profile foreign keyProfile with has fields like photo and date_of_birthCheck the docs for deep details.Quick startAdd “accounts” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'accounts',
]

TEMPLATES = [
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': ['accounts/templates'],
    ...
}]Include the accounts URLconf in your project urls.py like this:path('accounts/',
include(('accounts.urls', 'accounts'), namespace='auth'))Note: mind the namespace as it is used in templates and testing.Set mandatory settings:# refers to the user model
AUTH_USER_MODEL = 'accounts.User'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = '/media/'
# this is on-demand auth backends
AUTHENTICATION_BACKENDS = [
    'accounts.authentication.EmailAuthBackend',
    'accounts.authentication.PhoneAuthBackend',
    'accounts.authentication.UsernameAuthBackend',
]
# your favorite email backend
# just for testing it is set to console
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# maxmind db required
# follow https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geoip2/
GEOIP_PATH = os.path.join(BASE_DIR, 'path/to/maxmind/db')

# Twilio required sms validation
# get keys from https://www.twilio.com/
TWILIO_API_KEY = ""
TWILIO_AUTH_TOKEN = ""
TWILIO_PHONE_NUMBER = ""Runpython manage.py migrateto create the accounts models.Start the development server and visithttp://127.0.0.1:8000/accounts/login/Full documentation onhttps://django-secured-accounts.readthedocs.io/
Package: django-secureform
ASmartFileOpen Source project.Read moreabout how SmartFile
uses and contributes to Open Source software.IntroductionProvides protection against spammers and scammers.InstallationInstall using pippip install django-secureformThen install the application into your Django project in settings.py. There are also optional settings
which will affect the behavior of SecureForm instances.INSTALLED_APPS += ('django_secureform', )

# If you wish to use an encryption key other than Django's SECRET_KEY
SECUREFORM_CRYPT_KEY = 'super-secret encryption key'

# This is the name of the hidden field added to the form to contain
# security data.
SECUREFORM_FIELD_NAME = 'foobar'

# The number of seconds allowed between form rendering and submittal.
SECUREFORM_TTL = 300

# The number of honeypot fields added to the form.
SECUREFORM_HONEYPOTS = 1

# By default, jQuery is needed to hide honeypots. If you already
# use jQuery in your app, you can disable this feature (preventing
# a duplicate script reference to jQuery).
SECUREFORM_INCLUDE_JQUERY = FalseUsagefrom django_secureform.forms import SecureForm


# Define your form class as usual.
class MySecureForm(SecureForm):
    class Meta:
        # Override options in settings.py for this class.
        include_jquery = False

    name = forms.CharField()Unit TestingIf you want to write unit tests for forms that derive from SecureForm, you will
need to let this application know you are testing. SecureForm looks for
settings.TESTING to evaluate to True. If so, it disables the security allowing
the Django test client to send POST data using the original field names.In the future, I would rather provide tools so that testing can happen with
security enabled, but this is a quick workaround. Our test framework uses an
environment variable to set settings.TESTING. For example, in settings.py…import os

TESTING = True if 'TESTING' in os.environ else False
Package: django-secure-input
Let your users input html into your textareas without losing any sleep.
django-secure-input sanitizes user’s input and allows only some tags to be
interpreted as html and escapes the rest. By default, <script> tags are not allowed.Requirements/Installingdjango-secure-input requires Python 2.6-2.7 or 3.2+. It also requires Django >= 1.4
and bleach.The easiest way to install django-secure-input is usingpip:pip install django-secure-inputThe add it to your install apps:INSTALLED_APP += ('secure_input')FieldsUse one of our provided custom form fields in your forms and you are all set.SafeCharFieldInputTextarea that allows saving html.WYSIWYGFieldwysiwyg widgetMiniWYSIWYGFieldwysiwyg widget (limiited tools)Defaults settingsThe defaults provided
by our validation method can be overwritten, to set your own overwrite this on
your settings.py file:ALLOWED_TAGS:       Tuple of allowed tags, for example: (‘p’, ‘h2’, ‘h3’).ALLOWED_STYLES:     Tuple of inline style allowable in your html, forexample: (‘font’, ‘font-size’, ‘color’).ALLOWED_ATTRIBUTES: A dict of tags -> attributes, for example:{‘a’: [‘href’, ‘title’], ‘*’: [‘class’]}ExampleSimplest way to start using our custom fields:from django import forms
from secure_input.fields import MiniWYSIWYGField

class MySecureForm(forms.ModelForm):
    text = MiniWYSIWYGField()

    class Meta:
        model = MyModelTemplateMake sure to include the following css and js files in the template where you
are rendering your form.In your template {{ form.media.css }}:- <link href="{{ STATIC_URL }}secure_input/bootstrap/css/bootstrap.css" rel="stylesheet" type="css/text">
- <link href="{{ STATIC_URL }}secure_input/font-awesome/css/font-awesome.css" rel="stylesheet" type="css/text">
- <link href="{{ STATIC_URL }}secure_input/css/basicEditor.css" rel="stylesheet" type="css/text">and {{form.media.js }}:- <script src="{{ STATIC_URL }}secure_input/js/libs/jquery.js" type="text/javascript"></script>
- <script src="{{ STATIC_URL }}secure_input/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
- <script src="{{ STATIC_URL }}secure_input/bootstrap-wysiwyg/external/jquery.hotkeys.js" type="text/javascript"></script>
- <script src="{{ STATIC_URL }}secure_input/bootstrap-wysiwyg/bootstrap-wysiwyg.js" type="text/javascript"></script>
- <script src="{{ STATIC_URL }}secure_input/js/plugin.js" type="text/javascript"></script>Finally, you need to initialize the js plugin:$("#commentForm").secureInput();DocumentationAdditional documentation on using django-secure-input is available onRead The Docs.Running the TestsYou can run the tests with via:python setup.py testor:python runtests.pyLicensedjango-secure-input 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-secure-input on Github.Development sponsored byRochApps, LLC.
Package: django-secure-passwords
TodoInstallationdjango-secure-passwords is currently available only on Blueshoe's Python Package Index.pip3installdjango-secure-passwordsAdd"django-secure-passwords"to yourINSTALLED_APPS:INSTALLED_APPS=["...","securepasswords",]UsageTODO prettifyRecommended: usage ofAbstractBaseUsersubclass asAUTH_USER_MODEL
Package: django-security-keys
django-security-keysDjango webauthn security key supportAllows using webauthn for passwordless login and two-factor authentication.2FA integration requires django-two-factor-auth and is handled by extending a custom django-otp device.ChangesThe current change log is available athttps://github.com/20c/django-security-keys/blob/master/CHANGELOG.mdLicenseCopyright 2021-2023 20C, LLCLicensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: django-security-patch
About PackageThis Repo with include all security patches,
That can be used to make django more secure against existing vulnerabilities.NoteThis repo is not fully updated yet.InstallationInstall from Python packages repository:pip install django-security-patchAdding to Django Applications'ssettings.pyfile:INSTALLED_APPS = (
    ...
    'django_security_patch',
)After Django 1.10, middleware modules can be added to MIDDLEWARE list in settings file:MIDDLEWARE = [
    ...
    'django_security_patch.middleware.QueryStringsSanitizer'
]For Pre-Django 1.10, middleware modules can be added toMIDDLEWARE_CLASSESinsettings.pyfile.DescriptionOne the leading vulnerabilities in current web application isTemplate Injeciton. For example
When u are using aa javascript library like Angularjs, You should be careful that data reflected
from user (from search box for example) will not be rendered in the context that there is another
template handler (like angularjs) which will lead toTemplate Injection.for example user sends[[test]]via search box of django. this will of course will not create
any vulnerability for django, but if this value is rendered in template and there is angularjs,
it will give attacker to do some Client-side Attacks.Usagejust install package and add this in your settings.py file:QUERY_REMOVE_STRINGS = ['{{', '}}', '[[', ']]']From now on, any query string in request.GET that includes this characters, will be replaced.
Package: django-security-txt
django-security-txt is a Django reusable application to handle security.txt (http://securitytxt.org/)ContentsInstallationConfigurationSettingsAdvanced featuresContributingLicensingContactsInstallationObtain your copy of source code from the git repository:$ git clonehttps://github.com/vint21h/django-security-txt.git. Or download the latest release fromhttps://github.com/vint21h/django-security-txt/tags/.Run$ python ./setup.py installfrom the repository source tree or the unpacked archive. Or use pip:$ pip installdjango-security-txt.ConfigurationAdd"security_txt"tosettings.INSTALLED_APPS:# settings.pyINSTALLED_APPS+=["phonenumber_field","security_txt",]Add"security_txt"to your URLs definitions:# urls.pyfromdjango.urlsimportre_pathurlpatterns+=[re_path(r"^.well-known/security\.txt",include("security_txt.urls")),]SettingsSECURITY_TXT_EXPIRESIndicates the date and time after which the data contained in the “security.txt” file is considered stale and should not be used. Defaults toNone.SECURITY_TXT_PREFERRED_LANGUAGESUsed to indicate a set of natural languages that are preferred when submitting security reports. Defaults toNone.SECURITY_TXT_SIGNSign “security.txt” using PGP. Defaults toFalse.SECURITY_TXT_SIGNING_KEYPath to PGP key. Defaults to"".Advanced featuresIf you want to sign your “security.txt”:Installdjango-security-txtwith additional dependencies:$ pip installdjango-security-txt[pgp].Configure:# settings.pySECURITY_TXT_SIGN:bool=TrueSECURITY_TXT_SIGNING_KEY:str="/path/to/key.asc"ContributingFork itInstallGNU MakeInstall and configurepyenvandpyenv-virtualenv pluginInstall and configuredirenvCreate environment config from examplecp.env.example.envInstall development dependencies:makeinstallCreate your fix/feature branch:gitcheckout-bmy-new-fix-or-featureCheck code style and moreover:makecheckRun tests:maketestPush to the branch:gitpushoriginmy-new-fix-or-featureCreate a new Pull RequestLicensingdjango-security-txt is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (a
t your option) any later version.
For complete license text see COPYING file.ContactsProject Website:https://github.com/vint21h/django-security-txt/Author: Alexei Andrushievich <vint21h@vint21h.pp.ua>For other authors list see AUTHORS file.