Saravanan666/pypi-org huggingface dataset:
Package: django-emoji-picker
django-emoji-pickerDjango app providing text input and textarea widgets with emoji picker.
It's based onemoji-mart.ScreenshotUsageThis package contains a Django app that provides two widgets:EmojiPickerTextInputEmojiPickerTextareaExampleInstallation$pipinstalldjango-emoji-pickeror$pipenvinstalldjango-emoji-pickersettings.pyINSTALLED_APPS=[...,'emoji_picker',]<app>/admin/<model>.py(for use with Django Admin)fromemoji_picker.widgetsimportEmojiPickerTextInputAdmin,EmojiPickerTextareaAdminclassYourModelForm(forms.ModelForm):short_text=forms.CharField(widget=EmojiPickerTextInputAdmin)long_text=forms.CharField(widget=EmojiPickerTextareaAdmin)Building from source$yarn
$yarnbuild
Package: django-emojiwatch
Copyright and other protections apply.
Please see the accompanyingLICENSEandCREDITSfile(s) for rights and restrictions governing use of this software.
All rights not expressly waived or licensed are reserved.
If those files are missing or appear to be modified from their originals, then please contact the author before viewing or using this software in any capacity.Curious about integrating your project with the above services?
Jeff Knupp (@jeffknupp)describes how.django-emojiwatchdjango-emojiwatchis a bare bones Slack app for posting custom emoji updates to a designated channel.
It is licensed under theMIT License.
See theLICENSEfile for details.
Source code isavailable on GitHub.
Seethe docsfor more information.UseSeethe introduction.IssuesIf you find a bug, or want a feature, pleasefile an issue(if it hasn’t already been filed).
If you’re willing and able, considercontributing.
Package: django-emoticons
Django-emoticons is a django application providing utilities to addemoticonsin your templates. Pretty incredible no?ContentsInstallUsageFilter UsageTag UsageIndexSettingsInstallOnce you have installed the package in yourPYTHON_PATH, register theemoticonsanddjango.contrib.staticfilesapps in yourINSTALLED_APPSproject’s section.INSTALLED_APPS = (
  ...
  'django.contrib.staticfiles',
  'emoticons',
  ...
)UsageFilter UsageFor our example we will make a template who display the fieldcontentof
a model, this field has this value:Coding is fun and sexy :DSo in our templates we will load theemoticons_tagslibrary and use theemoticonsfilter:{% load emoticons_tags %}

