Saravanan666/pypi-org huggingface dataset:
Package: django-settings-manager
Settings ManagerThis project provides a simple and extensible strategy for managing Django settings.Settings file formatThere are three main sections:configure- This is intended to be set up before most processing in settings.py, and should mostly be used to enable/disable built-in features. For example, settings.py might configure remote user auth if ENABLE_REMOTE_USER_AUTH is true.override- This is used to override settings.py.  Use this section for database settings and other more complex configurations that are environment specific.inject- This is used to override values using one of the built-in fuctions, or any user-defined function that is made available.Example settings.py fileimportsysimportosfromsettings_managerimportSettingsManagersettings_manager=SettingsManager(os.environ.get("DJANGO_SETTINGS_FILE","/etc/django-settings.yaml"))# Defaults for configurable itemsENABLE_REMOTE_USER_AUTH=FalseENABLE_MODEL_AUTH=False# Configure settings managersettings_manager.configure(sys.modules[__name__])# Set the module's base directoryBASE_DIR=os.path.dirname(os.path.dirname(os.path.realpath(__file__)))INSTALLED_APPS=['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',]AUTHENTICATION_BACKENDS=['django.contrib.auth.backends.ModelBackend'ifENABLE_MODEL_AUTHelseNone,'shibboleth.backends.ShibbolethRemoteUserBackend'ifENABLE_REMOTE_USER_AUTHelseNone,]# ... other configuration ...# Rebuild AUTHENTICATION_BACKENDS to remove null valuesAUTHENTICATION_BACKENDS=[mforminAUTHENTICATION_BACKENDSifmisnotNone]settings_manager.override(sys.modules[__name__])Sample configuration (YAML) fileinject:DATABASES.default.password:function:get_envargs:[DJANGO_DATABASE_PASSWORD]DEBUG:function:get_envargs:[DJANGO_DEBUG]value_processors:-function:str_to_boolargs:['<<value>>']configure:ENABLE_REMOTE_USER_AUTH:trueoverride:DATABASES:default:username:djangoname:djangohost:dbport:5432password:~# will be replaced by injected value.
Package: django-settings-model
Settings ModelDocumentation:https://django-settings-model.readthedocs.ioSource:https://github.com/gregschmit/django-settings-modelPyPI:https://pypi.org/project/django-settings-model/This Django reusable app implements a baseSettingsModelclass to allow settings to
be edited and saved in the database. For any particular project, you probably want to
customize which settings are exposed, so while there is aSettingsexample
implementation that you can use, the abstract modelSettingsModelcan be used to
construct your own settings model(s), and things like webserver restarts are handled in
the abstract model class.The Problem: Sometimes you want to build an app that can be managed by
non-developers, and things like timezone, hostname, or SMTP settings may need to be
editable from the UI.The Solution: This app implements a baseSettingsModelclass that allows you to
expose settings to a user interface via the database. It writes these stub settings to
separate files which you try/include at the end of your main settings file. This way
you have sensible defaults, but when the user created/edits a model file in the UI,
those settings override. There is a mechanism to touch thewsgi.py/manage.pyfiles when saving, so the only thing left to do is either configure your web server to
watch those files and reboot when they are touched, or use a tool likeincrondto
watch those files and trigger your webserver to reboot when they are touched.How to Use$pipinstalldjango-settings-modelYou can use the builtinSettingsmodel by including this app (settings_model) in
yourINSTALLED_APPSand running migrations, or you can create your own custom
settings model, inheriting fromsettings_model.base.SettingsModel. If you want to
build a custom settings Model, use theSettingsmodel as a reference implementation.For the includedSettingsmodel, you need to add the following to the end of yoursettings.pyfile:try:from.model_settingsimport*except:passIf you create a custom Settings model, then ensure you set the__settings_filename__appropriately (avoid conflicts with other settings models), and ensure you call its.init()class method in the application’sAppConfig.ready()method. This will
update the settings with the true values (and optionally create an initial settings
model instance) on startup.SettingsSETTINGS_MODEL_REBOOT_FILES(default[]): This is a list of files that should
be touched when the settings model is saved to signal to the webserver to reboot. If
it is falsy, then the system will try to find and touch the fileBASE_DIR/manage.pyand thewsgi.pyfile defined byWSGI_APPLICATION.ContributingSubmit a pull request if you would like to contribute. You must only contribute code
that you have authored or otherwise hold the copyright to, and you must make any
contributions to this project available under the MIT license.
Package: django-settings-startup
See your chosen settings on standard output when django is starting withrunservercommand with
an additional CLI option.For Django 1.8.5 and Python 2.7, 3.2, 3.3, 3.4.Latest python package informationOther informationUsageOnce installed, using this command:python manage.py runserver --configAdditional CLI Options--configShow your settings on standard output.Please seepython manage.py runserver--helpfor more information additional options.InstallDownload package:pip install django-settings-startupAdd “django_settings_startup” in first rank to your INSTALLED_APPS settings like this:INSTALLED_APPS = [
    'django_settings_startup',
    ...
]It is important to install this app in first (before native django apps), to override the commandrunserver.VersionSeeVERSION.ChangelogSeeCHANGELOG.Read The Docs : Documentationhttp://django-settings-startup.readthedocs.org/en/2.x/GitHub : Source Codehttps://github.com/glegoux/django-settings-startup/PyPI : open source Python packageshome page:https://pypi.python.org/pypi/django-settings-startupranking:http://pypi-ranking.info/module/django-settings-startupTravis CI : continous integrationhttps://travis-ci.org/glegoux/django-settings-startupCoveralls : code coveragehttps://coveralls.io/github/glegoux/django-settings-startupUseful linkshttps://github.com/django/django/blob/stable/1.8.x/django/core/management/commands/runserver.pyhttps://github.com/django/django/blob/stable/1.8.x/django/core/management/base.pyhttps://github.com/django/django/blob/stable/1.8.x/django/core/management/commands/testserver.pyhttps://docs.djangoproject.com/en/1.8/howto/custom-management-commands/https://docs.djangoproject.com/en/1.8/ref/django-admin/#running-management-commands-from-your-codeLicenseSeeLICENSE.
Package: django-settings-view-as-json
# django-settings-view-as-jsonView Django Settings via URL[![Latest PyPI version](https://img.shields.io/pypi/v/django-settings-view-as-json.svg)](https://crate.io/packages/django-settings-view-as-json/)[![Number of PyPI downloads](https://img.shields.io/pypi/dm/django-settings-view-as-json.svg)](https://crate.io/packages/django-settings-view-as-json/)![](/screenshot.png?raw=true)## WhyBecause sometimes its confusing what settings are in use in your staging environments etc.## Features* Recursively nulls out any sensitive key values (eg passwords)## Install```pythonpip install django-settings-view-as-json```## Usage```pythonfrom django_settings_view_as_json import settings_viewurl(r'^settings/$', settings_view.as_view(), name='settings'),```## Security WarningI highly recommend limiting this URL to either non production environments or at least Super user's. Eg```pythonfrom django.contrib.auth.decorators import user_passes_testfrom django_settings_view_as_json import settings_viewurl(r'^settings/$', user_passes_test(lambda u: u.is_superuser)(settings_view.as_view()), name='settings'),```## JSON In BrowserI recommend [Chrome JsonView Plugin](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc)## TODO* Make sensitive key list a setting## Changelog* 0.0.8 pip 10 compatibility* 0.0.7 Fix serialisation of classes* 0.0.6 Fix issue with deep cloning (fallback to shallow)
Package: django-setty
django-settyDjango-Setty allows you to dynamically change settings inside the Django Admin Console.
The app provides both a database and a cache backend for storing and retrieving your settings.RequirementsPython 3.6+Django 2.0+Continuous integration currently tests Django >= v2.Installationpip install django-settyDjango ConfigurationAddsettyto the list of INSTALLED_APPS in your Django settings:INSTALLED_APPS = [
    ...
    'setty'
]Create the Setty database table by runningpython manage.py migrateSpecify the backend to use using theSETTY_BACKENDsetting.
The valid backend values are'DatabaseBackend'and'CacheBackend'.'DatabaseBackend'always accesses the database when retrieving settings.'CacheBackend'only accesses the database if the item is not in the cache, and caches the value once retrieved.Define the length of time settings should be cached for using the SETTY_CACHE_TTL setting. The default cache TTL is
one hour.SETTY_BACKEND='CacheBackend'SETTY_CACHE_TTL=60# 60 secondsUsage ExamplesOpen the Django admin console at /admin and openSetty Settings.
Here, you will see the list of all settings defined in Setty.To add a new setting, click theaddbutton.Enter the setting name, type (String, Integer, Float, Boolean, List, Dictionary)
and the value. Note, the List and Dict data type expect the data to be in the JSON format e.g.{"a": 1, "b": 2}and[1, 2, 3].Once settings have been created, you will be able to access these in your code.fromsettyimportconfigassertconfig.my_integer==10If the setting does not exist in the database, the value defined in the settingSETTY_NOT_FOUND_VALUEwill be used.
If this is not set,Nonewill be returned.Setty can be used inside Django templates by adding 'setty.context_processors.setty_settings' to theTEMPLATE_CONTEXT_PROCESSORSsetting and accessing it via thesettykey.The value of a setting can also be updated by using the syntax:fromsettyimportconfigconfig.my_integer=100Note: Only settings that already exist in the database can be updated. New settings cannot be added this way.Loading all settings into the CacheIf you use theCacheBackendbackend, you can easily load all settings into the Cache. This is useful if you want to
cache all settings when you start up your app.fromsetty.backendimportCacheBackendCacheBackend().load_all_settings_into_cache()Similar ProjectsThis project was inspired by Django Constancehttps://github.com/jazzband/django-constance
Package: django-setuptest-recipe
Django Setuptest RecipeRecipe to prevent django-setuptest from polluting module being tested with
downloaded eggs.ContentsDjango Setuptest RecipeMotivationUsageAuthorsChangelogMotivationdjango-setuptest downloads eggs required for a test run and places them in the
module directory. For example, if the module to be tested is calledfoothen the commandpython setup.py testcausessrc/footo be polluted
with many eggs. There is currently no way to instruct setuptools to store these
eggs in another location.django-setuptest-recipeaddresses this shortcoming by wrapping the Python
interpreter to be aware of egg locations.UsageAdd the following to yourbuildout.cfg:parts=
    ...
    setuptest-runner

