Saravanan666/pypi-org huggingface dataset:
Package: django-exchange-themes
django-exchange-themes is an appearance application that allows
administrators the ability to select a predefined theme or customize
their own theme.The license for this matches the license found forcolorfield, which is BSD
License and listed in the classifiers section of setup.py. The author
has also been added to the setup.py of django-exchange-themes.Installationpip installpip install git+git://github.com/boundlessgeo/django-exchange-themes@master#egg=appearanceAdd the following to your Django configuration (settings) fileINSTALLED_APPS = (
'appearance',
) + INSTALLED_APPSRun migrationspython manage.py migrateCollect staticpython manage.py collectstatic --noinputCoveragecoverage within the appvirtualenv venv
source venv/bin/activate
pip install .
pip install coverage
cd appearance/tests
python manage.py migrate
python manage.py collectstatic --noinput
coverage run manage.py test appearanceTheTheme modelhas the following fields:name(Theme name)CharFieldMax length is 28description(Theme description)CharFieldMax length is 64default_theme(Default application included Theme)BooleanFieldNot editable in Admin consoleactive_theme(Enables Theme to be active)BooleanFieldtitle(Theme landing page title)CharFieldMax length is 32Can be blanktagline(Theme landing page tagline)CharFieldMax length is 64Can be blankrunning_hex(Header/Footer color)ColorField (GUI to select the color)Default is 0F1A2Crunning_text_hex(Header/Footer text color)ColorField (GUI to select the color)Default is FFFFFFrunning_link_hex(Header/Footer link color)ColorField (GUI to select the color)Default is 0F1A2Cpb_text(Powered by text)CharFieldMax length is 64Default is ‘Boundless Spatial’pb_link(Powered by link)URLFieldDefault is ‘http://boundlessgeo.com/’docs_link(Documentation links)URLFieldCan be blankbackground_logo(Landing page background image)ImageFieldCan be blankprimary_logo(Landing page primary logo)ImageFieldCan be blankbanner_logo(Header logo)ImageFieldCan be blankNote:The templates in appearance/templates will override existing
templates in exchange. Blank fields will be accounted for and use the
default settings in the template, which are Boundless Exchange defaults.
Package: django-execute-code
Django execute codeThis is a project that is used to execute python codes in the web page.
You can install and use it in django projects,
You can do any operations that can be performed in python shell with this package.Installation#. Install django-execute-code usingpip:pip install django-execute-codeConfiguration#. settings.py:INSTALLED_APPS = [
        ...
        'django_execute_code',
    ]#. <settings_folder>/urls.py:urlpatterns += [
    url('debug/', include('django_execute_code.urls')),
]Usagego to your django site after installing and configuring this package,
then login as super user and go to this urlhttp://<your_site_url>/debug/execute-python/ContributingIf you think you've found a bug or are interested in contributing to this project check outdjango-exec-code on Github. <https://github.com/shinunandakumar/django_execute_code>.
AuthorLinkdin. <https://www.linkedin.com/in/shinu-n-508849168/>
Package: django-exiffield
django-exiffielddjango-exiffield extracts exif information by utilizing the exiftool.RequirementsPython 3.6.1 or newerexiftoolDjango >= 2.2InstallationInstall django-exiffieldpipinstalldjango-exiffieldMake sureexiftoolis executable from you environment.IntegrationLet's assume we have an image Model with a singleImageField.
To extract exif information for an attached image, add anExifField,
specify the name of theImageFieldin thesourceargumentfromdjango.dbimportmodelsfromexiffield.fieldsimportExifFieldclassImage(models.Model):image=models.ImageField()exif=ExifField(source='image',)and create a migration for the new field.
That's it.After attaching an image to yourImageField, the exif information is stored
as adicton theExifField.
Each exif information of the dictionary consists of two keys:desc: A human readable descriptionval: The value for the entry.In the following example we access the camera modelimage=Image.objects.get(...)print(image.exif['Model'])# {#     'desc': 'Camera Model Name',#     'val': 'DMC-GX7',# }As the exif information is encoded in a simpledictyou can iterate and access
the values with all familiar dictionary methods.Denormalizing FieldsSince theExifFieldstores its data simply as text, it is not possible to filter
or access indiviual values efficiently.
TheExifFieldprovides a convinient way to denormalize certain values using
thedenormalized_fieldsargument.
It takes a dictionary with the target field as key and a simple getter function of
typeCallable[[Dict[Dict[str, str]]], Any].
To denormalize a simple value you can use the providedexiffield.getters.exifgetterfromdjango.dbimportmodelsfromexiffield.fieldsimportExifFieldfromexiffield.gettersimportexifgetterclassImage(models.Model):image=models.ImageField()camera=models.CharField(editable=False,max_length=100,)exif=ExifField(source='image',denormalized_fields={'camera':exifgetter('Model'),},)There are more predefined getters inexiffield.getters:exifgetter(exif_key: str) -> strGet an unmodified exif value.get_type() -> strGet file type, e.g. video or imageget_datetaken -> Optional[datetime]Get when the file was created asdatetimeget_orientation  -> exiffield.getters.OrientationGet orientation of media file.
Possible values areLANDSCAPEandPORTRAIT.get_sequenctype -> exiffield.getters.ModeGuess if the image was taken in a sequence.
Possible values areBURST,BRACKETING,TIMELAPSEandSINGLE.get_sequencenumber -> intGet image position in a sequence.DevelopmentThis project usespoetryfor packaging and
managing all dependencies andpre-committo runflake8,isort,mypyandblack.Clone this repository and runpoetryinstall
poetryrunpre-commitinstallto create a virtual enviroment containing all dependencies.
Afterwards, You can run the test suite usingpoetryrunpytestThis repository follows theConventional Commitsstyle.Cookiecutter templateThis project was created usingcruftand thecookiecutter-pyprojecttemplate.
In order to update this repository to the latest template version runcruftupdatein the root of this repository.
Package: django-eximagination
Fetch external images directly from templates.A Django template tag library which allows to download external images, store
them locally and return the local path to locally stored image to a desired
context variable, along withwidthandheightattributes of the image
fetched. Caches the fetched images locally for the given time (set in
settings).You could, for example, use this app to solve the problems with displaying of
a mixed content (assets loaded from HTTP and HTTPS sources).PrerequisitesDjango 1.8, 1.9, 1.10Python >=2.7, >=3.4InstallationInstalldjango-eximaginationLatest stable version on PyPI:pipinstalldjango-eximaginationLatest stable version from GitHub:pip installhttps://github.com/barseghyanartur/django-eximagination/archive/stable.tar.gzAddeximaginationtoINSTALLED_APPS.INSTALLED_APPS=(# ...'eximagination',# ...)ConfigureBy default,django-eximaginationexpects your files to be stored in/media/external_imagesdirectory. If location varies, redefine the
directories in your Django settings, make sure the path is writable and that
www-data (or whatever is applicable) has rights to write into it.importosBASE_DIR=os.path.dirname(os.path.dirname(__file__))MEDIA_ROOT=os.path.join(BASE_DIR,'..','..','media')EXIMAGINATION_MEDIA_ROOT=os.path.join(MEDIA_ROOT,'external_images')EXIMAGINATION_MEDIA_URL='/media/external_images'EXIMAGINATION_MEDIA_RELATIVE_ROOT='external_images/'# After 30 days we re-fetch the file anyway.EXIMAGINATION_EXPIRATION_INTERVAL=2592000Usage example (in a Django template)See theexample directoryfor working
code example.Example #1:{% load eximaginate %}<imgsrc="{{ MEDIA_URL }}{% eximaginate 'http://www.google.com/intl/en/images/logo.gif' %}">Example #2:{% load eximaginate thumbnail %}