{{ object.content|emoticons }}Which will render:Coding is fun and sexyTag UsageThe emoticons app also provides a tag namedemoticonsfor converting raw
text.{% load emoticons_tags %}
{% emoticons %}
Documenting is boring but usefull :p
{% endemoticons %}Which will render :Documenting is boring but usefullIndexIf you want to retrieve a list of all availables emoticons you can use theemoticons_indextag.{% load emoticons_tags %}
{% emoticons_index as emoticons_list %}
{% for emoticons in emoticons_list %}
<p>{{ emoticons.0|emoticons }}: {{ emoticons|join:" " }}</p>
{% endfor %}SettingsYou can use differents settings for customizing the application:EMOTICONS_DIRECTORYThe directory where the emoticons files are located, use'emoticons'as default.EMOTICONS_LISTThe list of the emoticons used by the application, something like this:(('(devil)', 'devil.gif'),
 ('(angel)', 'angel.gif'),
 ((':)', ':-)', ':=)', '(smile)'), 'smile.gif'),
 ((':(', ':-(', ':=(', '(sad)'), 'sadsmile.gif'),
)If the HTML code of the emoticons does not fit to your needs, you can
override the'emoticons/emoticon.html'template to adjust it.
Package: django-empty-users-app
Django Empty Users AppThis app can be helpful for migrating to custom user model in existing Django project that already has users in database.To learn more, please read this:https://testdriven.io/blog/django-custom-user-model-migration/I've made an app with 1 empty migration file, so you don't have to create it yourself.Installationpipinstalldjango-empty-users-appUsageAdduserstoINSTALLED_APPSin yoursettings.pyfile.INSTALLED_APPS=[...'users',...]Then run migrations:pythonmanage.pymigrateAfter performing migrations in all your environments, you can remove this app fromINSTALLED_APPSand delete it from your project.LicenseMIT
Package: django-emulate-aws-env
Emulates the conditions of an AWS “Serverless” environment (API Gateway+Lambda) in your test and development
environments (such as those deployed byZappa).QuickstartInstall Django Emulate AWS Env:pip install django-emulate-aws-envAdd the Django Emulate AWS Env middleware. This should be the highest possible priority in your list and just in your
development and test environments:MIDDLEWARE=['emulate_aws_env.middleware.modify_request',...]Or if you’re using a dedicated settings file for tests/development:from.baseimport*...MIDDLEWARE=['emulate_aws_env.middleware.modify_request']+MIDDLEWAREFeaturesTheAPI Gatewayservice has the following restrictions which aren’t present in the default environment used to test
Django projects:It doesn’t allow duplicate query string namesThe request content length can’t exceed 10485760 bytesThe provided middleware modifies the request to these restrictions.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-05-05)First release on PyPI.
Package: django-encode
django-encodeallows you to encode and transfer media files async.InstallationUsepipto install the download and install the package fromPyPi:pip install django-encodeOr checkout the source code fromGithub:git clone https://github.com/collab-project/django-encode.git
cd django-encode
pip install -e .The dependencypython-video-converteris not available on PyPi and needs to be installed
manually:pip install -e git+https://github.com/thijstriemstra/python-video-converter.git#egg=python-video-converterDocumentationDocumentation can be found onreadthedocs.org.
Package: django-encore
Django EncoreThis library integratesWebpack Encoreinto your Django application like
it doesWebpack Encore Bundlefor Symfony.UsageInstall the library from PyPI:pipinstalldjango-encoreConfigure yoursettings.pyfile:Include the library:INSTALLED_APPS=[# ...'encore',]AddENCORE_ENTRYPOINTS_FILEand changeSTATICFILES_DIRS:STATICFILES_DIRS=[os.path.join(BASE_DIR,'assets_build'),]ENCORE_ENTRYPOINTS_FILE=os.path.join(BASE_DIR,'assets_build')+'/build/entrypoints.json'Use template tags in your templates:{% load encore %}

{% block javascripts %}
    {{ block.super }}
    {% encore_entry_script_tags 'demo1' %}
{% endblock %}

{% block stylesheets %}
    {{ block.super }}
    {% encore_entry_link_tags 'demo1' %}
{% endblock %}See theexamplefolder for more details.DevelopmentFirst of all, install dependencies by pipenv:cd example/webapp

pipenv install --dev
pipenv shell # to shell with virtual environmentSecond, build files using Encore:npm run devThen you can start the web server:python manage.py runserver
Package: django-encrypt
Interface for storing arbitray python objects.  Uses a user'spassword as the cypher to store an object in TextField.Object must be able to be pickeled. Authentication is done byusing django authenitication module.Models.pyMethods Prototypesdef set(self, user, password, obj):'''Setting an encrypted string. Password must be theuser's password.  Can encrypt a object that can bepickeled.'''return 0 # Everything okdef get(self, user, password):'''Retreving an encrypted string.  Password must be theuser's password.  Returns a python object.'''return object
Package: django-encrypted-model-fields
Django Encrypted Model FieldsAboutThis is a fork ofhttps://github.com/foundertherapy/django-cryptographic-fields. It has
been renamed, and updated to properly support Python3 and latest
versions of Django.django-encrypted-model-fieldsis set of fields that wrap standard
Django fields with encryption provided by the python cryptography
library. These fields are much more compatible with a 12-factor design
since they take their encryption key from the settings file instead of a
file on disk used bykeyczar.While keyczar is an excellent tool to use for encryption, it's not
compatible with Python 3, and it requires, for hosts like Heroku, that
you either check your key file into your git repository for deployment,
or implement manual post-deployment processing to write the key stored
in an environment variable into a file that keyczar can read.Generating an Encryption KeyThere is a Django management commandgenerate_encryption_keyprovided
with theencrypted_model_fieldslibrary. Use this command to generate
a new encryption key to set assettings.FIELD_ENCRYPTION_KEY:./manage.py generate_encryption_keyRunning this command will print an encryption key to the terminal, which
can be configured in your environment or settings file.NOTE: This command will ONLY work in a CLEAN, NEW django project that
does NOT import encrypted_model_fields in any of it's apps.IF you are
already importing encrypted_model_fields, try running this in a python
shell instead:import os
import base64

new_key = base64.urlsafe_b64encode(os.urandom(32))
print(new_key)Getting Started$ pip install django-encrypted-model-fieldsAdd "encrypted_model_fields" to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'encrypted_model_fields',
)django-encrypted-model-fieldsexpects the encryption key to be
specified usingFIELD_ENCRYPTION_KEYin your project'ssettings.pyfile. For example, to load it from the local environment:import os

