Saravanan666/pypi-org huggingface dataset:
Package: dj-users
UsersUsers is a Django app for creating, reading, updating and deleting users models.Get startedInstall the package:pipinstalldjango-usersAfter installation:Insettings.py, addusersapp toINSTALLED_APPS.Users app can be used as a web app that uses HTML templates and/or as an API back-end:If you want to use HTML templates, then includeusers.urlsin your project levelurls.py.Includeusers.routersto use the API endpoints.Or include the both.Set up the templatesUsers app does not contain HTML templates to give the developer the options of customization.To set up the templates:Insettings.py, set theDIRS=[BASE_DIR / 'templates'].Createtemplatesfolder in your project folder.Create a folder named with the name of the app that containsAUTH_USER_MODEL(the default isauth).Create the templates (user_list.html,user_detail.html,user_form.html,user_confirm_delete.html)Note: If you named your user model different thanUser, you may need to name your templates according to the name of the modelExample: Let's say that the name of your app isblogand you extended the default user model and you named the new user modelBlogUserthen the folder that you will create in the templates folder isblogand you will need to rename the templates, for exampleuser_list.htmlwill bebloguser_list.html.I hope that you find this useful.
Package: djutils
djutilsTools for use within the django frameworkdjutils provides tools for common actions within the django framework.It includes tools for:Administration interfaceCryptographicsDatabase interactionExceptionsHTTP HandlingIP-Address handlingMixins for ClassesInstallationUse the python package manager pip to install djutils.pipinstalldjutilsUsageJust an example how you could use the exceptions_to_http decorator.
Each method defined in djutils has a small documentation with it.fromdjutilsimporthttp,exceptions@http.exceptions_to_http(exceptions.Error)defmy_route(request):ifrequest.POST:raiseexceptions.Error("POST is not allowed",code="no_post",status_code=403)return"Hello World"LicenseGNU LGPLv2.1, see LICENSEMaintainerThis package is maintained by Manuel Stingl.
Package: djvasa
(Dj)ango - (Va)grant - (Sa)ltStackIn an effort to learn about Vagrant and SaltStack I had the idea to create a tool to help me initialize Django
projects more efficiently, this is the result.  Djvasa is a command line tool to help you rapidly create a Django
project for use with Vagrant.  In addition, the Vagrant environment can be provisioned with certain tools typical
to a Django project ready for use.  The provisioning is handled with SaltStack.The following guide assumes you already have Vagrant and VirtualBox installed and that you have the salty-vagrant
plugin installed.  If you have Vagrant and VirtualBox already, but need the plugin, you can install like so:>> vagrant plugin install vagrant-saltQuick Start>> pip install djvasa
>> djvasa --postgres
What's the name of your project? foobar
What's your full name? Chad Gallemore
What's your email? cgallemore@gmail.com

>> cd foobar
>> vagrant up
>> vagrant ssh
>> . .virtualenvs/{{project_name}}/bin/activate && cd /vagrant
>> python manage.py syncdb
>> python manage.py runserver 0.0.0.0:8000
>> Go to http://localhost:8000
>> Prosper...The above creates your basic Django project and provisions your virtual environment so you can start development.  Once
you shell into your vagrant environment the motd will provide you instructions on how to activate your virtualenv
and run your server.OptionsCurrently djvasa provides two database options, mysql or postgres, as well as an option to setup your project for deployment
to Heroku.  By default the project is initialized for git usage and creates a .gitignore file, but if you wish to use
mercurial there is a flag for enabling mercurial>> djvasa -h
usage: djvasa [-h] [--heroku] [--mysql] [--postgres] [--hg]

optional arguments:
-h, --help  show this help message and exit
--heroku    Initialize the project for deployment to Heroku.
--mysql     Initialize the project with MySQL.
--postgres  Initialize the project with Postgres.
--hg        Initialize project for mercurial.>> djvasa --mysqlHerokuDjvasa provides an option to set your project up for deployment to Heroku.  Since Heroku uses Postgres as the database,
postgres will automatically be enabled for your project.  Your settings file will contain the necessary Heroku
requirements.  Below is an example:>> djvasa --heroku
What's the name of your project? foobar
What's your full name? Chad Gallemore
What's your email? cgallemore@gmail.com

