Saravanan666/pypi-org huggingface dataset:
Package: djamqpconsumer
What is this============Adds a custom command which opens a blocking connection with an AMQP server and passes messages to a callback fuctionSettings--------This settings are requiered for the command run``COM_BROKER``AMQP server ip``COM_VHOST``AMQP server Virtual Host``COM_USERNAME``AMQP server User name for the virtual host``COM_PASSWORD``Username's password``COM_QUEUE``Which queue listen to``CONSUMER_CALLBACK``Path to the callback func. ex.: djamqpconsumer.printconsumer.printdataInstall-------Use pip to install from PyPI::pip install djamqpconsumerUsage-----Add ``djamqpconsumer`` to your settings.py file::INSTALLED_APPS = (...'djamqpconsumer',...)Use with manage.py::manage.py consumer [debug]0.6 (2014-03-27)================- Parse results to send nack/requeue commandscallback command must return a dict with{'result': 0/1'msg': String,'retry': Bool}- Use logging instead of printing0.5 (2014-02-21)================- Add pika dependency
Package: djams
django-microsite-bindingsBindings for django micrositesInstallationpip install django_microsite_bindingsThen, just adddjango_analytics_micrositestoINSTALLED_APPSin your Djangosettings.pyfile and the django_microsite_bindings.middleware toMIDDLEWARENote that this package requires version 2.0 or greater of Django, due to the use of thepathfunction for registering routes.
Package: djangelo
DjangeloDjango Plugin for tracking and rating actions with ELO system.Implementation ExampleYou have a blog.Your blog have posts.Each post have comments, likes and other user reactions.You want to evaluate which posts have lower or beyond user reactions in a quantitative wayThis is your solution!Main Features:Track activity of your Django ModelsCompare the activity of each Object with the activity of all objects trackedDetermine an ELO rating from this comparationCool Features:Easy to implementReady to useDocumentationOnlinePDF downloadGetting StartedDependenciespython >= 3.5Django >= 3InstallationpipinstalldjangeloAnd then, three simple stepsFIRST: Add djangelo into your INSTALLED_APPS and define which models you want to trackINSTALLED_APPS=[# ...'django.contrib.contenttypes','djangelo']DJANGELO={'RATED_MODELS':['myapp1.mymodel1','myapp1.mymodel2','myapp2.mymodel1',]}SECOND: Get elo values from your Model# Adding the ELORated on your models, those will be trackedfromdjango.dbimportmodelsfromdjangelo.utilsimportEloDescriptorclassMyModel(models.Model):elo=EloDescriptor()# ... here your code# You can also get and compare elo rated objectsinstance1.elo.value>>3.5instance1.elo>=instance2.elo>>TrueFINALLY: Define when your objects increments his rating.# To increse the elo rating just call elo.up() methodmyModelInstance.elo.up()myModelInstance.elo.down()CustomizationDJANGELO={# Increse the sensibility for more sensitive rating.# This make more impact for each tracked activity# by default is 32'SENSIBILITY':64,# You can define a default ELO value for the new objects created# by default is 1200'INITIAL_VALUE':4000'RATED_MODELS':[...]}ContributingContributors are wellcome! Any new feature will be well recibed as merge request or issue.LicenceLicensed over APACHE 2.0. SeeLICENSEManteinerThis software is developed and mantained byAgustin Jimenez.
Package: djang-frozen-data
Django Frozen DataDjango model custom field for storing a frozen snapshot of an object.PrinciplesBehaveslikeaForeignKeybut the data is detached from the related objectTransparent to the client - it looks and behaves like the original objectThe frozen object cannot be resavedSupports nesting of objectsUsageA frozen field can be declared like aForeignKey:classFoo:frozen_bar=FrozenObjectField(Bar,help_text="This is a frozen snapshot of the object.")fresh_bar=ForeignKey(Bar,help_text="This is a live FK relationship.")The field behaves exactly like a FK, with the exception that the object cannot be saved:>>>bar=Bar()>>>foo=Foo.objects.create(frozen_bar=bar,fresh_bar=bar)>>># the fresh field can be updated as you would expect>>>foo.fresh_bar.save()>>># the frozen field cannot - to prevent overwriting new data.>>>foo.frozen_bar.save()>>>StaleObjectError:'Object was frozen; defrosted objects cannot be saved.'Issues - TODODeserialization of DateField/DateTimeField valuesDeserialization of DecimalField valuesDeserialization of UUIDField valuesDeep object freezingRunning testsThe tests themselves usepytestas the test runner. If you have installed thepoetryevironment, you can run them thus:$ poetry run pytest
Package: djangify
DjangifyA Python script that converts HTML Files / Templates to Django compatible HTML Templates.Usage Infousername@hostname $ ./djangify.py -h
usage: djangify.py [-h] [-d [BASE_DIRECTORY]] [-a [APP_NAME]] [f [f ...]]

Converts specified html files or all html files to django format within a
specified directory.

positional arguments:
  f                    provide file names to convert

optional arguments:
  -h, --help           show this help message and exit
  -d [BASE_DIRECTORY]  Provide base directory
  -a [APP_NAME]        provide django app nameDescriptionConverts all the HTML files specified in the files (' f ') argument into Django templates, replacing the contents of 'src', 'href' and 'url' tags with their Django compatible static conterparts with their Django App name prefixed.For Example:To process a set of HTML files, copy the djangify.py script to the directory containing these HTML files, and run the following command, (Here 'blog' refers to the App name for which we are processing these files)$ ./djangify.py -a blogThis command will replace all local files referenced in 'src', 'href' and 'url' tags in the following way :Original :<imgclass="mySlides"src="res/landreg/1.jpg"style="width:100%"><li><ahref="register.html">Register</a></li>After script execution :<imgclass="mySlides"src=" {% static 'blog/res/landreg/1.jpg' %} "style="width:100%"><li><ahref=" {% static 'blog/register.html' %} ">Register</a></li>
Package: djangmx
djangmxhandles communications between django and AMX via UDPudp_to_amx(amx_ip, amx_rx_port, message):amx_ip: (string)IP address of the AMX master you're sending the message to.amx_rx_port: (integer default 10002)UDP port the AMX master will be listening on. This module does not listen for responses on this port.message: (string)Message to send to the AMX masteramx_to_django_listener(server_ip, server_rx_port, django_ip, django_port):server_ip: (string)IP address of the server that will be handling communications from AMX to django.server_rx_port: (integer default 10004)Port the server will listen on. "ACK\r" will be sent to AMX when messages are received.django_ip: (string)IP address of the django server. This may or may not be the same as server_ipdjango_port: (integer default 8000)Port that django's http server is running on. This must not match server_rx_port.If an AMX master sends a message with 'get_id' in it, the listener created by amx_to_django_listener() will http GET to:
http://django_ip:django_port/equipment/get_id/ip of the master that sent the messageThe django server will be configured to use udp_to_amx() to send the django IDs of all registered equipment associated with that AMX master.The AMX program assigns these IDs to the device structures in its programs, and these IDs will then be used in all status updates from the AMX master.The header used by AMX in these status updates is ':::' The delimiter is '' with a '' on the end.
Example status update of a projector::::35672TrueWarming UpOnline1244~The value and expected order of eachparameter~is handled in the AMX program and parsing within your django project.
Status messages from AMX can be strung together, as long as each message begins with:::The listener created by amx_to_django_listener() will separate the messages and http GET them to:
http://django_ip:django_port/equipment/amx_fb/messageHandling of this message will be done in your django project.
Package: dj-ango
Simplifying the import structure of Django.DocumentationThe full documentation is athttps://dj-ango.readthedocs.org.QuickstartInstall dj-ango:pip install dj-angoThen use it in a project:fromangoimportsettings,TemplateView,urlclassAboutView(TemplateView):template_name="about.html"defget_context_data(self,**kwargs):context=super(AboutView,self).get_context_data(**kwargs)context['is_debug_mode']=settings.DEBUGreturncontexturlpatterns=[url(regex=r'^about/$',view=AboutView.as_view(),name='about')]Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-text.txt
(myenv) $ python runtests.pyCreditsTools used in creating this package:Cookiecuttercookiecutter-djangopackage
Package: django10-enumfield
NoteClone of django-enumfield for django 1.10+Provides an enumeration Django model field (using IntegerField) with reusable enums and transition validation.InstallationCurrently,we teston supported versions of django and Python versions 2.7, 3.5.Installdjango-enumfieldin your Python environment:$pipinstalldjango-enumfieldFor testing with Django 1.9rc1, use$pipinstall--predjango-enumfield==1.3b2If you are looking for nativeenum(orenum34) support, try testingPull Request #26which is planned for Django 1.10+.UsageCreate an Enum-class and pass it as first argument to the Django model EnumField.fromdjango.dbimportmodelsfromdjango_enumfieldimportenumclassBeerStyle(enum.Enum):LAGER=0STOUT=1WEISSBIER=2classBeer(models.Model):style=enum.EnumField(BeerStyle,default=BeerStyle.LAGER)Beer.objects.create(style=BeerStyle.STOUT)Beer.objects.filter(style=BeerStyle.STOUT)You can use your own labels for Enum itemsclassAnimals(enum.Enum):CAT=1DOG=2labels={CAT:'Cat',DOG:'Dog'}The Enum-class provides the possibility to use transition validation.fromdjango.dbimportmodelsfromdjango_enumfieldimportenumclassPersonStatus(enum.Enum):ALIVE=1DEAD=2REANIMATED=3_transitions={DEAD:(ALIVE,),REANIMATED:(DEAD,)}classPerson(models.Model):status=enum.EnumField(PersonStatus)These transitions state that a PersonStatus can only go to DEAD from ALIVE and to REANIMATED from DEAD.person=Person.objects.create(status=PersonStatus.ALIVE)try:person.status=PersonStatus.REANIMATEDperson.save()exceptInvalidStatusOperationError:print"Person status can not go from ALIVE to REANIMATED"The Enum-class can also be used without the EnumField. This is very useful in Django form ChoiceFields.fromdjango.formsimportFormfromdjango_enumfieldimportenumclassGenderEnum(enum.Enum):MALE=1FEMALE=2labels={MALE:'Male',FEMALE:'Female',}classPersonForm(forms.Form)gender=forms.TypedChoiceField(choices=GenderEnum.choices(),coerce=int)Rendering PersonForm in a template will generate a select-box with “Male” and “Female” as option labels for the gender field.
Package: django-110-hCaptcha
A fork of django-hCaptcha by Andrej Zbín, Modified for Django 1.10 for hCaptcha support in legacy systemsDjango-110-hCaptcha provides a simple way to protect your django 1.10 forms usinghCaptcha.ConfigurationAdd “django-hcaptcha” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'hcaptcha',
]For development purposes no further configuration is required. By default, django-hCaptcha will use dummy keys.For production, you’ll need to obtain your hCaptcha site key and secret key and add them to you settings:HCAPTCHA_SITEKEY = '<your sitekey>'
HCAPTCHA_SECRET = '<your secret key>'You can also configure your hCaptcha widget globally (see all options):HCAPTCHA_DEFAULT_CONFIG = {
    'onload': 'name_of_js_function',
    'render': 'explicit',
    'theme': 'dark',  # do not use data- prefix
    'size': 'compact',  # do not use data- prefix
    ...
}If you need to, you can also override default hcaptcha endpoints:HCAPTCHA_JS_API_URL = 'https://hcaptcha.com/1/api.js'
HCAPTCHA_VERIFY_URL = 'https://hcaptcha.com/siteverify'Use proxies:HCAPTCHA_PROXIES = {
   'http': 'http://127.0.0.1:8000',
}Change default verification timeout:HCAPTCHA_TIMEOUT = 5UsageSimply add hCaptchaField to your forms:from hcaptcha.fields import hCaptchaField