FIELD_ENCRYPTION_KEY = os.environ.get('FIELD_ENCRYPTION_KEY', '')To use an encrypted field in a Django model, use one of the fields from
theencrypted_model_fieldsmodule:from encrypted_model_fields.fields import EncryptedCharField

class EncryptedFieldModel(models.Model):
    encrypted_char_field = EncryptedCharField(max_length=100)For fields that requiremax_lengthto be specified, theEncryptedvariants of those fields will automatically increase the size of the
database field to hold the encrypted form of the content. For example, a
3 character CharField will automatically specify a database field size
of 100 characters whenEncryptedCharField(max_length=3)is specified.Due to the nature of the encrypted data, filtering by values contained
in encrypted fields won't work properly. Sorting is also not supported.Development EnvironmentAdded Tox for testing with different versions of Django and Python. To get started:
pip install -r requirements/dev.txtusingpyenvadd the requisite python interpreters::
pyenv install 3.6.15pyenv install 3.7.12pyenv install 3.8.12pyenv install 3.9.10pyenv install 3.10.2Add the requisite versions to the local version::
pyenv local 3.6.15 3.7.12 3.8.12 3.9.10 3.10.2Runtox::
tox
Package: django-endesive
Django endesive PDF digital signing utility. This package allows you to digitally sign a PDF document from your Django
application. It is based onhttps://github.com/m32/endesiveIn order to digitally sign your pdf documents you will need a valid p12 / pfx certificate. You can use a self-signed
certificate for testing purposes but you should aquire a certificate from a Certificate Authority for production.Special PDF certificates issued by partners on theAATL(Adobe Approved Trust List).DocumentationThe full documentation is athttps://django-endesive.readthedocs.io.QuickstartInstall Django Endesive:pip install django-endesiveAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_endesive.apps.DjangoEndesiveConfig',...)Add the following to your setup to your settings.py file:DJANGO_ENDESIVE={'PDF_CERTIFICATE_PATH':'required: /path/to/your/certificate','PDF_CERTIFICATE_PASSWORD':'optional: certificate password if applicable','PDF_ATTRIBUTES':{'CONTACT':'optional: <you@example.com>','LOCATION':'optional: <your location>','REASON':'optional: <Reason for Document validation>'}}Here is a rather contrived example of how you would sign your pdf:fromdjango_endesiveimportpdffromendesive.pdfimportfpdf# Generate a pdf file (this could be any file already generated by your app)doc=fpdf.FPDF()doc.add_page()doc.set_font('helvetica','',13.0)doc.cell(w=75.0,h=22.0,align='C',txt='Hello, world page=1.',border=0,ln=0)doc.output('./pdf.pdf',"F")# Open file and feed bytes to the sign functionpdf_bytes=open('./pdf.pdf','rb').read()signed_pdf=pdf.sign(pdf_bytes=pdf_bytes)# signed_pdf bytes can now be written to a bytestream in memory or saved to a file on diskRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageEndesiveAuthorThis project was created by Lance Moore fromEngineer ROI.History0.1.0 (2018-12-04)First release on PyPI.0.2.0 (2019-12-24)All certificates passphrases are now bytes (As per deprecation warning).Added support and tests to include Django 2.1 - 3.0Added support and tests to include Python 3.7 - 3.8PEP8 formatting errors
Package: django-endless-pagination
Django Endless Pagination can be used to provide Twitter-style or
Digg-style pagination, with optional Ajax support and other features
like multiple or lazy pagination.The initial idea, which has guided the development of this application,
is to allow pagination of web contents invery few steps.Documentationisavaliable online, or in the docs
directory of the project.To filebugs and requests, please usehttps://github.com/frankban/django-endless-pagination/issues.Thesource codefor this app is hosted athttps://github.com/frankban/django-endless-pagination.TheMercurial repositoryof this project is hosted athttps://bitbucket.org/frankban/django-endless-pagination.
Package: django-enforced-choices
Django-enforced-choicesDjango doesnotenforce choices at the model level: yes aModelFormcan validate these, but unfortunately people oftend define form fields themselves or even worse don't work with anyFormorSerializerat all. So this means that if we define a model:class Movie(models.Model):
    genre = models.CharField(max_length=1, choices=[('d', 'drama'), ('h', 'horror')])The database willnotenforce that one can only pick'd'or'h'as genre. A simple solution might be to encapsulate the item in a separate model, and then theFOREIGN KEYconstraint will take care of this:class Genre(models.Model):
  id = models.CharField(max_length=1, primary_key=True)
  name = models.CharField(max_length=128)


