Saravanan666/pypi-org huggingface dataset:
Package: django-upyun
Django又拍云存储插件=========================**django-upyun** 为Django提供又拍云的接口.Features========- Django file storage for UpYun- Django static file storage for UpYun- Works in Python 3.6安装============* Install开发版本：.. code-block:: bash$ pip install git+https://gitee.com/enlangs/django-upyun-storage.git正式版本：.. code-block:: bash$ pip install django-upyun- Add ``'django_upyun'`` to your ``INSTALLED_APPS`` setting- Set your ``DEFAULT_FILE_STORAGE`` setting to ``"django_upyun.backends.UpYunMediaStorage"``- Set your ``STATICFILES_STORAGE`` setting to ``"django_upyun.backends.UpYunStaticStorage"``- Configure your UpYun Storage settings (Refer below).Use the following settings for file storage... code-block:: bash# 配置静态文件；STATICFILES_STORAGE = 'django-upyun.backends.UpYunStaticStorage'# 配置上传文件使用UpYun存储，如：ImageField、FileFieldDEFAULT_FILE_STORAGE = 'django-upyun.backends.UpYunMediaStorage'认证设置=======================下面的三个设置用来登录upyun服务器.. code-block:: bash# 服务UPY_SERVICE = <Your Service># 用户名UPY_USERNAME = <Your username># 密码UPY_PASSWORD = <Your password>存储设置=======================使用的文件地址。.. code-block:: bashservice_url = <地址，支持CDN>重名文件覆盖设置====================针对重名文件的处理方式，如果为True，表示覆盖；为False表示文件名称+时间戳.. code-block:: bashUPY_NEED_COVERAGE = FalseFile storage settings=====================多媒体默认存储设置.. code-block:: bash# 文件默认存储的文件夹MEDIA_URL = '/media/'文件存储格式设置===========================设置上传后的文件存储到数据库中使用何种方式，为False表示存储为xxx.png.. code-block:: bashUPY_SAVE_FULL_URL = <True/False>Staticfiles storage settings============================静态默认存储设置.. code-block:: bash# The default location for your static filesSTATIC_URL = '/static/'staticfiles provides command 'collectstatic'. Run following command to collect all sub-folder 'static' of each appand upload to STATIC_URL... code-block:: bash$ python manage.py collectstaticTesting=======需要如下三个配置，like linux系列可以使用环境变量设置。.. code-block:: bash$ export UPY_SERVICE=<service>$ export UPY_USERNAME=<username>$ export UPY_PASSWORD=<password>Support and announcements=========================Downloads and bug tracking can be found at the `main project website <https://gitee.com/enlangs/django-upyun-storage/issues>`_.
Package: django-urbano
django-urbanoStartingThese instructions will allow you to install the library in your python project.Current featuresGet tracking info.Pre-requisitosPython >= 3.7Django >= 3requests >= 2InstallationTo get the latest stable release from PyPi:pip install django-urbanoorFrom a buildgit clone https://gitlab.com/linets/ecommerce/oms/integrations/django-urbanocd {{project}}python setup.py sdistand, install in your project djangopip install {{path}}/django-urbano/dist/{{tar.gz file}}Settings in django projectDJANGO_URBANO = {
    'URBANO': {
        'BASE_URL': '<URBANO_BASE_URL>',
        'USER': '<URBANO_USER>',
        'PASSWORD': '<URBANO_PASSWORD>',
        'ID_CONTRATO': '<URBANO_ID_CONTRATO>',
    }
}UsageCreate instance to be sentimport json
from types import SimpleNamespace