class Forms(forms.Form):
    ....
    hcaptcha = hCaptchaField()
    ....You can override default config by passing additional arguments:class Forms(forms.Form):
    ....
    hcaptcha = hCaptchaField(theme='dark', size='compact')
    ....
Package: django12factor
What is it?Djangois an awesome Python web
framework.“The Twelve-Factor App“ is an awesome
methodology for building SaaS apps.django-12factormakes Django more 12factor-y. Right now, this
focuses on theConfig- “Store config
in the environment”;Herokuusers with
addons will be particularly familiar with this.Still not sure of the benefits? Check out
“Twelve-Factor Config: Misunderstandings and Advice”.UsageAdd the following to the bottom of yoursettings.py:importdjango12factord12f=django12factor.factorise()factorise()returns adictof settings, so you can now use and
assign them as you wish, e.g.DEBUG=d12f['DEBUG']LOGGING=d12f['LOGGING']If you don’t like that repetition, you can (ab)useglobals()like
so:importdjango12factord12f=django12factor.factorise()deff(setting):globals()[setting]=d12f[setting]f('DEBUG')f('LOGGING')You can also add non-Django settings this way, e.g. keys to APIs:custom_settings=("GOOGLE_ANALYTICS_KEY","MAILCHIMP_API_KEY",)d12f=django12factor.factorise(custom_settings=custom_settings)MAILCHIMP_API_KEY=d12f['MAILCHIMP_API_KEY']GOOGLE_ANALYTICS_KEY=d12f['GOOGLE_ANALYTICS_KEY']In the event of acustom_settingnot being set in the environment, it will
default toNone.Give me everything!If you say so…importdjango12factorglobals().update(django12factor.factorise())Utilitiesdjango12factor.getenv_boolis a utility function that takes the name of an
environment variable, and returnsTrue_unless_ it is set to either a
“falsey” string (e.g."no") or not set.SettingsThe following settings are currently supported:DEBUGDefaults toFalsefor safety reasons, otherwiseTrueunlessos.environ("DEBUG")is a “falsy” string.TEMPLATE_DEBUGAs forDEBUG, but defaults to the value ofDEBUG.CACHESUsesdjango-cache-urlto parseos.environ("CACHE_URL").LOGGINGA staticLOGGINGdict that configures12factor-style logging.DATABASESUsesdj-database-url-
parsesDATABASE_URLif it exists, otherwise falls back to in-memory sqlite.Anything of the formFOO_DATABASE_URLwill be parsed asDATABASES['foo'], allowing you to configure multiple databases via the
environment.ALLOWED_HOSTSTreatsos.environ("ALLOWED_HOSTS")as a comma-separated list.SECRET_KEYUsesos.environ("SECRET_KEY")- required ifDEBUG==False.
Package: django-1.6-fine-uploader
Django Fine Uploader=============================.. image:: https://img.shields.io/pypi/v/django-fine-uploader.svg:target: https://pypi.python.org/pypi/django-fine-uploader.. image:: https://img.shields.io/pypi/l/django-fine-uploader.svg:target: https://pypi.python.org/pypi/django-fine-uploader.. image:: https://img.shields.io/pypi/wheel/django-fine-uploader.svg:target: https://pypi.python.org/pypi/django-fine-uploaderSimple, Chunked and Concurrent uploads with Django_ + `Fine Uploader`_.. _Django: https://www.djangoproject.com.. _`Fine Uploader`: http://fineuploader.comThis is an alpha version.We have a example_ project. Just `git clone` the django-fine-uploader repository and follow the instructions... _example: https://github.com/douglasmiranda/django-fine-uploader/tree/master/exampleQuickstart----------Install django_fine_uploader::pip install django-fine-uploaderAdd it to your `INSTALLED_APPS`:.. code-block:: pythonINSTALLED_APPS = (...'django_fine_uploader',...)Add django_fine_uploader's URL patterns:.. code-block:: pythonurlpatterns = [...url(r'^fine-uploader/', include('django_fine_uploader.urls', namespace='django_fine_uploader')),...]And finally your html file: copy from `this gist`_. (too much html to put on our README).. _`this gist`: https://gist.github.com/douglasmiranda/77da9c801e0cf83357ba51a639372768Features--------* Simple Upload* Chunked Upload* Concurrent Chunked Upload* `Ready to use upload endpoint`_* `Easy extend FineUploaderView`_ (FormView)* Or create your custom view and use the Django Fine Uploader handler.. _`Ready to use upload endpoint`: https://github.com/douglasmiranda/django-fine-uploader/blob/master/django_fine_uploader/fineuploader.py.. _`Easy extend FineUploaderView`: https://github.com/douglasmiranda/django-fine-uploader/blob/master/django_fine_uploader/views.pySettings----TODO----Instead of listing here, check the issues_ and projects_... _issues: https://github.com/douglasmiranda/django-fine-uploader/issues.. _projects: https://github.com/douglasmiranda/django-fine-uploader/projectsRunning Tests-------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install tox(myenv) $ toxOR::make testCredits-------Tools used in rendering this package:*  Cookiecutter_*  `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageFineuploader: http://fineuploader.comHistory-------0.2.0.3 (2018-07-??)++++++++++++++++++++* Fixed pypi0.2.0.2 (2018-07-03)++++++++++++++++++++* Example updated to fine uploader 5.16.2* Purged widget0.2.0.1 (2018-07-02)++++++++++++++++++++* Back to Django 1.60.2.0 (2017-02-12)++++++++++++++++++* Now we have a `BaseFineUploader`* A basic planing for Beta release: https://github.com/douglasmiranda/django-fine-uploader/projects/1* Better info on README and more0.1.0 (2017-02-10)++++++++++++++++++* First release on PyPI.
Package: django-18-fast-migrations
Fast migrations from Django 1.10 backported into Django 1.8UsageInstall django_18_fast_migrations:pip install django_18_fast_migrationsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_18_fast_migrations',...)Done. Your migrations will now run faster.FeaturesNothing visible, except the time it takes migrations to run.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxOr:(myenv) $ cd $SOURCE_ROOT
(myenv) $ python tests/django_runtests.pyCreditsThe changes in Django’s migrations code which made this happen were mostly
made by Markus Holtermann and Simon Charette, of the Django project. Of
course, the Django project and in particular migrations have enjoyed many
contributors over the years.Our contribution here is just to package this code for use in Django 1.8.This work was partly supported byMatific.Tools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.1 (2017-06-01)Fixed a packaging error.Allowed package to be used on Django 1.9.x.0.1.0 (2017-04-06)First release on PyPI.
Package: django2-ajaximage
django-ajaximageAjax image uploads.Upload images via ajax. Images are optionally resized.Optimized onhttps://github.com/bradleyg/django-ajaximage.Features Appended:Correctly display the readonly fieldSupport django2 and aboveupload_tosupport datetime string formatChange FileField to ImageFileField to compatible with ImageFieldAdd format_image method to display custom image field using the same formatfrom ajaximage.utils import format_image
class xxxAdmin(ModelAdmin):
    ...
    def some_field(obj):
        return format_image(obj.some_field.ajaximagefield)SupportPython 3