{% eximaginate 'http://www.google.com/intl/en/images/logo.gif' as original %}<imgsrc="{% thumbnail original 100x100 %}">In both cases there are two additional context variables added:ei_width- Width of the imageei_height- Height of the imageTestingSimply type:./runtests.pyor use tox:toxor use tox to check specific env:tox-epy35or run Django tests:./manage.pytesteximagination--settings=settings.testingLicenseGPL 2.0/LGPL 2.1SupportFor any issues contact me at the e-mail given in theAuthorsection or open
an issue on BitBucket/GitHub.AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: django-exmodel
The ex-model lets you extend models in apps by adding mixins to them.
The mixins can override fields and methods of the original model.Example:# file: staff.models
from django.db import models
from exmodel import Model, extend_model


class Person(Model):
    name = models.CharField(max_lenth=10)

    def __unicode__(self):
        return self.name

    class Meta:
        app_label = 'staff'
        verbose_name = 'Person name'


class PersonMixin(object):
    name = models.CharField(max_lenth=500)
    alias = models.CharField(max_lenth=500)

    def __unicode__(self):
        return u'%s (%s)' % (self.name, self.alias)

    class Meta:
        verbose_name = 'Person name and alias'


extend_model('staff.Person', PersonMixin)
Package: django-exo-role
Use roles system with DjangoQuickstartInstall django-exo-role:pip install django-exo-roleAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'exo_role',...)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-expanded-test-cases
Django Expanded Test CasesDescriptionExpands the existingDjangoTestCase classwith extra functionality.Different TestCase classes are provided, each providing separate sets of functionality.For full documentation, seeReadTheDocs.Example ETC Debug Output on UnitTest ErrorA main functionality thatExpandedTestCasesprovides is verbose response debug info on UnitTest errors.Below is an example of such output, when a test fails while checking the<h1>tag for a very simple page.InstallationInstall withpip install django-expanded-test-casesFor full color output, also installpip install coloramaPackage Development & Running Project TestsAs standard for Python development, this project has its own testing to ensure it functions as desired.
After installing dependencies, everything required to run tests are provided in one of two files:To run tests via standard djangopython manage.py test, execute the<project_root>/runtests.pyfile.To run tests viapytest, execute the<project_root>/runpytests.pyfile.
Package: django-expire
A Django application which provides authentication-based session expiration.To install this application into your project, first add it to yourINSTALLED_APPSsetting (and runmanage.py syncdb):INSTALLED_APPS = (
    ...
    'django_expire',
)Next, add the expiration middleware to yourMIDDLEWARE_CLASSESsetting,
placing it after both thesessionandauthmiddleware.:MIDDLEWARE_CLASSES = (
    ...
    'django_expire.middleware.ExpireMiddleware',
)What it doesFor every request by an authenticated user, a check is run to ensure the number
of other sessions also belonging to the user does not exceed the allowed
maximum.This maximum defaults to1, but you can provide aEXPIRE_MAX_USERSsetting to override this default (a setting of0allows an unlimited
amount of users per session).If a user has exceeded the number of sessions they are allowed, the excessive
sessions are removed (effectively logging the user out of these now invalidated
sessions).Logged sessionsA log of each session is stored in thedjango_expire.models.LoggedSessionmodel.Invalidated sessions are not removed from the database by default so you can
use this model to retrieve login information (for example, date/time and IP
address).Use theEXPIRE_LOG_LIMITsetting to set a limit of expired session logs to
retain for each user (you can use0to delete expired session logs straight
away orNonefor no limit).Changing expiration settings per userThedjango_expire.signals.expire_checkallows you to change the
expiration settings at a per-user level.The signal is sent before any tests are run, along with a settings dictionary
containing a singlemax_userskey. Signal handlers may change the value
of the dictionary to alter the settings for this user.An example handler (which is not automatically connected) can be found indjango_expire.signals.superuser_handlerwhich demonstrates allowing
superusers an unlimited number of sessions.
Package: django-expiring-token
Django Expiring Token adds token expiration on token authentication and extends the
expiration time on each authenticated request.Django Expiring Token provides a very lightweight extension to DRF’s existing token authentication.
It implements the following functionalities:Tokens expire after the set time.On each authenticated request, the expiration time is updated by the set time.Quick startDo NOT add “restframework.authtoken” to you INSTALLED_APPS.Add “django_expiring_token” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'django_expiring_token',
]Include the polls URLconf in your project urls.py like this:path('custom-url/', include('django_expiring_token.urls')),Add the expiration time insettings.py:EXPIRING_TOKEN_DURATION=timedelta(hours=1)
# Any timedelta setting can be used! If not set, the default value is 1 dayAdd the default authentication class inREST_FRAMEWORKsettings insettings.py:REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        ...
        'django_expiring_token.authentication.ExpiringTokenAuthentication',
        ...
    ),
}Runpython manage.py migrateto create package migrationsStart the development server an you are good to go.TestsThis build is tested against Python versions 3.4, 3.5, 3,6 with Django versions 2.0.8+To run testsInstallcoverage:pip install coverageRun tests:coverage run runtest.py
Package: django-expiry
django-expiryExpiry rules for Django sessions.InstallationInstall usingpippip install django-expiryorPipenvpipenv install django-expiryAddexpiryto yourINSTALLED_APPSsettingINSTALLED_APPS = (
    ...
    'expiry',
)Addexpiry.middleware.ExpirySessionMiddlewareto your middleware settingMIDDLEWARE = (
    ...
    'expiry.middleware.ExpirySessionMiddleware',
)or to middleware classes if your Django is <= 1.9MIDDLEWARE_CLASSES = (
    ...
    'expiry.middleware.ExpirySessionMiddleware',
)The middleware will process rules and default ages for fresh sessions.UsageAgesDefault ages can be set for anonymous and authenticated users. When not set, the session age behaviour will default to Django.EXPIRY_ANON_SESSION_AGEDefault: not set.The default age of an anonymous session, in seconds.EXPIRY_ANON_KEEP_ALIVEDefault:FalseKeeps the authenticated session alive, refreshing its expiry for every request, according to its default value and rules.EXPIRY_AUTH_SESSION_AGEDefault: not set.The default age of an authenticated session, in seconds.EXPIRY_AUTH_KEEP_ALIVEDefault:FalseKeeps the anonymous session alive, refreshing its expiry for every request, according to its default value and rules.RulesA set of rules should be defined in your settings file.
You can have rules for anonymous users and authenticated users, handled separately.Expiry rules for authenticated users onlyProcessed whenever an user logs in. Its callable should always accept anuserand arequestobject.EXPIRY_AUTH_SESSION_RULES = (
    (lambda request, user: user.is_staff, 300),
    (lambda request, user: user.is_superuser, datetime.timedelta(weeks=2)),
    (lambda request, user: user.has_perms('hero'), 99999999),
)Expiry rules for anonymous users onlyProcessed whenever a session is fresh. Rules are triggered inExpirySessionMiddleware.EXPIRY_ANON_SESSION_RULES = (
    (lambda request: request.META.get('REMOTE_ADDR') == '192.168.0.1', 999)
)Rule compositionA rule is a tuple composed by:A callable or the path to a callable that will validate itAn expiry (seconds, datetime, timedelta)Note that, fordatetimeandtimedeltaexpiries, serialization won't work unless you are using thePickleSerializer.Read more about ithere.In the examples above, all rules are lambdas, but you can also send the path to a function that will validate it.EXPIRY_AUTH_SESSION_RULES = (
    ('app.module.complex_rule', datetime.timedelta(days=64)),
)Then define the rule in that specific module:def complex_rule(user, request):
    ...