>> cd foobar
>> git init
>> git add .
>> git ci -m"my django app"
>> heroku create
>> git push heroku master
>> heroku run python manage.py syncdb
>> heroku open
Package: dj-veryfi
Django Veryfi OCR API IntegrationAs the title says, its aDjangointegration forVeryfi OCR API.
For now, it can auto OCR receipts or invoices documents by usingdj_veryfi.fields.OCRInvoiceOrReceiptFieldmodel field. It derives fromdjango.db.models.JSONFieldmodel field and, takes a additional parameterupload_towhich specifies the path where the file should be saved according to current defined Django STORAGE.RequirementsPython 3
Django >= 3.2.20
Veryfi 3.3.0How it worksOnce you have defined a model field asdj_veryfi.fields.OCRInvoiceOrReceiptField, you can assign a file-like instance to an instance model field ofdj_veryfi.fields.OCRInvoiceOrReceiptField, then, before saving the model, it gonna hit the Veryfi OCR API to extract information and persists it as JSON into datababse.
When the field instance is acceesed after extraction it returns aOCRDatainstance which has the file descriptor and the JSON data.How to installpip install dj-veryfiSetupAdddj_veryfiintoINSTALLED_APPSand set theVeryfi APIauthentication information intosettings.pyas described bellow:...
INSTALLED_APS = [
...
"dj_veryfi"
]
...
# Veryfi access settings
VERYFI_CLIENT_ID = "Your client ID"
VERYFI_CLIENT_SECRET = "Your client secret"
VERYFI_USERNAME = "Your username"
VERYFI_API_KEY = "Your api key"UsageOnce you have a django project, dj-veryfi installed and set up, just declare your model field asdj_veryfi.fields.OCRInvoiceOrReceiptField, as bellow.from django.db import models
from dj_veryfi.fields import OCRInvoiceOrReceiptField

class Document(models.Model):
    created_at = models.Datetime.FIeld(auto_now_add=True)
    name = models.CharFied(max_length=100)
    ocr_data = OCRInvoiceOrReceiptField(upload_to="receipts/")Note, theupload_toattribute is a relative path which will append to MEDIA_ROOT settings variable.Now, you can just assign a file-like object toDocument.ocr_datasave the model and, the information from receipt or invoice file will be extracted and saved as json into database.Trade-OffsI have chosen to extend the field fromdjango.db.models.JSONFieldbecause the extracted data comes as JSON and I had to do nothing related to querying.If I had chosen another model field type likeFileFieldto get a shortcut to manage files and save them as JSON, I would have had trouble with how to query it into the database, due to JSON querying definition is not that simple.So, it seems easier to me to avoid dealing with querying definitions when it comes to JSON querying, due toJSONFieldcomes with "query thing" already done and deal with managing the files from where the information was extracted is easier.