[setuptest-runner]
recipe = django-setuptest-recipe
eggs = ${buildout:eggs}An executable file calledsetuptest-runneris created in thebindirectory. You can now do/path/to/instance/bin/setuptest-runnersetup.py testfrom within thesrc/foodirectory.AuthorsPraekelt FoundationHedley RoosChangelog0.1First release.
Package: django-setup-tool
Django Setup ToolRequirementsPython (3.6, 3.7, 3.8, 3.9, 3.10)Django (2.2, 3.0, 3.1, 3.2, 4.0)Python 과 Django 의 공식적인 최신 릴리즈 버전을 사용하는 것을 권장드립니다.Installationpip를 사용합니다pip install django-setup-toolExample라이브러리 INSTALLED_APP 에 등록INSTALLED_APPS=["django.contrib.admin",..."django.contrib.staticfiles","setup_tool",]앱 등록python manage.py prettystartapp {{ app_name }}
Package: django_seven
Collection of code/tools to help for Django upgrading.
This package name is a reference to python package ‘six’ which was helping compatibility between python 2 and 3.The idea of this package is to share some experience gained from a Django upgrade from 1.4 to 1.9 on a quite big project.
Have a look atDjango Upgrade talkfor more details.
django-seven will at the beginning contain compat module and deprecated rules logic.Deprecated rulesA Django management commandcheck_deprecated_rulesis available to check if your project is “upgrade-compatible”.You should first adddjango_seven.deprecated_rulesto yourINSTALLED_APPS:INSTALLED_APPS = [
    ...
    'django_seven.deprecated_rules',
]Then you should define your current Django version and the version you want to upgrade to in your settings file:SEVEN_CURRENT_DJANGO_VERSION = '1.4'
SEVEN_FUTURE_DJANGO_VERSION = '1.9'Then launch thecheck_deprecated_rulesmanagement command for your project:$ ./manage.py check_deprecated_rules

