Saravanan666/pypi-org huggingface dataset:
Package: django-dynamodb2-sessions
django-dynamodb2-sessions=========================:Info: Sessions backend dedicated for Django uses Amazon `DynamoDB`_ v.2 for data storage.:Author: Justine ŻarnaIf You need backend uses Amazon DynamoDB v. 1 see `Greg Taylor github`_.. _DynamoDB: http://aws.amazon.com/dynamodb/.. _Greg Taylor github: https://github.com/gtaylor/django-dynamodb-sessionsFirst step: create DynamoDB Table--------------------------Visit your `DynamoDB tab`_ in the AWS Management Console and follow instructions:* Choose the *Create Table* option.* Enter your sessions table name (example: ``sessions``).* Select Primary Key Type = ``Hash``.* Select Hash Attribute Type as ``String``.* Enter ``session_key`` for *Hash Attribute Name*.* Choose the *Continue* option twice.* Fill Provisioned Throughput Capacity (only for tests: ``read`` - 10 units, ``write`` - 5 units).* Choose the *Continue* option.* Choose the *Create* option... _DynamoDB tab: https://console.aws.amazon.com/dynamodb/homeSecond step: installation-------------Install django-dynamodb2-sessions using ``pip``::pip install django-dynamodb2-sessionsExport your AWS key and secret key as environment variables because of security::export AWS_ACCESS_KEY_ID='YourKey'export AWS_SECRET_ACCESS_KEY='YourSecretKey'export AWS_REGION_NAME = 'YourRegion'In your ``settings.py`` file, you'll need set variables::import osAWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', '') # set Your AWS keyAWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', '') # set Your AWS secret keyAWS_REGION_NAME = os.environ.get('AWS_REGION_NAME', '') # set Your AWS regionDYNAMODB_SESSIONS_TABLE_NAME = '' # set Your sessions table nameSet your session backend to::SESSION_ENGINE = 'dynamodb_sessions.backends.cached_dynamodb'or::SESSION_ENGINE = 'dynamodb_sessions.backends.dynamodb'Optional you can set always consistent parametr.If you are not using cache to this sessions backend you can force all reads from Dynamodb by setting True.Default: False::DYNAMODB_SESSIONS_ALWAYS_CONSISTENT = FalseVersions-------0.1^^^* Initial release.0.3^^^* Added removing expired sessions command management.0.2^^^* Added new version of boto to requirementsLicense-------django-dynamodb2-sessions is licensed under the BSD License.
Package: django-dynamodb-cache
django-dynamodb-cacheFast, safe, cost-effective DynamoDB cache backend for Djangodjango-dynamodb-cacheIntroduceWhy should I use this?InstallationSetup on DjangoAws credentialsCreate cache table commandFuture improvementsHow to contributeDebugIntroduceThis project is a cache backend using aws dynamodb.This is compatible with the django official cache framework.Did you set the boto3 permission?Enter the django official command createcachetable and get started easily.Why should I use this?There are few management points, because dynamodb is a fully managed service.Because you only pay for what you use, it saves money on light projects such as side projects or back offices.If you need more performance, you can easily switch to DAX.Installationpipinstalldjango-dynamodb-cacheSetup on DjangoOn Djangosettings.pyINSTALLED_APPS=[..."django_dynamodb_cache"]CACHES={"default":{"BACKEND":"django_dynamodb_cache.backend.DjangoCacheBackend","LOCATION":"table-name",# (mandatory)"TIMEOUT":300,# (optional) seconds"KEY_PREFIX":"django_dynamodb_cache",# (optional)"VERSION":1,# (optional)"KEY_FUNCTION":"path.to.function",# (optional) f"{prefix}:{key}:{version}""OPTIONS":{"aws_region_name":"us-east-1",# (optional)"aws_access_key_id":"aws_access_key_id",# (optional)"aws_secret_access_key":"aws_secret_access_key",# (optional)"is_on_demand":False,# (optional) default: True"read_capacity_units":1,# (optional)"write_capacity_units":1,# (optional)"encode":"django_dynamodb_cache.encode.PickleEncode"# (optional)}}}Aws credentialsThe same method as configuring-credentials provided in the boto3 documentation is used.https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentialsCreate cache table commandRun manage command to create cache table on Dynamodb before usingpythonmanage.pycreatecachetableFuture improvementsIn this project, the following can be improved in the future.A full scan is included to achievecache.clear().
This can lead to performance degradation when there is a lot of cached data.How to contributeThis project is welcome to contributions!Please submit an issue ticket before submitting a patch.Pull requests are merged into the main branch and should always remain available.After passing all test code, it is reviewed and merged.DebugTests must be run in a sandbox environment.To run the Dynamodb sandbox:docker compose up --build
Package: django-dynamodb-sessions
Info:This package contains a simple Django session backend that uses
Amazon’sDynamoDBfor data storage.Author:Greg TaylorStatusdjango-dynamodb-sessions has seen some use on small test environments within
EC2. While it should be ready for prime time, it hasn’t been heavily battle
tested just yet. Other notes:There is currently no management command to remove expired sessions. We
can’t re-use the Django cleanup command, so we’ll have to write our own.
This will be added in the next release, we’re already setting expiration
attributes to drive the cleanup.Set up your DynamoDB TableBefore you can use this module, you’ll need to visit yourDynamoDB tabin the AWS Management Console. Then:Hit theCreate Tablebutton.Entersessionsas your table name. This can be something else, you’ll
just need to adjust thesettings.DYNAMODB_SESSIONS_TABLE_NAMEvalue
accordingly.Select Primary Key Type =Hash.Select aStringhash attribute type.Entersession_keyforHash Attribute Name.Hit theContinuebutton.Decide on throughput. The free tier is 10 read capacity units, 5 write.Finish the rest of the stepsAfter your table is created, you’re ready to install the module on your
Django app.InstallationInstall django-dynamodb-sessions usingpiporeasy_install:pip install django-dynamodb-sessionsIn yoursettings.pyfile, you’ll need something like this:DYNAMODB_SESSIONS_AWS_ACCESS_KEY_ID = 'YourKeyIDHere'
DYNAMODB_SESSIONS_AWS_SECRET_ACCESS_KEY = 'YourSecretHere'If you’d like to add a caching layer between your application and DynamoDB
to reduce queries (like Django’s cached_db backend), set your session
backend to:SESSION_ENGINE = 'dynamodb_sessions.backends.cached_dynamodb'Otherwise, go straight to DynamoDB:SESSION_ENGINE = 'dynamodb_sessions.backends.dynamodb'After that, fire her up and keep an eye on your Amazon Management Console
to see if you need to scale your read/write units up or down.If you encounter any bugs, have questions, or would like to share an idea,
hit up ourissue tracker.ConfigurationThe following settings may be used in yoursettings.py:DYNAMODB_SESSIONS_TABLE_NAME:The table name to use for session data storage.
Defaults tosessions.DYNAMODB_SESSIONS_TABLE_HASH_ATTRIB_NAME:The hash attribute name on your
session table. Defaults
tosession_keyDYNAMODB_SESSIONS_ALWAYS_CONSISTENT:If you’re not using this session backend
behind a cache, you may want to force all
reads from DynamoDB to be consistent.
This may lead to slightly slower queries,
but you’ll never miss object
creation/edits. Defaults toTrue.DYNAMODB_SESSIONS_AWS_ACCESS_KEY_ID:The access key for the AWS account
to use for DynamoDB.DYNAMODB_SESSIONS_AWS_SECRET_ACCESS_KEY:The secret for the AWS account
to use for DynamoDB.DYNAMODB_SESSIONS_AWS_REGION_NAME:The region to use for DynamoDB.Changes0.6Removing some no longer used imports.PEP8 cleanup.0.5Replacing self.session_key with self._session_key in the backend. (AdamN)0.4Django 1.4 compatibility, and unnecessary code removal. (AdamN)0.3Re-packaging with setuptools instead of distutils.0.2Correcting an issue with the cached_dynamodb backend.0.1Initial release.Licensedjango-dynamodb-sessions is licensed under theBSD License.
Package: django-dynasite
=====Usage=====django-dynasite was developed to:* manage multiple sites in a single Django appInstallation============Available on PyPi::pip install django-dynasiteConfiguration=============Add to your installed apps in your setting.py file::INSTALLED_APPS = (...'dynasite',)Get the Site from SITE_ID or host name=============django.contrib.sites.models.get_current_site ReplacementInstead, use:from dynasite.models import get_current_site...site = get_current_site(request)Will fetch the site from the SITE_ID setting if defined. Otherwise, will try to match the hostname to a domain defined in django.contrib.sites.models.Site. Caching is used.Add site variables to context to use in your Web app templates=============Simply add this middleware to your settings:TEMPLATE_CONTEXT_PROCESSORS = (...'dynasite.context_processors.dynasite_context_processor',...)Then, in your template, you have access to the 'dynasite' variable:dynasite.site  -> returns the current sitedynasite.site_url  -> returns the current site's complete url. Takes into account if in secure mode or not.Replace cache middleware to take into account varying host names=============By default, Django uses the full path of pages when creating keys for caching. However, it doesn't take into account the full URI when building the keys. If page templates change by host name, change your caching middleware:MIDDLEWARE_CLASSES = ('dynasite.middleware.UpdateCacheMiddleware',...'dynasite.middleware.FetchFromCacheMiddleware',...LICENSE=======Copyright (c) 2013 Jerome Paradis and contributorsPermission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use,copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the followingconditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIESOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.
Package: django-dyncss
Django DynCSSis an extension
toDjangowhich adds the possibility
to store css files in the Django DB with simple versioning.InstallationInstall the latest version from pypi.python.org:pip install django-dyncssInstall the development version by cloning the source from github.com:pip install git+https://github.com/jcolot/django-dyncss.gitConfigurationAdd the package to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'dyncss',
)Add the url path in your main urls.py.urlpatterns = [
    ...
    path('dyncss/', include('dyncss.urls')),
]UsageCreate a CSS File from the Django AdminAdd a link to that file in your Django template<link rel="stylesheet" href="dyncss/example.css">You can also use the template tag{% load dyncss %}

{% dyncss 'example.css' inline=True %}The parameterinlinewhenTrueallows to render the file inline within<style>tagsLicenseReleased under MIT LicenseCopyright (c) 2021 Julien Colot <julien.colot@gmail.com>ResourcesCode
Package: django_dynproxy
django_dynproxy===============Dynamic proxy models for DjangoWith django_dynproxy, you can dynamically modify a Django proxy model by :* hiding one or many fields (from the concrete parent model)* making mandatory one or many fields (who are not mandatory in the concrete parent model)This can be useful when you want to use inheritance in your code, but not in your databaseWARNING : THIS IS AN ALPHA RELEASE. NOT RECOMMENDED FOR PRODUCTION USERequirements :--------------django>=1.4.3Installation :--------------pip install django_dynproxyUsage :---------1) Create a concrete model2) Create a Django proxy model deriving from the concrete model3) Define a metaclass using dynproxy_metaclass_factory and specify :- which base fields you want to exclude from your proxy model- which non-mandatory base fields you want to be mandatory your proxy model4) Add the __metaclass__ to your proxy model classSample :---------from dynproxy.utils import dynproxy_metaclass_factoryTRAVELER_TYPE_PILOT = '1'TRAVELER_TYPE_PASSENGER = '2'TRAVELER_TYPES = ((TRAVELER_TYPE_PILOT,_(u"Pilot")),(TRAVELER_TYPE_PASSENGER,_(u"Passenger")))class Traveler(models.Model):first_name = models.CharField(max_length=200)last_name = models.CharField(max_length=200)type = models.CharField(max_length=200,choices=TRAVELER_TYPES)passport_number = models.CharField(max_length=200,blank=True)trigram = models.CharField(max_length=200,blank=True)pilot_category = models.ForeignKey(PilotCategory,null=True,blank=True)def __unicode__(self):return "%s %s" % (self.first_name,self.last_name)def traveler_manager_factory(traveler_type):class _TravelerManager(Manager):def get_query_set(self):return super(_TravelerManager,self).get_query_set().filter(type=traveler_type)return _TravelerManagerPilotManager = traveler_manager_factory(TRAVELER_TYPE_PILOT)PassengerManager = traveler_manager_factory(TRAVELER_TYPE_PASSENGER)PilotMetaclass = dynproxy_metaclass_factory(mandatory_fields=['trigram','pilot_category'],fields_to_exclude=['passport_number'])PassengerMetaclass = dynproxy_metaclass_factory(mandatory_fields = ['passport_number'],fields_to_exclude =['trigram','pilot_category'])class Pilot(Traveler):__metaclass__ = PilotMetaclassobjects = PilotManager()class Meta:proxy = Trueclass Passenger(Traveler):__metaclass__ = PassengerMetaclassobjects = PassengerManager()class Meta:proxy = True
Package: django-dynsettings
====================Django Dynamic Settings====================Installation============1. Add ``dynsettings`` to your ``INSTALLED_APPS``:<pre>INSTALLED_APPS = (...'dynsettings',)</pre>2. Run syncdb to create dynsettings table.Usage=============1. Import dynsettings object to manipulate your settings:<pre>from dynsettings.models import dynsettings</pre>2. Define your initial settings values in your settings.py (optional):<pre>DYNSETTINGS = {'my_initial_data': 12345}</pre>3. Use dynamic settings like a dictionary:<pre>import datetimedynsettings['my_data_name'] = u'Today is'dynsettings['my_data_name2'] = datetime.datetime.now()print dynsettings['my_data_name'], dynsettings['my_data_name2'].strftime("%d/%m/%Y")print dynsettings['my_initial_data']dynsettings['my_initial_data'] = "abcd"print dynsettings['my_initial_data']</pre>The code above will print the following output: <br />\>\>\> Today is 18/01/2013 <br />\>\>\> 12345<br />\>\>\> abcd
Package: django-dzenlog
Django Dzenlog is a set of models and templates, which can be
used to create blogs with different kinds media.Dzenlog relies on new django’s feature – model inheritance,
so you can derive you own models from dzenlog’s models and
add an actual information.This is very effective way of the code reuse, because dzenlog
will take care about all publishing options, and all what you
need is to describe details, specific to you particular blog.For example, for can create a blog with two post types: textual
posts and links to internet resources. In that case, all you need
is to define two models:TextPostandLinkPost. Each of these
models should be derived fromdjango_dzenlog.models.GeneralPost.FeaturesSimple way to add new types of posts.All post types can be agregated in one feed.Separate feed for each post type.Example projects, which uses most features of this application.Tagging support.
Package: django-e1337cms
Django-e1337cmsSimple and Lightweight but Powerful and Open Source CMS only for e1337 people.The project code and bugtracker is hosted onBitbucketandGithub.Here the full documentation:e1337cms.rtfd.org.Installationhere the documentation.How to configure and use e1337cms?here about how to configure and use.How can I try e1337cms functionality?here about how to try e1337cms.Some examples of page contenthere some examples.Authorshere the authors.Creditshere the credits.Changeloghere the changelog.
Package: django-e2ee-framework
An end-to-end encryption framework for DjangoInstallationInstall this package in a dedicated python environment via:python -m venv venv
source venv/bin/activate
pip install django-e2ee-frameworkTo use this in a development setup, clone thesource codefrom gitlab, start
the development server and make your changes:git clone https://gitlab.hzdr.de/hcdc/django/django-e2ee-framework
cd django-e2ee-framework
python -m venv venv
source venv/bin/activate
make dev-installMore detailed installation instructions my be found in thedocs.CopyrightCopyright © 2022 Helmholtz-Zentrum HereonLicensed under the EUPL-1.2-or-laterThis program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the EUPL-1.2 license for more details.You should have received a copy of the EUPL-1.2 license along with this
program. If not, seehttps://www.eupl.eu/.
Package: django-ead
Django app supporting EAD3 data import, editing, and XML serialisation.DocumentationThe full documentation is athttps://autharch-base.readthedocs.io.QuickstartInstall EAD and EAC-CPF Django Package:pip install autharch-baseAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'ead.apps.EADConfig',...)Add EAD and EAC-CPF Django Package’s URL patterns:fromeadimporturlsasead_urlsurlpatterns=[...url(r'^',include(ead_urls)),...]FeaturesModels for almost all of EAD3 (dsc and @entityref unsupported).Import script for EAD3 XML.Serialisation to EAD3 XML.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.8.1 (2021-05-20)Update MANIFEST.in to include XSL files.0.8.0 (2021-05-17)Changed import to store complex EAD3 as XHTML annotated with data-*
attributes, and changed serialiser to convert back to EAD3.0.7.0 (2021-02-04)Replaced existing migrations with new migration (borking existing
databases) to fix error with non-proxy model that migrations would
not handle.0.6.0 (2021-02-01)Removed all attempts to reuse Django model instances sharing the
same details (names, repositories, language declarations).The above change is handled in a single migration; this will break
existing installations that contain data.0.5.0 (2020-12-03)Added validation for some models.Added blank=True to some fields that must sometimes be empty.0.4.0 (2020-11-23)Corrected bugs in validators.Updated models to properly mark some fields as optional.Added model validation to XML import script.0.3.1 (2020-11-16)No changes; clean rebuild for PyPI.0.3.0 (2020-11-16)Added django-reversion support.Corrected some model and import bugs. Unfortunately caused problems
with Django migrations, and these have been reset.0.2.0 (2020-10-20)Added test (and associated code fixes) of round-trip import and
serialisation of EAD3 XML.0.1.2 (2020-10-16)Added XSD files to MANIFEST.in, so that the EAD3 XSD is included in
the package.0.1.1 (2020-10-13)Added dependency on lxml.0.1.0 (2020-10-09)First release on PyPI.
Package: django-earlyparrot
Use EarlyParrot with Django webhooks and signalsQuickstartInstall django-earlyparrot:pip install django-earlyparrotAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'referral',...)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: django-early-return
django_early_returnInstallationpip install django_early_returnadd'django_early_return.EarlyReturnMiddleware'toMIDDLEWAREin your settingsoptionally, add'django_early_return'toINSTALLED_APPS, if you want to run our tests when executingpython manage.py testUsageAny view code (or middleware code, if that middleware is installed after EarlyReturnMiddleware) can now instantiate EarlyReturn with any HttpResponse, and that response will be returned to the user:ifnotrequest.user.has_perm('my_app.some_permission'):raisedjango_early_return.EarlyReturn(http.HttpResponseForbidden())For code in helper functions/middleware/etc., this is often more convenient than passing a response back to the actual view code.
Package: django-earthdistance
Using PostgreSQL’s EarthDistance extension for django 1.11, 2.2 and 3.2 (for older versions seewith_djorm_expressionsbranch)Earthdistance allows to do fast geolocalized queries without using PostGISUsageCube and EarthDistance extensions must be enabled in postgreSQL BD, so log in
database using pgsql and install extensions:=>createextensioncube;=>createextensionearthdistance;Filter by rows inside a circunference of radius rfromdjango.dbimportmodelsfromdjango_earthdistance.modelsimportEarthDistanceQuerySetclassMyModel(models.Model):latitute=models.FloatField()longitude=models.FloatField()objects=EarthDistanceQuerySet.as_manager()# Define fields to query in DistanceExpression initialization# search with lat=0.2546 and lon=-38.25 and distance 1500 meters# use param `annotate` to set a custom field for the distance, `_ed_distance` as defaultMyModel.objects.in_distance(1500,fields=['latitude','longitude'],points=[0.2546,-38.25])Annotate each row returned by a query with distance between two pointsfromdjango_earthdistance.modelsimportEarthDistance,LlToEarthMyModel.objects.filter(....).annotate(distance=EarthDistance([LlToEarth([0.2546,-38.25]),LlToEarth(['latitude','longitude'])]))Optimizing perfomance with indexesPostgreSQL allow to use GiST indexes with functions results, a good perfomance improvement is to storell_to_earthresults in
an index,ll_to_earthis a function that calculates the position of a point on the surface of the earth (assuming earth is
perfectly spherical)-- Example MyModel table is app_mymodel and points columns are latitude and longitudeCREATEINDEXmymodel_locationONapp_mymodelUSINGgist(ll_to_earth(latitude,longitude));For django < 1.7Also, using south is preferred, just add this migration to migrations/ folder and edit it to your needs, index will be createdclassMigration(SchemaMigration):defforwards(self,orm):cursor=connection.cursor()cursor.execute("CREATE INDEX mymodel_location ON app_mymodel USING gist (ll_to_earth(latitude, longitude));")defbackwards(self,orm):# Deleting field 'Venue.coords'cursor=connection.cursor()cursor.execute("DROP INDEX mymodel_location ON app_mymodel;")