Package: djvsyepitb
Djvsyepitb=================This API SDK was automatically generated by [APIMATIC Code Generator](https://apimatic.io/).This SDK uses the Requests library and will work for Python ```2 >=2.7.9``` and Python ```3 >=3.4```.How to configure:=================The generated code might need to be configured with your API credentials.To do that, open the file "Configuration.py" and edit its contents.How to resolve dependencies:===========================The generated code uses Python packages named requests, jsonpickle and dateutil.You can resolve these dependencies using pip ( https://pip.pypa.io/en/stable/ ).1. From terminal/cmd navigate to the root directory of the SDK.2. Invoke ```pip install -r requirements.txt```Note: You will need internet access for this step.How  to test:=============You can test the generated SDK and the server with automatically generated testcases. unittest is used as the testing framework and nose is used as the testrunner. You can run the tests as follows:1. From terminal/cmd navigate to the root directory of the SDK.2. Invoke ```pip install -r test-requirements.txt```3. Invoke ```nosetests```How to use:===========After having resolved the dependencies, you can easily use the SDK following these steps.1. Create a "djvsyepitb_test.py" file in the root directory.2. Use any controller as follows:```pythonfrom __future__ import print_functionfrom djvsyepitb.djvsyepitb_client import DjvsyepitbClientapi_client = DjvsyepitbClient()controller = api_client.clientresponse = controller.get_basic_auth_test(<required parameters if any>)print(response)```
Package: dj-waff
dj_waff - A collection of extra Django Widgets and Form FieldsDocumentationThe full documentation is athttps://dj_waff.readthedocs.org.QuickstartInstall dj_waff - extra Django Widgets and Form Fields:pip install dj_waffThen use it in a project:import dj_waffFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-09-18)First release on PyPI.
Package: djwalebabu
AI[0] presents:djwalebabuTired of going to youtube to search for your favorite songs?
Try DJWaleBabu insteadThe packagedjwalebabuis a demonstration python package to better understand python libraries.Documentation :InstallationpipinstalldjwalebabuUsage# Import the libraryimportdjwalebabu# Call the .request functiondjwalebabu.request()NOTE: This library will not work on remote servers. Use it on your command prompt or terminal instead.
Package: dj-warning-forms
Add warnings to your Django Forms easilyDocumentationThe full documentation is athttps://dj-warning-forms.readthedocs.io.QuickstartInstall Django Warning Forms:pip install dj-warning-formsUse the form mixin in any formfromdjangoimportformsfromdj_warning_forms.formsimportWarningFormMixin,FormFieldWarningfrom.modelsimportPollclassPollForm(WarningFormMixin,forms.ModelForm):question=forms.CharField(max_length=200,widget=forms.TextInput(attrs={"autocomplete":"off"}))classMeta:model=Pollfields="__all__"defwarning_question(self)->List[FormFieldWarning]:ifnotself.cleaned_data["question"].endswith("?"):return[FormFieldWarning(message="Weird question",description="This question does not end with a question mark. Are you sure you want to publish this question?",# noqa)]return[]Adding a warning is as simple as adding a method with thewarning_prefix. This method must return a
list of FormFieldWarning objects.Showing warnings in the templateYou can find the list of warnings inform.warnings.{% block content %}<formaction="."method="post">{% csrf_token %}
    {{ form }}<inputtype="submit"value="Submit"><!-- Customize your form warnings as you wish -->{% if form.warnings %}<divclass="rounded p-2 mt-2 bg-warning"><ul>{% for warning in form.warnings %}<li><b>{{ warning.message }}:</b>{{ warning.description }}</li>{% endfor %}</ul></div>{% endif %}<!-- End of form warnings --></form>{% endblock %}FeaturesNo external dependenciesMinimal changes needed in your formsEasy to customizeRunning 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-djangopackage
Package: djwc
djwc: Django WebComponentsIntroductionWebComponents is a W3C standard supported by all browsers for a couple of years
now, see theirGetting Startedintroduction for details.Getting startedHow to try djwcFor a quick test:clone and enter this reporunpip install django -e .start the example with:./manage.py djwc && ./manage.py runserverYou should see some polymer components onlocalhost:8000How to install djwcpip install djwc,adddjwctoINSTALLED_APPS(for the management command)add the'djwc.middleware.StaticMiddleware'MIDDLEWARE(to inject scripts).How to use webcomponentsDeclare the components that you want to useRun./manage.py djwcto install them (does not use NodeJS)Use the HTML tags for your componentsThat'sit!! The middleware will do the rest.Read on for details about each step.Declaring componentsYou can declare components per-app, per-project, and also include bundles.SettingsYou can add apaper-inputcomponent to DJWC in the settings by referencing
its npm path:DJWC={'COMPONENTS':{'paper-input':'@polymer/paper-input/paper-input.js',}}This will have predecence over any other setting.AppConfigOr, define anAppConfig.componentsattribute to add components to your
reusable app.classAppConfig(apps.AppConfig):components={'paper-input':'@polymer/paper-input/paper-input.js',}This will be automatically detected.LibrariesYou can also include a bunch of webcomponents with theDJWC['LIBRARIES']setting:DJWC={'LIBRARIES':['djwc_polymer'],}More to come, these are manually maintained at this time.Installing components with./manage.py djwcThen, run the./manage.py djwccommand that will download all the scripts
into a static directory. Do this prior to collectstatic in production, and
every-time you change your components declaration.Using componentsJust use your new tag wherever you want, such as in templates:<paper-inputalways-float-labellabel="Floating label"></paper-input>The middleware will inject the corresponding script whenever the middleware
will find apaper-inputtag.FAQI've read that WebComponents are not accessibleApparently, accessibility isfine with aria
attributes.What next ?Do add unit tests when a contributor breaks itOptimize the djwc commandAutomate djwc_polymerAdd moar bundles ! Like bootstrap-webcomponents ! yay !
Package: dj-weather-show
dj-weather-showonly tell you the weather in Dongjak-guThank you very much. It started with the following.https://pypi.org/project/hello-aaingyunii_prINSTALL$pipinstalldj-weather-show`USE$dj-weather-show

현재위치:동작구신대방2동
현재날씨:맑음
현재온도:19.3°$python
Python3.8.18(default,Oct172023,20:11:17)[GCC11.4.0]onlinux
Type"help","copyright","credits"or"license"formoreinformation.
>>>fromdj_weather_show.weather_showimportget_weather
>>>location,weather_condition,temperature=get_weather()>>>print(f"\n현재 위치: {location}")현재위치:동작구신대방2동
>>>print(f"현재 날씨: {weather_condition}")현재날씨:맑음
>>>print(f"현재 온도: {temperature}°")현재온도:19.3°
>>>DEV$gitclone...
$cd...
$pdmvenvcreate
$source.venv/bin/activate(dj-weather-show-3.8)$pdminstallTEST$pdmadd-dGtestpytestpytest-cov
$pytest
$pytest-s
$pytest--covDEPLOY$pdmpublishREFweather data :https://weather.naver.com/https://pypi.org/project/hello-aaingyunii_pr
Package: djwebdapp
**Documentation**Django is a great web application framework “for perfectionists with deadlines”.A dApp is an app running on the blockchain: a smart contract on which users can
call functions on.This module provides blockchain support for Django, for reading and/or writing
the blockchain, with the following features usable independently:blockchain indexerprivate key vaultblockchain writerblockchain data normalizationmultiple blockchain support (tezos & ethereum so far)inter-blockchain contract synchronisationmetamask authentication backend (TBA)In addition to these features, djWebdApp differenciates itself from indexers
like dipdup because it is extensible: it’s just a module you add to your Django
project like any other Django App, in which you can add models, endpoints, and
have an admin interface for free, and so on, benefiting from thevast Django
ecosystem of apps.Video demosTezos tutorial demoEthereum tutorial demoGetting startedDjango basicsIf you are not familiar with the Django development framework, it is
recommended you followtheir tutorial first, even though you
can go through this tutorial copy/pasting your way.You may use the demo project or create your own and install djwebdapp there.InstallTo install djwebdapp with all optional dependencies:pip install djwebdapp[all][binary]Don’t use[binary]right there if you prefer to install compiled python
packages from your system package manager.See setup.py’s extra_requires for other possibilities.Demo projectFor this tutorial, we’ll use thedjwebdapp_demoproject:gitclonehttps://yourlabs.io/oss/djwebdapp.gitcddjwebdapppipinstall--editable.[all][binary]./manage.pymigrate./manage.pyshellLocal blockchainsInstead of using mainnets for development, we’re going to use a local
blockchains, so that we can work completely locally.We provide adocker-compose.ymlin the root directory of this repository,
rundocker-composeupto start it.As some of us will also want to convert this toGitLab-CI
services, we’ll refer to our services
by hostname from now on, which is why we add the following to/etc/hosts:127.0.0.1 tzlocal tzkt-api ethlocalYou should then have:a local ethereum HTTP RPC API onethlocal:8545with a WebSocket onethlocal:30303,a local tezos sandbox ontzlocal:8732which autobakes every second,
useable like geth development mode.a local tezos indexer to use the contract history download() function.See documentation forExample contract deploymentin each blockchain
specific documentation pages for more pointers.Custom projectInstead of the demo project, you can also create your own project, instead of
the first step of cloning do:rundjango-adminstartproject your_project_nameinyour_project_name/your_project_name/settings.py, add toINSTALLED_APPS:'djwebdapp', 'djwebdapp_tezos', 'djwebdapp_ethereum'… Seedjwebdapp_demo/settings.pyfor other
INSTALLED_APPS you can useproceed with the next stepsmigrate`, ``createsuperuser,runserver…TutorialRead documentationonlineor in thedocs/directory.
Package: dj-webdav-storage
This application allows you easily save media and static files into webdav storage.DependenciesrequestslibraryInstallationInstall the packagepipinstalldjango-webdav-storagePick the webdav server url inWEBDAV_URLandWEBDAV_PUBLIC_URL:WEBDAV_URL='http://webdav.example.com/',WEBDAV_PUBLIC_URL='http://webdav.example.com/'If you want use HTTP Basic authorization to webdav access, you can specify
your credentials like that:WEBDAV_URL='http://johndoe:secret@webdav.example.com/'Set the webdav storage class as default:DEFAULT_FILE_STORAGE='django_webdav_storage.storage.WebDavStorage'If your webdav backend can’t recursively create path (e.g.nginx can do this, while apache can’t), set theWEBDAV_RECURSIVE_MKCOLvariable toTrue:WEBDAV_RECURSIVE_MKCOL=TrueIf you use nginx as webdav server and want to enable storage directory listing, set the WEBDAV_LISTING_BACKEND option to:WEBDAV_LISTING_BACKEND='django_webdav_storage.listing.nginx_autoindex'Autoindex feature must be enabled in your nginx configuration for application servers (see example below). Be careful! Allowing autoindex for any user may lead to security and performance issues.Also, you may specify path to other function with the following interface:deflistdir(storage_object,path_string):returndirs_list,files_listThe nginx webdav configuration example# Public readonly media server.server{listen80;charsetutf-8;server_tokensoff;server_namemedia.example.com;access_log/var/log/nginx/media_access.log;error_log/var/log/nginx/media_error.log;root/usr/share/nginx/webdav;}# WebDAV serverserver{listen80;charsetutf-8;server_tokensoff;server_namewebdav.example.com;access_log/var/log/nginx/webdav_access.log;error_log/var/log/nginx/webdav_error.log;root/usr/share/nginx/webdav;client_max_body_size10m;client_body_temp_path/tmp;create_full_put_pathon;autoindexon;dav_methodsPUTDELETEMKCOLCOPYMOVE;dav_accessuser:rwgroup:rall:r;satisfyany;allow127.0.0.1/32;denyall;auth_basic'MyWebDAVarea';auth_basic_user_file/usr/share/nginx/.htpasswd;}CaveatsIn python 3.xContentFilewith text mode content (not binary one) will causesTypeErrorduerequestsrestrictions
Package: dj-webhooks
Django + Webhooks Made EasyThe full documentation is athttps://dj-webhooks.readthedocs.org.RequirementsPython 2.7.x or 3.3.2 or higherdjango>=1.5.5django-jsonfield>=0.9.12django-model-utils>=2.0.2django-rq>=0.6.1webhooks>=0.3.1QuickstartInstall dj-webhooks:pip install dj-webhooksConfigure some webhook events:# settings.pyWEBHOOK_EVENTS=("purchase.paid","purchase.refunded","purchase.fulfilled")Add some webhook targets:fromdjango.contrib.authimportget_user_modelUser=get_user_model()user=User.objects.get(username="pydanny")fromwebhooks.modelsimportWebhookWebhookTarget.objects.create(owner=user,event="purchase.paid",target_url="https://mystorefront.com/webhooks/",header_content_type=Webhook.CONTENT_TYPE_JSON,)Then use it in a project:fromdjango.contrib.authimportget_user_modelUser=get_user_model()user=User.objects.get(username="pydanny")fromdjwebhooks.decoratorsimporthookfrommyproject.modelsimportPurchase# Event argument helps identify the webhook target@hook(event="purchase.paid")defsend_purchase_confirmation(purchase,owner):# Webhook_owner also helps identify the webhook targetreturn{"order_num":purchase.order_num,"date":purchase.confirm_date,"line_items":[x.skuforxinpurchase.lineitem_set.filter(inventory__gt=0)]}forpurchaseinPurchase.objects.filter(status="paid"):send_purchase_confirmation(purchase=purchase,owner=user)In a queue using django-rqAssuming you are running Redis and also have django-rq configured:fromdjango.contrib.authimportget_user_modelUser=get_user_model()user=User.objects.get(username="pydanny")# import redis hookfromdjwebhooks.decoratorsimportredis_hookfrommyproject.modelsimportPurchase# Event argument helps identify the webhook target@redis_hook(event="purchase.paid")defsend_purchase_confirmation(purchase,owner):# Webhook_owner also helps identify the webhook targetreturn{"order_num":purchase.order_num,"date":purchase.confirm_date,"line_items":[x.skuforxinpurchase.lineitem_set.filter(inventory__gt=0)]}forpurchaseinPurchase.objects.filter(status="paid"):job=send_purchase_confirmation(purchase=purchase,owner=user)FeaturesSynchronous webhooksDelivery tracking via Django ORM.Options for asynchronous webhooks.Planned FeaturesDelivery tracking via Redis and other write-fast datastores.History0.2.1 (2014-05-17)Removed conf.py file as it just added abstractionCreated exlicitly importable hooks. Makes settings management easier.Removed utils.py since we no longer do fancy dynamic imports (see previous bullet).Coverage now at 100%0.2.0 (2014-05-15)Refactored the senders to be very extendable.Added an ORM based sender.Added a redis based sender that uses django-rq.Added aredis-hookdecorator.Added admin views.Ramped up test coverage to 89%.setup.py now includes all dependencies.0.1.0 (2014-05-12)First release on PyPI.