Django > 2.0
Chrome / Safari / Firefox / IE10+InstallationInstall with Pip:pip install django-ajaximageDjango Setupsettings.pyINSTALLED_APPS=[...'ajaximage',...]# SettingsAJAXIMAGE_AUTH_TEST=lambdau:Trueurls.pyurlpatterns+=[path('ajaximage/',include('ajaximage.urls')),]Runpython manage.py collectstaticif required.Use in Django admin onlymodels.pyfromdjango.dbimportmodelsfromajaximage.fieldsimportAjaxImageFieldclassExample(models.Model):thumbnail=AjaxImageField(upload_to='thumbnails',max_height=200,#optionalmax_width=200,# optionalcrop=True)# optional# if crop is provided both max_height and max_width are requiredUse the widget in a custom formforms.pyfromdjangoimportformsfromajaximage.widgetsimportAjaxImageWidgetclassAjaxImageUploadForm(forms.Form):images=forms.URLField(widget=AjaxImageWidget(upload_to='form-uploads'))views.pyfromdjango.views.genericimportFormViewfrom.formsimportAjaxImageUploadFormclassMyView(FormView):template_name='form.html'form_class=AjaxImageUploadFormtemplates/form.html<html><head><metacharset="utf-8"><title>ajaximage</title>{{ form.media }}</head><body>{{ form.as_p }}</body></html>ExamplesExamples of both approaches can be found in the examples folder. To run them:$gitclonegit@github.com:bradleyg/django-ajaximage.git
$cddjango-ajaximage
$pythonsetup.pyinstall
$cdexample