class Movie(models.Model):
  genre = models.ForeignKey(Genre, on_delete=models.PROTECT)we can then fill the table with a data migration for example. This also makes some sense: a quote I once heared is that there should only be three constants in programming: zero, one and infinity, meaning that typically one should not restrict the number of genres.But regardless, people often use the former model. This is good if we work withForms, orSerializers, but models don't (eagerly) validate data, and even if they did, the database does not know about the choices, and thus will happily accept's'as value (for example for science fiction).What does this package provide?This package provides aChoicesConstraintModelMixinmixin to mix into models. This will look for the model fields, and if there are choices it will addCheckConstraints for these fields. One can exclude certain fields that have choices by adding the corresponding names in a class attribute namedexclude_choice_check_fields, which is by default empty.Another option is to import the correspond field from thedjango_enforced_choices.fieldsmodule, ordjango_enforced_choices.fields.postgresfor PostgreSQL-specific fields. This will, by default, also check if the fields have choices, but we donotrecommend to use these, since this means the field has for example as typeChoiceCharField, and certain Django functionalities (and packages) sometimes check full type equality to determine a widget, not through aninstanceof. This thus means that certain functionalities might no longer work as intended.UsageOne can import theChoicesConstraintModelMixinand mix it into a model, like:from django_enforced_choices.models import ChoicesConstraintModelMixin

class Movie(ChoicesConstraintModelMixin, models.Model):
    genre = models.CharField(max_length=1, choices=[('d', 'drama'), ('h', 'horror')])this will then addCheckConstraints to the model to enforce thatgenreonly can contain'd'and'h'at the database side.How does the package work?For the fields defined, it will check if thechoicesare defined. If that is the case, it will create aCheckConstraintwithfieldname__inwith the keys in the choices. If the field is NULLable, it will also allowNULL/Noneto be used.
Package: django-engineplate
# Setting up..## Register and account on pypi.python.org## Share a public key with the website## then in a folder create a setup.py file> In the setup.py file add the following content*from distutils.core import setup**setup(*    name='TowelStuff',*    version='0.1.0',*    author='J. Random Hacker',*    author_email='jrh@example.com',*    packages=['towelstuff', 'towelstuff.test'],*    scripts=['bin/stowe-towels.py','bin/wash-towels.py'],*    url='http://pypi.python.org/pypi/TowelStuff/',*    license='LICENSE.txt',*    description='Useful towel-related stuff.',*    long_description=open('README.txt').read(),*    install_requires=[*        "Django >= 1.1.1",*        "caldav == 0.1.4",*    ],*)> Then in console do the following steps> > python setup.py sdist  # To init distribution> > python setup.py register ## To register it to site> > python setup.py sdist upload ## to upload the distribution on the internet> For updating we have do the following things> > First we have to run> > > change the version number to anything new ...> > > python setup.py sdist upload
Package: django-enhanced-emails
django-enhanced-emails 💌🔋 Batteries-included emails for Django.Powerful templating engineMultipart emails by default (HTML + text)Web version rendering (with admin)Easy file attachmentand more ...Getting startedSimple setupInstall the package:pipenv install django-enhanced-emailsCreate a new email class:# myapp/emails.pyfromenhanced_emailsimportEnhancedEmailclassWelcomeEmail(EnhancedEmail):subject="Welcome to our site!"html_template="emails/welcome.html"<!-- myapp/templates/emails/welcome.html --><strong>Welcome to our site {{first_name}}!</strong><br/>Best, The OurSite teamInstanciate an email and send it:email=WelcomeEmail(to=[user.email],context={"first_name":user.first_name})email.send()✨ All done! Our user received something like:Content-Type:multipart/alternative;boundary="===============7747654958126582044=="MIME-Version:1.0Subject:helloFrom:hello@oursite.comTo:user@gmail.comDate:Wed, 11 Apr 2018 17:13:02 -0000Message-ID:<152346678269.275.17989388690220812241@cf7f5f3375c9>--===============7747654958126582044==Content-Type:text/plain;charset="utf-8"MIME-Version:1.0Content-Transfer-Encoding:7bitWelcome to our site Elon!

Best,
The OurSite team
--===============7747654958126582044==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

<strong>Welcome to our site Elon!</strong>