Package: django-explain
# Django-Explain - a helper to get EXPLAIN or EXPLAIN ANALYZE output for django queryset.## Installation```shpip install django-queryset```## Example```pyfrom django.contrib.auth.models import Userfrom django_explain import explainexplain_result = explain(User.objects.filter(pk=123))explain_result.pretty_print()# SELECT "auth_user"."id",#        "auth_user"."password",#        "auth_user"."last_login",#        "auth_user"."is_superuser",#        "auth_user"."username",#        "auth_user"."first_name",#        "auth_user"."last_name",#        "auth_user"."email",#        "auth_user"."is_staff",#        "auth_user"."is_active",#        "auth_user"."date_joined",#        "auth_user"."has_orders"# FROM "auth_user"# WHERE "auth_user"."id" = 1## Index Scan using auth_user_pkey on auth_user  (cost=0.43..8.45 rows=1 width=1070) (actual time=0.039..0.039 rows=0 loops=1)#   Index Cond: (id = 1)# Planning time: 1.203 ms# Execution time: 0.106 msresult.get_depesz_url()# https://explain.depesz.com/s/Tym```
Package: django-explain-commands
django-explain-commands=======================Are you tired to find where each command coming from? django-explain-commandshelps you to find which Django application provides each command.Installation------------1. pip install django-explain-commands2. Add `explain_commands` to `INSTALLED_APPS`.Usage-----Run `python manage.py explain_commands` and enjoy.Sample output:$ python manage.py explain_commandsdjango.contrib.auth =>changepassword -- Change a user's password for django.contrib.auth.createsuperuser -- Used to create a superuser.django.core =>cleanup -- Can be run as a cronjob or directly to clean ou...compilemessages -- Compiles .po files to .mo files for use with bu...createcachetable -- Creates the table needed to use the SQL cache b...dbshell -- Runs the command-line client for specified data...diffsettings -- Displays differences between the current settin...dumpdata -- Output the contents of the database as a fixtur...flush -- Executes ``sqlflush`` on the current database.inspectdb -- Introspects the database tables in the given da...loaddata -- Installs the named fixture(s) in the database.makemessages -- Runs over the entire source tree of the current...reset -- Executes ``sqlreset`` for the given app(s) in t...runfcgi -- Runs this project as a FastCGI application. Req...runserver -- Starts a lightweight Web server for development.shell -- Runs a Python interactive interpreter. Tries to...sql -- Prints the CREATE TABLE SQL statements for the ...sqlall -- Prints the CREATE TABLE, custom SQL and CREATE ...sqlclear -- Prints the DROP TABLE SQL statements for the gi...sqlcustom -- Prints the custom table modifying SQL statement...sqlflush -- Returns a list of the SQL statements required t...sqlindexes -- Prints the CREATE INDEX SQL statements for the ...sqlinitialdata -- RENAMED: see 'sqlcustom'sqlreset -- Prints the DROP TABLE SQL, then the CREATE TABL...sqlsequencereset -- Prints the SQL statements for resetting sequenc...startapp -- Creates a Django app directory structure for th...validate -- Validates all installed models.explain_commands =>explain_commands -- Explain where each command is coming from.south =>convert_to_south -- Quickly converts the named application to use S...datamigration -- Creates a new template data migration for the g...graphmigrations -- Outputs a GraphViz dot file of all migration de...migrate -- Runs migrations for all apps.schemamigration -- Creates a new template schema migration for the...startmigration -- Depereciated commandsyncdb -- Create the database tables for all apps in INST...test -- Runs the test suite for the specified applicati...testserver -- Runs a development server with data from the gi...
Package: django-export
Django ExportDjango app allowing for filtered exporting of model object data.django-export allows you to export model objects in a wide range of serialized formats (JSON, CSV, XML, YAML). Exports can be filtered and ordered on any of the particular model’s fields.django-export utilizesdjango-object-toolsto hook into Django’s admin interface and take care of user permissions.ContentsDjango ExportInstallationUsagePraekelt ConsultingChangelog1.11.01.9.21.9.11.91.0.3 (2014-10-17)1.0.2 (2014-10-17)1.0.1 (2014-10-15)1.0.0 (2014-10-13)0.0.4 (2011-09-09)0.0.3 (2011-08-23)0.0.2 (2011-08-19)0.0.1 (2011-08-11)InstallationInstalldjango-object-toolsas describedhere.Install or adddjango-exportto your Python path.Addexportto yourINSTALLED_APPSsetting.Optionally for exporting in CSV you need to addexport.serializers.csv_serializerto yourSERIALIZATION_MODULESsetting, i.e.:SERIALIZATION_MODULES={'csv':'export.serializers.csv_serializer'}UsageOnce installed you should see anExportobject tool enabled on all admin change list views.If you don’t see the tool make sure the logged in user has the appropriate export user permission assigned (or set user as superuser).Clicking theExporttool link takes you to an export page on which you can specify format, ordering and filtering of the objects you want to export. The export is delivered as a download in whichever format you select.
Authors
=======Praekelt ConsultingShaun SephtonChangelog1.11.0Django 1.11 compatibility.Deprecate support for Django < 1.8.1.9.2Restore full set of export fields. This fixes a bug introduced in 1.9.1.1.9.1Fix case where an empty list of fields is passed resulting in a blank form.1.9Include fields that are non-editable as potential filter fields.Make it possible for subclasses of theExportform to provide a set of filter fields.Django 1.9 compatibility.1.0.3 (2014-10-17)Improved celery support1.0.2 (2014-10-17)Moved serializer into celery task1.0.1 (2014-10-15)Add celery support to move email task to a background process1.0.0 (2014-10-13)CSV serialiser (included into project)Email exported data to logged in userDjango 1.7 CompatabilityTravis/tox integration0.0.4 (2011-09-09)Indent output making it human readable, thanks bevenky.Note on enabling CSV.0.0.3 (2011-08-23)More robust field lookup for fields defined outside of Django.0.0.2 (2011-08-19)Supports all Field types.0.0.1 (2011-08-11)Initial release.