$pythonmanage.pymigrate
$pythonmanage.pycreatesuperuser
$pythonmanage.pyrunserverVisithttp://localhost:8000/adminto view the admin widget andhttp://localhost:8000/formto view the custom form widget.
Package: django2-alexa
Django2 app for creating Alexa SkillsDjango app for easily creating Amazon Alexa Skills.By Tim Woocker & Malte MoslerTable of ContentPrerequisitesGetting StartedSettingsExamplesSupport1. PrerequisitesIf you're using Apache HTTP Server,use v2.4.10 or later!
FromAmazon's Docs:Note: if you are using Apache HTTP Server to host your web service, use version 2.4.10 or later. Earlier versions of Apache HTTP Server send an "unrecognized name" warning if the server is not configured with a ServerName or ServerAlias in the configuration files. This prevents the Alexa service from sending the customer's request to your server. To address this, either upgrade to 2.4.10 or later, or add ServerName / ServerAlias to your server's configuration file.2. Getting StartedYou can use pip to install this app:pip install django2-alexaIn your djangosettings.pyadd"django2_alexa"toINSTALLED_APPS:INSTALLED_APPS=[...'django2_alexa',...]In your current path create a django app with:pythonmanage.pystartappYourAppNameImport & create theSkillobject in yourviews.py:fromdjango2_alexa.interfaces.alexaimportSkillskill=Skill()Import theskillin yoururls.pyand add the view to your urlpatterns:fromYourAppName.viewsimportskillurlpatterns=[...path('',skill.view)...]You can use this library withDEBUGmode on insettings.py. The amazon server verification for timestamps however will be skipped. This will cause amazon to not accept your skill if you try to publish your skill inDEBUGmode.Now you are ready to develope your own skill for alexa! You can find a few exampleshere.3. SettingsThis django app adds some settings to your project:NameTypeDefaultDescriptionALEXA_VERIFY_CONNboolTrueThis setting specifies if every request to an alexa skill should be verified against the amazon servers. This is useful when testing your skill without Amazon's service.4. ExamplesAudio ResponseCard ResponseSlots5. SupportTwitter:@Tim Woocker@DeemonRider
Package: django2-auth0-auth
Django Auth0 AuthDjango Auth0 Authallows you to authenticate through Auth0 in Django 2InstallationRunpip install django2-auth0-authAdd theAuth0Backendto yourAUTHENTICATION_BACKENDSsetting:AUTHENTICATION_BACKENDS=(...'auth0_auth.backends.Auth0Backend',)Add theAuth0Middlewareto yourMIDDLEWAREsetting:MIDDLEWARE=[...'auth0_auth.middleware.Auth0Middleware']Edit yoururls.pyto include:fromdjango.views.genericimportRedirectViewurlpatterns=[...#Add this BEFORE you include the admin urls, so admin login will redirect to auth0 loginpath('admin/login/',RedirectView.as_view(pattern_name='auth0_login',permanent=False,query_string=True)),#Add the auth0 urlspath('auth0/',include('auth0_auth.urls')),...]SettingsAUTH0_DOMAINAuth0 domain.AUTH0_CLIENT_IDAuth0 client id.AUTH0_CLIENT_SECRETAuth0 client secret.AUTH0_SECRET_BASE64_ENCODEDdefault:FalseFlag if Auth0 client secret is base64 encoded.AUTH0_SCOPEdefault:'openid email'OAuth scope parameter.AUTH0_RESPONSE_TYPEdefault:'code'OAuth response type parameter.AUTH0_USER_CREATIONdefault:TrueAllow creation of new users after successful authentication.LoggingTo enable logging addauth0_authtoLOGGING['loggers']options.LOGGING={...,'loggers':{...,'auth0_auth':{'handlers':['console'],'level':'DEBUG',}}}