./core/models.py
1601: models.BooleanField has to be initialised with default parameter,
      as implicit default has changed between Django 1.4 (False) and 1.6 (None).
L6:     boolean_field = models.BooleanField()This command will give you a list of non-respected rules, with useful informations to fix them:The impacted file,The rule number, with an explanation of the rule,The line number, and the line copy.By default,django-sevenis defining some deprecated rules, but you can also define yours in settings file.
You should respect the rule fields:DEPRECATED_RULES = [
    {
        'name': 'deprecated_django_local_flavor_module',
        'message': 'Deprecated django.contrib.localflavor module (now third-party lib). Use localflavor instead.',
        'regex': r'.*django\.contrib\.localflavor.*',
        'number': '1602',
        'should_be_fixed_in': '1.6',
    },
]You can also use thedjango-sevenones and add yours:CUSTOM_RULES = [
    # Your custom rules
]

from django_seven.deprecated_rules.rules import DEPRECATED_RULES as SV_DEPRECATED_RULES
DEPRECATED_RULES = SV_DEPRECATED_RULES + CUSTOM_RULESYou can specify through settings which directories/files you want to exclude from the deprecated rules search:SEVEN_EXCLUDED_DIRS = ['venv', '.git', 'frontend', 'static', 'docs']
SEVEN_EXCLUDED_SUB_PATHS = ['migrations']
SEVEN_EXCLUDED_SPECIFIC_FILE = ['my/specific/file.py']
SEVEN_EXCLUDED_FILE_EXTENSIONS = ['.pyc'][UNDER HEAVY DEVELOPMENT / DESIGN CHOICES]
Package: django-sfp
Django Sfp==========Serve flat pages for a Vuejs frontend* **Fast**: no database hits* **Safe**: keep the pages in a version control system* **Friendly**: edit the pages in an IDE* **Cache**: client-side cache thanks to [Apollo client](https://www.apollographql.com/)Installation------------``pip install django-sfp``Configuration-------------1. Add ``"sfp",`` to your ``INSTALLED_APPS``2. Declare the graphql schema in settings:```pythonGRAPHENE = {'SCHEMA': 'sfp.schema.schema',}```3. Add the graphql endpoint url:```pythonfrom django.views.decorators.csrf import csrf_exemptfrom graphene_django.views import GraphQLViewurlpatterns = [# ...url(r'^graphql', csrf_exempt(GraphQLView.as_view())),]```4. Install the frontend:Grab the `Page.vue` component:```bashwget https://raw.githubusercontent.com/synw/django-sfp/master/frontend/src/components/Page.vue```Install the dependencies:```npm install --save vue-apollo // or vue add apollo if you use vue-clinpm install --save @fortawesome/fontawesome-svg-corenpm install --save @fortawesome/free-solid-svg-iconsnpm install --save @fortawesome/vue-fontawesome```Font-Awesome is for the spinner loading icon (only this icon will be included in the build,not the whole lib). Vue-router must be installed5. Add a frontend generic route:```javascriptimport Page from './path/to/my/components/Page.vue'routes: [// ...{path: '*',name: 'Page',component: Page},],```To make links: ``<router-link :to="{ name: 'Page', params: { 0: '/myurl' }}"></router-link>``Usage-----Create a ``pages`` in the Django project static directory. Any html file you include there will get served asa static page.For example::* The url ``/about/`` will render ``static/pages/about.html``* The url ``/about/team/`` will render ``static/pages/about/team.html``Note: the first line of each file is the title of the page: ex:```htmlMy page title<div>My page content</div>```Edit pages online-----------------To edit pages at runtime you can use [django-dirtyedit](https://github.com/synw/django-dirtyedit)
Package: django-sftp
Django SFTP [WIP]FeaturesTODORequirementsTODOGetting StartedInstall django-sftp by pip.$pipinstalldjango-sftpAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_sftp',...)Migrate app.$./manage.pymigrateCreate user account.$./manage.pycreatesuperuser--usernameuserCreate SFTP user group.$./manage.pycreatesftpusergrouptestCreate SFTP account.$./manage.pycreateftpuseraccountusertestGenerate RSA key$ssh-keygen-trsa-b4096-C"your_email@example.com"-mPEMRun SFTP server$./manage.pysftpserver:11121-krsaUsageTODOContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of the MIT_ license,Django SFTPis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsMIT:http://opensource.org/licenses/MITfile an issue:https://github.com/vahaah/django-sftp/issuespip:https://pip.pypa.io/Contributor Guide: CONTRIBUTING.rst
Package: django-sgapi
A Django email backend for the SendGrid APIInstallationInstall the backend from PyPI:pipinstalldjango-sgapiAdd the following to your project’ssettings.py:EMAIL_BACKEND="sgbackend.SendGridBackend"SENDGRID_API_KEY="Your SendGrid API Key"Done!Examplefromdjango.core.mailimportsend_mailfromdjango.core.mailimportEmailMultiAlternatives# Send a simple messagesend_mail('Hello there!','Emails are the future!','Jay Hale <jay@jtst.io>',['hello@sink.sendgrid.net'])# Send a more complex messagemail=EmailMultiAlternatives(subject='Hello there again!',body='Who knew you could do so many things with email?!?',from_email='Jay Hale <jay@jtst.io>',to=['hello@sink.sendgrid.net'],)mail.reply_to='No Reply <no-reply@sink.sendgrid.net>'mail.template_id='marketing_template_5'mail.substitutions={'%organization%':'jtstio'}withopen('flyer.pdf','rb')asfile:mail.attachments=[('flyer.pdf',file.read(),'application/pdf')]mail.attach_alternative("<p>Who knew you could do <strong>so many things</strong> with email?!?</p>","text/html")mail.send()Attributionsendgrid-django-v5: An
alternative implementation you should check outsendgrid-django: Basis for this
implementationsendgrid-python: Python
SendGrid connectorLicenseMITEnjoy :)
Package: django-sh
django-shDjango shellInstallationpip install django-shAdd django-sh to INSTALLED_APPSINSTALLED_APPS = [
    # ...
    "sh",
    # ...
]Add the urlsfrom django.urls import include