Best,
The OurSite team
--===============7747654958126582044==--Advanced setup (for web version rendering)Add theenhanced_emailsapp toINSTALLED_APPS:# settings.pyINSTALLED_APPS=[..."enhanced_emails",...]Add a new entry tourlpatterns:# urls.pyurlpatterns=[path("admin/",admin.site.urls),path("emails/",include("enhanced_emails.urls")),...]UseWebVersionEnhancedEmailinstead ofEnhancedEmail:fromenhanced_emailsimportWebVersionEnhancedEmailclassWelcomeEmail(WebVersionEnhancedEmail):subject="Welcome to our site!"html_template="emails/welcome.html"Use theweb_urlvariable in the email template:<!-- myapp/templates/emails/welcome.html --><strong>Welcome to our site {{ first_name }}!</strong><br/>Best, The OurSite team<br/><ahref="{{ web_url }}">View in browser</a>Instanciate an email and send it (notice that we need to pass the request as well now):email=WelcomeEmail(to=[user.email],context={'first_name':user.first_name},request=request)email.send()The email is visible in the admin and on the site! ✨DevelopmentDeploy:python setup.py sdist && twine upload dist/*
Package: django-enhanced-settings
django-enhanced-settingsAllow for more complex and dynamic settings for Django.Extrascloud-secret-manager- Adds support for Google Cloud Secret ManagerExampleimportosfromdjango_enhanced_settingsimportSettingsBASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))settings=Settings(BASE_DIR)def__dir__():returnsettings.dir(globals())def__getattr__(name):returnsettings.getattr(name,globals())_DEBUG=settings.boolean_value('DJANGO_DEBUG',False)_ALLOWED_HOSTS=settings.list_value('DJANGO_ALLOWED_HOSTS',['localhost']if_DEBUG.valueelse[],split_char=';')_SECRET_KEY=settings.string_value('DJANGO_SECRET_KEY',required=True)INSTALLED_APPS=[...]fromdjango.confimportsetingssettings.DEBUG# By default returns FalseRulesYou are not allowed to name a nonConfigValueusing the naming scheme set for theSettingsinstance (suffix_underscore). For example, writing the following would raise aValueErrorin the above example:_INSTALLED_APPS=[...]You are not allowed to name aConfigValuewithout using the naming scheme set for theSettingsinstance (suffix_underscore). For example, writing the following would raise aValueErrorin the above example:SECRET_KEY=settings.string_value('DJANGO_SECRET_KEY',required=True)You are not allowed to define 2 variable names that result in the same accessible name. For example, writing the following would raise aValueErrorin the above example:_SECRET_KEY=settings.string_value('DJANGO_SECRET_KEY',required=True)SECRET_KEY='SECRET_KEY'If you would like to customise these rules you can write your own__dir__and__getattr__.Cache values on first runIf you would like to cache all your static values at once, you can appendSettings.cache_static_values(...)to the bottom of your settings file. For the example above, this would fetchDEBUG,ALLOWED_HOSTSandSECRET_KEY:settings.cache_static_values()If you are not usingSettings.dir(...)andSettings.getattr(...), you may need to write your own function insead of usingSettings.cache_static_values(...).
Package: django-enquiry
A reusable Django app to host multilingual polls on your site.InstallationIf you want to install the latest stable release from PyPi:$ pip install django-enquiryIf you feel adventurous and want to install the latest commit from GitHub:$ pip install -e git://github.com/bitmazk/django-enquiry.git#egg=enquiryAddenquiryto yourINSTALLED_APPS:INSTALLED_APPS = (
    ...,
    'enquiry',
)Run the South migrations:./manage.py migrate enquiryURLs or ApphookYou can just add the enquiry urls to yoururls.pyor choose the
apphook in your django-cms page.Templatetagsrender_current_pollThis inclusion tag allows you to render the currently active poll anywhere
on your site:{% load enquiry_tags %}
{% render_current_poll %}If you want to customize the ouput of this tag, please override theenquiry/current_poll.htmltemplate.get_current_pollThis assignment tag allows you to get the current poll and render it however
you like it:{% load enquiry_tags %}
{% get_current_poll as poll %}
<h1>{{ poll.get_translation.question }}</h1>ContributeIf you want to contribute to this project, please perform the following steps:# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-enquiry
$ pip install -r requirements.txt
$ ./logger/tests/runtests.sh
# You should get no failing tests

$ git co -b feature_branch master
# Implement your feature and tests
# Describe your change in the CHANGELOG.txt
$ git add . && git commit
$ git push origin feature_branch
# Send us a pull request for your feature branchWhenever you run the tests a coverage output will be generated intests/coverage/index.html. When adding new features, please make sure that
you keep the coverage at 100%.RoadmapCheck the issue tracker on github for milestones and features to come.