dict_ = {
    'reference': '99999',
    'created_at': '12/12/21',
    'shipping_date': '12/12/21',
    'expiration_date': '26/12/21'
    'tracking_code': '6075620-1',
    'transport_guide_number': '1121632479536-01-1',
    'purchase_number': 'CLV0048146676851-1',
    'customer': {
        'first_name': 'Marcos',
        'last_name': 'Sac',
        'full_name': 'Marcos Sac',
        'phone': '932932932',
        'email': 'test@gmail.com',
        'rut': '16936195-9'
    },
    'address': {
        'street': 'ALEJANDRO VENEGAS CADIZ',
        'number': '513',
        'unit': 'DEPTO 6A',
        'full_address': 'ALEJANDRO VENEGAS CADIZ 513 DEPTO 6A'
    },
    'commune': {
        'name': 'Aisen',
        'code': '',
        'zone_code': '11201',
        'zone_post': 'WPA',
    },
    'location': {
        'code': 'MONTANDON',
        'name': 'MNN',
    },
    'region': {
        'name': 'Aysén del General Carlos Ibáñez del Campo',
        'code': '11',
        'iso_code': 'CL-XI',
    }
}

instance = json.loads(json.dumps(dict_), object_hook=lambda attr: SimpleNamespace(**attr))Get tracking info:from urbano.handler import UrbanoHandler

handler = UrbanoHandler()

tracking_info = handler.get_tracking(<identifier>)Get default payload:from urbano.handler import UrbanoHandler

handler = UrbanoHandler()
default_data = handler.get_default_payload(<instance>)Create shipping:from urbano.handler import UrbanoHandler

handler = UrbanoHandler()
default_data = handler.create_shipping(<default_data>)Get events:from urbano.handler import UrbanoHandler

handler = UrbanoHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'ENTREGADO',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_events(raw_data)

Output:
[{
    'city': 'Santiago'
    'state': 'RM',
    'description': 'Llego al almacén',
    'date': '12/12/2021'
}]Get status and if "is_delivered":from urbano.handler import UrbanoHandler

handler = UrbanoHandler()

raw_data = {
    'tracking_number': 999999,
    'status': 'ENTREGADO',
    'events': [{
        'city': 'Santiago'
        'state': 'RM',
        'description': 'Llego al almacén',
        'date': '12/12/2021'
    }]
}
response = handler.get_status(raw_data)

