Saravanan666/pypi-org huggingface dataset:
Package: django-locality-two
# django-locality-twodjango-locality-twois a drop-in replacement for django-locality with modern python (3.5+) and django (1.11+) support,
and more tests.
Locality is a light collection of helpers for handling countries and
territories in Django.Currently, it includes:locality.json, a fixture with the world’s countries and territories (if
you notice any missing, [open an
issue](https://github.com/dekomote/django-locality-two/issues) or [submit a pull
request](https://github.com/dekomote/django-locality-two/compare/))views returning serialized lists of countries and territoriessimple form field and widget## InstallationInstall from the cheese shoppip install django-locality-twoORInstall from GitHub with pip:pip install -e git+https://github.com/dekomote/django-locality-two.git#egg=django-locality-two==2.1.1Then addlocalitytoINSTALLED_APPSin your Django settings. To load the
included data, run:python manage.py loaddata locality(or whichever equivalent method you use to run “manage.py” commands)## UsageList all countries:>>> from locality.models import Country
>>> print Country.objects.all()
[<Country: Andorra>, <Country: United Arab Emirates>,
<Country: Antigua and Barbuda>, ...]or list territories by country:>>> from locality.models import Country
>>> for country in locality.models.Country.objects.all():
>>>     print country.territories.all()
...
[<Territory: Salta, Argentina>, <Territory: Buenos Aires, Argentina>,
<Territory: Ciudad Autónoma de Buen os Aires, Argentina>, ...]You can create your own models around countries and territories:class Address(models.Model):country = models.ForeignKey(‘locality.models.Country’)
territory = models.ForeignKey(‘locality.models.Territory’)## Bugs / TODOPlease report all bugs to the [GitHub issue
tracker](https://github.com/dekomote/django-locality-two/issues)
Package: django-localized-fields
:white_check_mark:Tests:memo:License:package:PyPiDjango Versions2.0, 2.1, 2.2, 3.0, 3.1, 3.2Python Versions3.6, 3.7, 3.8, 3.9:book:DocumentationRead The Docs:warning:UpgradeUpgrade fom v5.x:checkered_flag:InstallationInstallation Guidedjango-localized-fieldsis an implementation of a field class for Django models that allows the field's value to be set in multiple languages. It does this by utilizing thehstoretype (PostgreSQL specific), which is available asmodels.HStoreFieldsince Django 1.10.:warning:This README is for v6. See thev5.xbranch for v5.x.Working with the codePrerequisitesPostgreSQL 10 or newer.Django 2.0 or newer.Python 3.6 or newer.Getting startedClone the repository:λ git clone https://github.com/SectorLabs/django-localized-fields.gitCreate a virtual environment:λ cd django-localized-fields
λ virtualenv env
λ source env/bin/activateCreate a postgres user for use in tests (skip if your default user is a postgres superuser):λ createuser --superuser localized_fields --pwprompt
λ export DATABASE_URL=postgres://localized_fields:<password>@localhost/localized_fieldsHint: if you're using virtualenvwrapper, you might find it beneficial to put
theexportline in$VIRTUAL_ENV/bin/postactivateso that it's always
available when using this virtualenv.Install the development/test dependencies:λ pip install ".[test]" ".[analysis]"Run the tests:λ toxAuto-format code, sort imports and auto-fix linting errors:λ python setup.py fix
Package: django-localized-recurrence
Django Localized RecurrenceDjango Localized Recurrence allowes you to store events that recur in
users’ local times, and not have to worry about things likeThis django app provides a model,LocalizedRecurrence, with
methods to help store recurring events, check if the events are due,
and update their next scheduled time.InstallationThis packages is currently available through Pypi and github. To
install from Pypi usingpip(recommended):pip install django-localized-recurrenceTo install the development version from github:pip install git+git://github.com/ambitioninc/django-localized-recurrence.git@developDocumentationFull documentation is available athttp://django-localized-recurrence.readthedocs.orgLicenseMIT License (see LICENSE)
Package: django-location-app
django-location-appA Django app that helps you easily create and manage your own location data. Simply get agoogle maps api keyand configure your maps directly from your django project's settings. Map comes with autocomplete functionality and saves your location to a completely normalized location database. See below forORM diagramQuickstartInstall django-location-app available onpypyand add it to your INSTALLED_APPS in your project's settings.py filepip install django-location-app

INSTALLED_APPS = (...
                  'location_app',
                  ...
                 )Get your Google MAPS API key fromhereand add it to the settings. It is always a good idea to store the key as an environment variable and access viaos.environ.get(<name>).Learn moreLOC_APP_MAPS_API_KEY = XXXXXXXXXXXXXXXXXXXXXXTo see if installation was successful, add the following to your project's urls.py filefrom django.urls import path, include
urlpatterns += [path('location/', include("location_app.urls")),]If in dev, visithttp://localhost:[Port]/location/and you should see the following UIhttps://user-images.githubusercontent.com/22666819/111712391-ead51c80-8823-11eb-96a3-9eb55f3cbe4c.mp4ORMApp tested locally. Proceed to make installable versionInitial commit
Package: django-locationstree
Simple application for location field as TreeForeignKey (see django-mptt) with form field.Usage# settings.py
INSTALLED_APPS += ('mptt', 'locationstree')

# models.py
class Place(models.Model):
  location = TreeForeignKey('locationstree.Location')

# forms.py
class PlaceForm(models.Model):
  location = JustLeafsLocationField(queryset=Location.objects.all())Context ProcessorThere is a context processor that sets Locations.objects.all() to context with the variable name by defaultlocations:# settings.py
CONTEXT_PROCESSORS += ('locationstree.context_processors.locations',)The variable name is configurable via settings variable:# settings.py
LOCATIONSTREE_CONTEXT_VARIABLE_NAME = 'lugares_comunes'It uses cache with the key namelocationstree.locationsand a TTL of 1 week configurable via settings variable:# settings.py
LOCATIONSTREE_CACHE_TTL = 60 * 60 * 24 # 1 day
Package: django-locking
What the heck is this?Django has seen great adoption in the content management sphere, especially among the newspaper crowd. One of the trickier things to get right, is to make sure that nobody steps on each others toes while editing and modifying existing content. Newspaper editors might not always be aware of what other editors are up to, and this goes double for distributed teams. When different people work on the same content, the one who saves last will win the day, while the other edits are overwritten.django-lockingprovides a system that makes concurrent editing impossible, and informs users of what other users are working on and for how long that content will remain locked. Users can still read locked content, but cannot modify or save it.Documentationdjango-locking is fairly well-documented. Check out the docs!Licensedjango-locking comes with a simplified BSD license, see the included LICENSE file for details.
Package: django-lockmgr
Privex's Django Database Lock Manager+===================================================+
|                 © 2019 Privex Inc.                |
|               https://www.privex.io               |
+===================================================+
|                                                   |
|        Django Database Lock Manager               |
|        License: X11/MIT                           |
|                                                   |
|        Core Developer(s):                         |
|                                                   |
|          (+)  Chris (@someguy123) [Privex]        |
|                                                   |
+===================================================+

Django Database Lock Manager - Easy to use lock system using your Django app's database
Copyright (c) 2019    Privex Inc. ( https://www.privex.io )Install with pipWe recommend at least Python 3.6 - we cannot guarantee compatibility with older versions.pip3 install django-lockmgrAddlockmgrto yourINSTALLED_APPSINSTALLED_APPS=['django.contrib.admin.apps.SimpleAdminConfig','django.contrib.auth','django.contrib.contenttypes',# ...'lockmgr']Run the migrations./manage.pymigratelockmgrUsageUse theLockMgrin your code like so:fromlockmgr.lockmgrimportLockMgr,Lockedtry:withLockMgr('mylock')aslck:print('The lock "mylock" is now locked.')lck.lock('otherlock')print('The lock "otherlock" should also be locked.')print('The locks "mylock" and "otherlock" should now both be cleared.')exceptLockedase:print('Error! mylock is already locked: ',type(e),str(e))If you want to wait for the lock to be released, rather than immediately excepting:fromlockmgr.lockmgrimportLockMgr,Lockedtry:# expires=60 means the lock will expire after 60 seconds if you don't renew it.# wait=90 (must be in 5 second intervals) means: if the key is locked, retry every 5 seconds, if 90 seconds have#         passed and it's still locked, then give up and raise Locked.withLockMgr('somelock',expires=60,wait=90)aslck:print('The lock "somelock" is now locked.')print('The lock "somelock" should now be cleared.')exceptLockedase:print('Error! After retrying for 90 seconds, "somelock" is still locked: ',type(e),str(e))Unit TestsTo run the unit tests, clone the project and make a.envfile containing details for a database:DB_BACKEND=mysql
DB_NAME=lockmgr
DB_USER=someuser
DB_PASS=mypasswordInstall all required dependencies:pip3 install -r requirements.txt -UNow run the tests (--verbose for more detailed testing output):./manage.py test --verbose
Package: djangoloco
djangolocoA simple management command to get translations fromlocalise.biz(Loco) for your django app. It will automatically download all the configured locales.Installpip install djangolocoDon't forget to enable the appINSTALLED_APPS=[..."djangoloco",...]SetupIn yoursettings.py, set the API key from Loco (get ithere)LOCO_API_KEY=...UsageTo pull the translations, runpython manage.py locoit will create the files for the enabled languages.Then you must runmakemessagesandcompilemessagesto actually make and compile the messages for django.
Package: django-lodfield
Django-LODField------------------A Django model representation for a list of python objects.##### 1) Installation```pip install django-lodfield```or```git clone https://github.com/nakule/django-lodfield.git django-lodfieldcd django-lodfieldpython setup.py install```##### 2) Import the List of Dictionary (LOD) model field```from LODField import LODField```##### 3) Define the model Field```class Invoice(models.Model):paid = models.BooleanField(default=False)# Simple Usageinvoice_lines = LODField(max_length=10000)# Set Limit for Admin Forminvoice_lines = LODField(max_length=10000, lines=10)# Set Fields for the Dictionaries in the Listinvoice_lines = LODField(max_length=10000, lines=10,keys=["Description", "Amount in Cents","Amount in Dollars"])```##### 4) Register Model to the Django Admin Interface (Optional)```from django.contrib import adminadmin.site.register(Invoice)```
Package: django-log-analyser
Log AnalyserInstall django-log-analyserVia pip:pip install django-log-analyserInstall pgbadger in UbuntuOpen your source list file:sudo nano /etc/apt/sources.listModify the file to include “yakkety universe” as a source:deb http://us.archive.ubuntu.com/ubuntu yakkety universeUpdate your system:sudo apt-get updateInstall pgbadger:sudo apt-get install pgbadgerQuick startAdd apps from “log_analyser” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'log_analyser',
]Include the log_analyser URLconf in your project urls.py like this:url(r'', include('log_analyser.urls')),“log_analyser” needs you to add a few constants to your settings:AWS_REGION = "aws-region"
BUCKET_LOG_ANALYSER = 'bucket-name'
RDS_DB_INSTANCE_IDENTIFIER = ['rds-db-instance-identifier-1', 'rds-db-instance-identifier-2' ...]
RDS_TEMP_LOG_FILE_LOCATION = "/var/tmp/"
AWS_ACCESS_KEY_ID = "aws-access-key"
AWS_SECRET_ACCESS_KEY = "aws-secret-access-key"Runpython manage.py migrateto create the log_analyser models.
Package: django-log-api
django-log-apiAllows download django log file via apiRequirementsdjango >= 2.2djangorestframework >= 3.9.2tailheadInstallationInstall packagepipinstalldjango-log-api# orpoetryadddjango-log-apiAdd to the INSTALLED_APPSsettings.pyINSTALLED_APPS=[...,"log_api",]# log dir path, use Path(), default: BASE_DIR / logsLOG_API_DIR_PATH=BASE_DIR/"logs"# log file name, default: 'django.log'LOG_API_DEFAULT_FILE="django.log"# log tail numbers, default: 1000LOG_API_MAX_READ_LINES=1000# log api permission, use drf`s permission, default: AllowAnyLOG_API_PERMISSION_CLASSES=("rest_framework.permissions.AllowAny",)add to urls.pypath(r"logs/",include("log_api.urls")),visit 'http://localhost:8000/logs/download/?name=django&tail=100'parameters:name: log file nametail: if null, download entire log file, others the tail lines number
Package: django-logbasecommand
django-logbasecommandMinimal package to add logging helpers to Django management commandsUsageReplacefrom django.core.management.base import BaseCommand

class YourCommand(BaseCommand):withfrom logbasecommand.base import LogBaseCommand

class LogBaseCommand(BaseCommand):and now you can use the drop-in methods to replaceself.stdout/self.stderr:loglog_debuglog_warninglog_errorlog_exceptionOr accessself.loggerdirectly.All command logger names are derived from the command module name and prefixed withlogbasecommand.base(by default, useLOGBASECOMMAND_PREFIXsetting to change it), so logging can be configured from your project settings.py, withLOGGING, ie (full example, check theloggerspart):LOGGING={'version':1,'disable_existing_loggers':False,'filters':{'require_debug_false':{'()':'django.utils.log.RequireDebugFalse'},'require_debug_true':{'()':'django.utils.log.RequireDebugTrue'},},'formatters':{'verbose':{'format':'[%(asctime)s] [%(process)s] [%(levelname)s] [%(name)s]%(message)s'},'minimal':{'format':'[%(levelname)s] [%(name)s]%(message)s'},},'handlers':{'console':{'level':'INFO','filters':['require_debug_false'],'class':'logging.StreamHandler','formatter':'verbose',},'console_debug':{'level':'DEBUG','filters':['require_debug_true'],'class':'logging.StreamHandler','formatter':'verbose',},'console_minimal':{'level':'INFO','filters':['require_debug_false'],'class':'logging.StreamHandler','formatter':'minimal',},'console_debug_minimal':{'level':'DEBUG','filters':['require_debug_true'],'class':'logging.StreamHandler','formatter':'minimal',},'mail_admins':{'level':'ERROR','filters':['require_debug_false'],'class':'django.utils.log.AdminEmailHandler',},},'loggers':{'':{'handlers':['console','console_debug'],'level':'INFO','propagate':True},'logbasecommand.base':{'handlers':['console_minimal','console_debug_minimal'],'level':'DEBUG','propagate':False,},},}
Package: django-logentry-admin
django-logentry-adminShow all LogEntry objects in the Django admin site.Originally based on:Django snippet 2484Supported versionsDjango 3.2, 3.1, 2.2Python 3.9, 3.8, 3.7, 3.6, 3.5InstallationInstall by using pip or easy_install:pipinstalldjango-logentry-adminOr install from source:gitclonegit@github.com:yprez/django-logentry-admin.gitcddjango-logentry-adminpythonsetup.pyinstallTo add this application into your project, just add it to yourINSTALLED_APPSsetting:INSTALLED_APPS=(...'logentry_admin',)Running testsTest on all Python / Django versions with tox:$pipinstalltox$toxOr just a specific Django / Python version:$tox-epy35-django19Or run on multiple CPUs in parallel with detox to make it faster:$pipinstalldetox$detoxChangelogv1.1.0 - 25/05/2021Add tests/support for Django 3.2, 3.1.Add tests/support for Python 3.9.Drop support for Python 2.7, 3.4.Drop support for Django 1.x, 2.0, 2.1.v1.0.6 - 23/04/2020Add tests for Python 3.8, Django 3.0.Fix including locale files in wheel package.v1.0.5 - 30/07/2019Test on Python 3.7.Add tests for Django 2.1.Add tests for Django 2.2.Remove tests for Django 1.7.Fix translations, include locale files in the package.v1.0.4 - 17/06/2018Fix admin links for Django 2.0.v1.0.3 - 14/12/2017Add tests for Django 1.11 and 2.0 compatibility.Drop support for Python 3.2, 3.3.Make short_descriptions translatable in admin.py.Make use of new get_change_message() method on Django >= 1.11.Add Russian, Azerbaijani and Portuguese translations.v1.0.2 - 12/08/2016Add tests for Django 1.10 compatibility.v1.0.1 - 24/07/2016Add tests and support for Django 1.9 and Python 3.5.Drop support for Python 2.5, 2.6, Django 1.4, 1.5, 1.6.Fix AttributeError when content_type is None, issue#21.Show log entries for users with change_logentry permission,#25.Test with py.test instead of unittest.v0.1.5 - 17/02/2015Django 1.8 compatibility.v0.1.4 - 28/09/2014Added Django 1.7 compatibility.Fixed compatibility issues with Django 1.5, 1.4 and Python 3.2.Added tests.v0.1.3 - 02/06/2014Improved display layout.Added links to user and object.Added “By staff user” filter.Don’t allow delete action for LogEntry.Better performance by prefetching content types.v0.1.2 - 26/08/2013Added an empty model.py file.Minor documentation (readme) updates/fixes.v0.1.1 - 28/12/2011Added object links and action description.v0.1.0 - 26/12/2011Initial release.
Package: django-logfiles
Django LogfilesThis Django Admin plugin provides a simply way to view logfiles from the Django Admin
panels.Install it on your system using PIP:pip install django-logfilesConfiguration can be set in settings.py:INSTALLED_APPS = [
    ...  # All other apps
    'logfiles'
]

LOGFILES = {
    'PATHS': ['/var/log/**.log'],
    'TAIL': 100,
    'SORT': ('-date',)
}All settings are optional, so even if you don't provide any settings, the above settings are
the default settings.The example project allows to play around with the plugin.
It comes with an SQlite3 database with one superuser
namedtestand passwordtest.
Package: django-log-formatter-asim
Django ASIM log formatterThe library formats Django logs inASIM format.Mapping to the format may not be complete, but best effort has been made to create logical field mappings.If you need to amend the mapping, you can implement a custom formatter.Installationpipinstalldjango-log-formatter-asimUsageUsing in a Django logging configuration:fromdjango_log_formatter_asimimportASIMFormatterLOGGING={..."formatters":{"asim_formatter":{"()":ASIMFormatter,},},'handlers':{'asim':{'formatter':'asim_formatter',...},},"loggers":{"django":{"handlers":["asim"],...},},}DependenciesThis package usesDjango IPwarefor IP address capture.This package is compatible withDjango User Agentswhich, when used, will enhance logged user agent information.SettingsDLFA_LOG_PERSONALLY_IDENTIFIABLE_INFORMATION- the formatter checks this setting to see if personally identifiable information should be logged. If this is not set to true, only the user's id is logged.DLFA_TRACE_HEADERS- used for defining custom zipkin headers, the defaults is("X-Amzn-Trace-Id"), but for applications hosted in GOV.UK PaaS you should use("X-B3-TraceId", "X-B3-SpanId"). If you are running your application in both places side by side during migration, the following should work in your Django settings:DLFA_INCLUDE_RAW_LOG- By default the original unformatted log is not included in the ASIM formatted log. You can enable that by setting this toTrueand it will be included inAddidtionalFields.RawLog.fromdbt_copilot_python.utilityimportis_copilotifis_copilot():DLFA_TRACE_HEADERS=("X-B3-TraceId","X-B3-SpanId")Formatter classesASIM_FORMATTERS={"root":ASIMSystemFormatter,"django.request":ASIMRequestFormatter,}The default class for other loggers is:ASIMSystemFormatterCreating a custom formatterIf you wish to create your own ASIM formatter, you can inherit from ASIMSystemFormatter and call _get_event_base to get the base level logging data for use in augmentation:classASIMSystemFormatter(ASIMFormatterBase):defget_event(self):logger_event=self._get_event_base()# Customise logger eventreturnlogger_eventContributing to thedjango-log-formatter-asimpackageGetting startedClone the repository:git clone https://github.com/uktrade/django-log-formatter-asim.git && cd django-log-formatter-asimInstall the required dependencies:pip install poetry && poetry install && poetry run pre-commit installTestingAutomated testingRunpoetry run pytestin the root directory to run all tests.Or, runpoetry run toxin the root directory to run all tests for multiple Python versions. See thetoxconfiguration file.
Package: django-log-formatter-ecs
The library formats Django logs in ECS format.https://www.elastic.co/guide/en/ecs/current/index.htmlMapping to the format is incomplete and best effort has been made to create logical field mappings between Django and ECS.If you need to amend the mapping you can implement a custom formatter (see below).Installationpipinstalldjango-log-formatter-ecsUsageUsing in a Django logging configuration:fromdjango_log_formatter_ecsimportECSFormatterLOGGING={..."formatters":{"ecs_formatter":{"()":ECSFormatter,},},'handlers':{'ecs':{'formatter':'ecs_formatter',...},},"loggers":{"django":{"handlers":["ecs"],...},},}DependenciesThis package uses for kubi_ecs_loggerhttps://github.com/kumina/kubi_ecs_loggerfor base ECS formattingThis package uses Django IPwarehttps://github.com/un33k/django-ipwarefor IP address capture.This package is compatible with django-user_agentshttps://pypi.org/project/django-user-agents/which, when used, will enhance logged user agent information.SettingsDLFE_APP_NAME- used to define the application name that should be logged.DLFE_LOG_SENSITIVE_USER_DATA- the formatter checks this setting to see if user information should be logged. If this is not set to true, only the user’s id is logged.DLFE_ZIPKIN_HEADERS- used for defining custom zipkin headers, the defaults is("X-B3-TraceId" "X-B3-SpanId")The Django configuration file logged is determined by running:os.getenv('DJANGO_SETTINGS_MODULE')Formatter classesECS_FORMATTERS={"root":ECSSystemFormatter,"django.request":ECSRequestFormatter,"django.db.backends":ECSSystemFormatter,}The default class for other loggers is:ECSSystemFormatterCreating a custom formatterIf you wish to create your own ECS formatter, you can inherit from ECSSystemFormatter and call _get_event_base to get the base level logging data for use in augmentation:classECSSystemFormatter(ECSFormatterBase):defget_event(self):logger_event=self._get_event_base()# Customise logger eventreturnlogger_eventTests$pipinstall-rrequirements.txt$tox