urlpatterns = [
    # ...
    path('sh/', include('sh.urls')),
    # ...
]Migratepython manage.py migrateInfoIn order to modify this app, you would need to create a new project and install this app on it to be able to run it, after that you need to include the django_sh into the INSTALLED_APPS and also the URLS to the project.Create a superuserLogin into django admin, once you log in go to the url you asigned.
Package: django-shapefileimport
# Django-shapefileimportGeoDjango includes a helper function to import ESRI shapefiles to PostGIS enabled DB:  [LayerMapping]
It works as intended but it’s still a boring process. Moreover, the usual importing procedure means creating new migrations for each imported shapefile. This is problably OK for sparse importings of a couple of shapefiles. But as I needed to manage many shapefiles and/or keep adding/deleting them it doesn’t sounded to me very sane to keep afecting migration files (and migration history).
This APP proposes an alternative to manage such shapefiles:
- Adds shapefile ZIP import option in admin page. Imports will include feature fields.
- Loads shapefiles by name on demand without touching migrations (so you can use all nice GeoDjango API features)
- Delete shapefiles from admin panel
- Option to keep or discard uploaded ZIP files while importing to DB## Installation
Clone this repo:`sh git clonehttps://github.com/Rodrigo-NH/django-shapefileimport`Enter the ‘django-shapefileimport’ directory, install de dependencies, enter shell and start a new project (For simplicity I reccomend keeping the ending dot at the django-admin startproject command, it makes project folder to be created at same level as the APP [not nested])`sh pipenv install pipenv shelldjango-adminstartproject mysite . `edit ‘./mysite/settings.py’ and add to INSTALLED_APPS:`sh 'django.contrib.gis', 'shapefileimport' `Still at ‘./mysite/settings.py’, configure the database connection:`py DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': 'shapeimportsDB', 'USER': 'geo', 'HOST': '192.168.0.40', 'PORT': '5432', 'PASSWORD': 'dbpassword', #'CONN_MAX_AGE': 0, }, } `Run migrations, create superuser and start the APP:`sh python manage.py makemigrations python manage.py migrate python manage.py createsuperuser python manage.py runserver `It must be done at this point. Enter admin panel and start importing your shapefiles.
After importing, use ‘loadShape()’ function to load the shapefile and use. Example:`sh from shapefileimport.shapetasks import loadShape from django.core.serializers import serialize ds =loadShape('MyShapeName')ff =serialize('geojson',ds.objects.all(),geometry_field='geom',)`## Notes
- You must have a propper GeoDjango setup environment, refer tohttps://docs.djangoproject.com/en/3.2/ref/contrib/gis/- You must have PostGIS enabled, refer tohttps://postgis.net/install/- This APP uses GeoDjango’s LayerMapping helper to extract fields among other operations
- Only tested against PostreSQL[LayerMapping]:https://docs.djangoproject.com/en/3.2/ref/contrib/gis/layermapping/