Output:
('ENTREGADO', True)
Package: django-url2png
Install it withpip:pip install django-url2pngConfigure settings: API_KEY, SECRET_KEYOptionally set optional defaults for the filter, especially THUMBNAIL_MAX_WIDTHUse it in a template:{% load url2png_tags %}
<img src="{{ url|url2png:400 }}" width="400" height="{% get_height 400 %}"/>This uses the configuredTHUMBNAIL_MAX_WIDTH, which is set to300:{% load url2png_tags %}
<img src="{{ url|url2png }}" width="300" height="{% get_height %}"/>
Package: django-urlactive-lite
django-urlactive-liteA small template tag library for django, that makes highlighting active
links easy.visit thegithub.PurposeThis library is extremely light weight, and I probably won’t add any new
features. There are many larger libraries out there that already provide
many more features for navigation, so I’d suggeset that people use those
instead.This library is meant partially for people who just want one simple tag
to add an “active” class to a navigation link, but mostly just as a
simple example of how to create a template tag in django.Installationfrom the command line:pip install django-urlactive-liteIn yoursettings.pyfile, addurlactivetoINSTALLED_APPSINSTALLED_APPS=(...'urlactive',...)And adddjango.core.context_processors.requestto yourTEMPLATE_CONTEXT_PROCESSORSsetting insettings.py. Remember to
include the other default template context processors:TEMPLATE_CONTEXT_PROCESSORS=("django.contrib.auth.context_processors.auth","django.core.context_processors.debug","django.core.context_processors.i18n","django.core.context_processors.media","django.core.context_processors.static","django.core.context_processors.tz","django.contrib.messages.context_processors.messages",..."django.core.context_processors.request",...)Usage{% url_active ... %}’argumentsThe{% url_active ... %}template tag takes one argument, a url, and
prints"active"if the url passed as an argument is the same as the
url from which the page is rendered.exampleDon’t forget to load the template tag library.{% load urlactive %}
...
...
...<ulclass="nav">{% url 'first_url_name' as first_url %}<liclass="{% url_active first_url %}"><ahref="{{ first_url }}">First</a></li>{% url 'second_url_name' as second_url %}<liclass="{% url_active second_url %}"><ahref="{{ second_url }}">Second</a></li>{% url 'third_url_name' as third_url %}<liclass="{% url_active third_url %}"><ahref="{{ third_url }}">Third</a></li></ul>ContributingThere are already many great projects for django around template tags
for navigation, so I’m not looking to extend this project. Of course,
feel free to fork it and do whatever you want with the code.
Package: django-urlalternatives
django-urlalternatives - Alternative Django views under same URL patternDjango URL alternatives provides a way for dispatching one URL pattern to the
first alternative view (callback function) in a list that returns success.version:0.1 (or corresponding Mercurial revision hash)web:http://gw.tnode.com/0483-Django/author:GW <gw.2011@tnode.comorhttp://gw.tnode.com/>license:GPLv3+keywords:url alternatives, dispatcher, views, django, urlconf, same patternDescriptionIn case you want to assing in an URLconf the same URL pattern to more than one
view (or callback function), such that the next ones are fallbacks in case of
errors (ie. HTTP response codes >= 400). This is often the case when combining
different apps with dynamic URLs (such as CMSs) and you want to respond with the
one that has that content.UsageAs you can see from the following example the URL alternatives dispatcher is
simply used as part of theurlpatternsvariable inurls.pyand supports
passing of positional and keyword arguments, eg.:urlpatterns += pattern(‘’,(r’^’, ‘urlalternatives.views.dispatcher’, {‘callbacks’:[app1.views.failing404,
‘app2.views.working’,
(redirect_to, [], {‘url’:’/’}),]}),)
Package: django-urlauth-egguy
django-urlauthThis is a maintenance fork of the original django-urlauth by Grigoriy Petukhov.This django application allows you to build special links.
When somebody goes via that link to your site, it will be automatically authenticated.
THis is achieved with special GET arguments which are appended to the link.
Such links are usually used in the emails.Example of such link:http://domain.com/profile/edit/?authkey=SOME_HASHFor installation instructions, see the file "INSTALL".Full documentation is available in the file "index.rst" in the "docs/" directory.Changes in this forkUpdated to work with Django 1.11+Added support for Python 3.6+Added tests runner
Package: django-url-checks
Read MeUse Django's System Check Framework to ensure your URL Configuration
works correctly.Table of ContentsProject PurposeProject RationaleInstallation and UsageContributingProject PurposeThis package checks your Django project's URL Configuration for a few
things.Do the paths or regular expressions in your URL configuration tree end
with slashes (or, for regular expressions,/$)Is the URL configuration tree comprised of onlyURLPatternandURLResolverinstances (path()andinclude())?IsROOT_URLCONFdefined in settings, and does it point to a valid
Python module withurlpatternsdefined?🔝 Up to Table of ContentsProject RationaleI constantly forget to add a slash to the end of my URI paths. This
leads to strange behavior, and can be tricky to catch even with proper
testing.What's more, the errors raised when something is amiss with the URL
configuration can be tricky to debug and understand.As such, this package aim to try and make developers lives easier by
providing targeted checks of the URL configuration tree. This is meant
to be used as part of a "belt-and-braces" approach, and is not a
substitution for tests!I am open to suggestions on improving the checks. Please open an issue
to do so.🔝 Up to Table of ContentsInstallation and UsageAdd"url_checks.apps.UrlChecksConfig",as an item in your Django
project'sINSTALLED_APPSsettingIn the terminal (in your Django projects code-root directory), run
Django's check framework with$ python manage.py checkRead the output in your terminal and track those bugs down!🎉🔝 Up to Table of ContentsContributingFor ideas, bugs, feature-requests, and all the rest, please open anissue on Github.🔝 Up to Table of Contents
Package: django-urlcompass
==========urlcompass==========urlcompass is a simple Django app to display active trail of url visited.Detailed documentation is in the "docs" directory.Quick start===========1. Add "polls" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'urlcompass',]2. URLCOMPASS={'root_name':'name-or-root-view','start':'[&nbsp','end':'&nbsp]','sep':'&nbsp>&nbsp','html_id': 'name-of-my-app','html_class':'compass bar class','rename': lambda x: x.replace('_', ' ')}3. In base template add reference to compass:{% load urlcompass %}<div>{% urlcompass_show %}</div>4. urlcompass will now be shown.Example=======github link has and example folder for a mimimal django website using urlcompass.to use the example, activate it virtualenv and run django manager "python manager.py runserver"Links=====github: https://github.com/Acrisel/django-urlcompass
Package: django-urlconfchecks
Django UrlConf Checksdjango-urlconfchecks is a static type checker that checks your URLconf parameter types with argument types specified in associated views.
It leverages the Django's static check system.DocumentationGitHubPyPIInstallationpip install django-urlconfchecksPython 3.8 or later is required. However, before Python 3.10 some checks
relating toOptionaltypes in view signatures are skipped due to stdlib
limitations.UsageYou can use this package in different ways:As a Django appAdddjango_urlconfchecksto yourINSTALLED_APPSlist in yoursettings.pyfile.INSTALLED_APPS=[...'django_urlconfchecks',]As a command line toolRun this command from the root of your project, weremanage.pyis located:$urlconfchecks--helpUsage:urlconfchecks[OPTIONS]CheckallURLConfsforerrors.Options:--version-u,--urlconfPATHSpecifytheURLconftocheck.--install-completionInstallcompletionforthecurrentshell.--show-completionShowcompletionforthecurrentshell,tocopyitorcustomizetheinstallation.--helpShowthismessageandexit.As a pre-commit hookAdd the following to your.pre-commit-config.yamlfile:-repo:https://github.com/AliSayyah/django-urlconfchecksrev:v0.11.0hooks:-id:django-urlconfchecksFor more information, see theusage documentation.FeaturesUsing this package, URL pattern types will automatically be matched with associated views, and in case of mismatch, an
error will be raised.Example:# urls.pyfromdjango.urlsimportpathfrom.importviewsurlpatterns=[path('articles/<str:year>/',views.year_archive),path('articles/<int:year>/<int:month>/',views.month_archive),path('articles/<int:year>/<int:month>/<slug:slug>/',views.article_detail),]# views.pydefyear_archive(request,year:int):passdefmonth_archive(request,year:int,month:int):passdefarticle_detail(request,year:int,month:int,slug:str):passoutput will be:(urlchecker.E002) For parameter `year`, annotated type int does not match expected `str` from urlconfTODO:Handle type checking parameterized generics e.g.typing.List[int],list[str]etc.Should only warn for each unhandled Converter once.Regex patterns perhaps? (only RoutePattern supported at the moment).CreditsLuke Plantfor providing the idea and the initial code.This package was created withCookiecutterand
thewaynerv/cookiecutter-pypackageproject template.
Package: django-urlconverter
django-urlconverter: Django automatic view parameters conversionThedjango-urlconverterpackage provides an easy way to convert view arguments
from simple types to complex ones, like models, or just do some processing using robust syntax.
Most interesting application of the package is to convert view arguments which are object ids (from database via ORM)
to the instances of those objects (Models).Installationpipinstalldjango-urlconverterUsagemodels.py:fromdjango.dbimportmodelsclassFooBar(models.Model):"""Foo Bar model."""title=models.CharField(max_length=100)converters.py:from.modelsimportFooBarclassFoo(object):"""Foo converter. Convert an object id to FooBar instance."""def__init__(self,**kwargs):self.kwargs=kwargsdef__call__(self,value,request,*args,**kwargs):returnFooBar.objects.get(pk=value)settings.py:URL_CONVERTERS={'Foo':'converters.Foo',# Converts to 'FooBar instance'}urls.py:fromdjango.conf.urls.defaultsimportpatternsfromdjango_urlconverterimportconverted_arguments_urlurlpatterns=patterns('views',converted_arguments_url(r'^foos/<Foo:foo2>/','bar'),)views.py:defbar(request,foo2):"""View function which gets a converted foo2.
    the foo2 will be a converted parameter, which is the result of Foo converter
    """returnfoo2.titleContactIf you have questions, bug reports, suggestions, etc. please create an issue on
theGitHub project page.LicenseThis software is licensed under theMIT licenseSeehttps://github.com/paylogic/django-urlconverter/blob/master/LICENSE.txt© 2013 Paylogic International.Changelog1.0.0Initial public release
Package: django-urlcrypt
django-urlcrypt encrypts information in urls, such as login credentials.For example, assume I have url patterns that looks like this:urlpatterns = patterns('',
    url(r'^inbox/$', 'message_inbox', name='message_inbox'),
    (r'^r/', include('urlcrypt.urls')),
)I can use django-urlcrypt to generate a url for a user that looks like:http://www.mydomain.com/r/TkNJBkNFAghDWkdFGPUAQEfcDUJfEBIREgEUFl1BQ18IQkdDUUcPSh4ADAYAWhYKHh8KHBsHEwand will automatically log that person in and redirects them to/inbox/.Installationeasy_installdjango-urlcryptorpip installdjango-urlcryptAddurlcryptto yourINSTALLED_APPSIn settings.py add'urlcrypt.auth_backends.UrlCryptBackend'toAUTHENTICATION_BACKENDSIn urls.py add:(r'^r/', include('urlcrypt.urls')),(recommended)If you wish to use RSA encryption on your tokens, generate a private key withssh-keygen-trsa-f<path to private key>if you don’t already have one, and then set the path to the private key as URLCRYPT_PRIVATE_KEY_PATH. RSA encryption makes the token much longer but is more secure.  Thepycryptolibrary is required.UsageIn a view:from django.core.urlresolvers import reverse
from urlcrypt import lib as urlcrypt

token = urlcrypt.generate_login_token(user, reverse('message_inbox'))
encoded_url = reverse('urlcrypt_redirect', args=(token,))
# yours will look slightly different because you have a different SECRET_KEY, but approximately
# encoded_url == /r/TkNJBkNFAghDWkdFGPUAQEfcDUJfEBIREgEUFl1BQ18IQkdDUUcPSh4ADAYAWhYKHh8KHBsHEwIn a template:{% load urlcrypt_tags %}
<a href="{% encoded_url user message_inbox %}">click me to log in as {{user.username}} and go to {% url message_inbox %}</a>Advanced lib usage:from urlcrypt import lib as urlcrypt

message = {
    'url': u'/users/following/',
    'user_id': '12345'
}

token = urlcrypt.encode_token((message['user_id'], message['url']))
decoded_message = urlcrypt.decode_token(token, ('user_id', 'url', 'timestamp'))

>>> print token
TkNJBkNFAghDWkdFGPUAQEfcDUJfEBIREgEUFl1BQ18IQkdDUUcPSh4ADAYAWhYKHh8KHBsHEw

>>> print decoded_message
{'url': '/users/following/', 'user_id': '12345'}SettingsURLCRYPT_LOGIN_URLdefault:LOGIN_URLIf urlcrypt authentication fails, redirects toURLCRYPT_LOGIN_URL.URLCRYPT_RATE_LIMITdefault:60The number of urlcrypt requests a unique visitor is allowed to make per minute.URLCRYPT_PRIVATE_KEY_PATHdefault:NoneThe path to the RSA private key file in PEM format. IfNone, RSA encryption will not be used.RUNNING_TESTSdefault:FalseSetRUNNING_TESTSto True when running the urlcrypt tests.CreditsDavid ZieglerChristopher Hesse
Package: django-urldecorators
This project is archived. It is no longer updated or maintained.Django-urldecorators is a reusable Django application which allows apply
view decorators and middleware components based on a requested URL.This library is compatible with Django 1.4 and later. If you need to use
older Django versions (which receive no security updates or bugfixes) you
can install 0.4 version of django-urldecorators.Installation and usageRunpython setup.py installor add theurldecoratorsmodule to
yourPYTHONPATH(or use pip or easy_install).Inurls.pyfile replacefrom django.conf.urls import url, includebyfrom urldecorators import url, includePass a list of decorators and/or middleware_classes as an argument
to theurlfunction.Example urls.py file:from urldecorators import url, include

urlpatterns = [
    url(r'^private/$', include('example.private.urls'),
        decorators=['django.contrib.auth.decorators.login_required']),
    url(r'^articles/$', include('example.articles.urls'),
        middleware_classes=['django.middleware.cache.CacheMiddleware']),
]For the example configuration and usage see the example project included
in the repository. It can be run usingdjango-admin.pyutility from the
repository root:$ django-admin.py syncdb --settings=example.settings --pythonpath="$PWD"
$ django-admin.py createsuperuser --settings=example.settings --pythonpath="$PWD"
$ django-admin.py runserver --settings=example.settings --pythonpath="$PWD"RequirementsDjango-urldecorators is tested with Django versions from 1.4 to 1.11 but
it does not supportpatterns functionfrom ancient Django versions.Both Python 2 and Python 3 are supported.TestingApplication tests can run usingtox:$ tox
Package: django-url-fullpath-redirect
django-url-fullpath-redirect==================``django-url-fullpath-redirect`` - простой приложение для редиректов в Django. Форк проекта django-url-tracker.Поддерживает на данный момент следующие коды ответа:1. 3042. 410Редиректы задаются через админкуУстановка------------Просто::pip install django-url-fullpath-redirectНастройка-------------Для запуска добавляем в ``settings.py``:1. Ставим последним в ``MIDDLEWARE_CLASSES`` наше ``url_tracker.middleware.URLChangePermanentRedirectMiddleware``::MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.contrib.flatpages.middleware.FlatpageFallbackMiddleware','url_tracker.middleware.URLChangePermanentRedirectMiddleware',)2. И добавляем в ``INSTALLED_APPS`` ::INSTALLED_APPS = ("url_tracker",)Теперь обновляем базу и можем задавать редиректы через админку.Профит.
Package: django-urlid-graph
django-urlid-graphDjango-based API to serve URLid + graph database.
This repository hosts the app code and also a project structure so it's easier
to develop - only theurlid_graphfolder is packaged beforegoing to
PyPI.Installation and configurationAdd "urlid_graph" to yourINSTALLED_APPSsetting like this:INSTALLED_APPS=[..."urlid_graph",]Change database configurations (this example usespython-decouple):DATABASE_URL=config("DATABASE_URL")# must be setGRAPH_DATABASE_URL=config("GRAPH_DATABASE_URL")# must be setgraph_config=config("GRAPH_DATABASE_URL",cast=db_url)GRAPH_DATABASE=graph_config["NAME"]# must be setDATABASES={"default":config("DATABASE_URL",cast=db_url),GRAPH_DATABASE:graph_config,# must set this way}DATABASE_ROUTERS=["urlid_graph.db_router.RelationAndGraphDBRouter"]Configure Django caching system (used to storeElementConfiglabels):CACHES={"default":{"BACKEND":"django.core.cache.backends.locmem.LocMemCache","TIMEOUT":24*3600,"MAX_ENTRIES":1024,}}Include theurlid_graphURLconf in your project'surls.pylike this:path('v1/',include("urlid_graph.urls")),Runpython manage.py migrateto create the needed models, triggers etc.Populate the database:# you may want to add entities to urlid_graph_entity modelpythonmanage.pyimport_configdata/config.csv# must create this file beforeImporting datapythonmanage.pyimport_objectsappnameModelfile.csv[.gz|.xz]pythonmanage.pyimport_relationshiprelnamefile.csv[.gz|.xz]
Package: django-urlkeyword
Validate that your slugs do not match a keyword in your urlRationaleSuppose you have some of urls like:country-of-fire/edit/country-of-fire/hidden-leaf-village/country-of-fire/hidden-leaf-village/edit/country-of-fire/forest-of-death/country-of-fire/forest-of-death/edit/If the feudal lords of the Country of Fire decided to found a new village, you would kindly try to suggest them to avoid names likeeditordelete; they probably won’t understand anything about technological constraints, but your suggestion could be nonetheless welcome.Instead of trying to explain why it’s not a good idea to found “Edit” (though maybe “Edit Village” may be acceptable), you may just write a piece of software that will not let anybody register any place suchly named. This is calledvalidation.UsageModify yoursettings.pyto include the list of words you want to use as keywords:# settings.py

URL_KEYWORDS = ('new', edit', 'delete')Then add the validator to your slug field:# models.py

from urlkeyword import validate_url_keyword

class Village(Model):
    code = models.SlugField(max_length=20, validators=[validate_url_keyword])