Saravanan666/pypi-org huggingface dataset:
Package: django-humanize
django-humanize − use humanize 3rd-party lib as template filters================================================================Django already offers[django.contrib.humanize](https://docs.djangoproject.com/en/1.8/ref/contrib/humanize/)but that implementation is lacking some features, like humanization ofdurations.That lib comes to the rescue allowing you to use *template filters*backed on [the standalone humanize lib](https://pypi.python.org/pypi/humanize).Install------Add `django_humanize` to your *INSTALLED_APPS* setting.Examples--------### Template{% load humanizelib %}It lasted {{ duration|naturaldelta }}.### Viewimport datetimefrom django.shortcuts import render_def summary(request):context = {'duration': datetime.timedelta(seconds=1000)}return render('template.html', context)Will render as *"lasted 16 minutes."*.Template filters----------------The following template filters are available :- naturalday- naturaltime- ordinal- intword- naturaldelta- intcomma- apnumber- fractional- naturalsize- naturaldateInternationalization---------------------Internationalization is supported and matches Django *LANGUAGE_CODE* setting. Ifit does not work, maybe, your language code is not supported by the standalonehumanize lib. Think about[contributing it](https://github.com/jmoiron/humanize/#localization).
Package: django-humanstxt
# Django HumansTXTDjango HumansTXT will make it easy to you to serve humans.txt file.## QuickstartInstall django-humanstxt using pip (we do recommend to do it in a virtualenv).pip install django-humanstxtTo integrate it into a Django project, simply add it to your `INSTALLED_APPS`:INSTALLED_APPS = [# some interesting stuff...'humanstxt',# some other stuff...]urlpatterns = [# ...url(r'^humans\.txt', include('humanstxt.urls')),# ...]python manage.py migrateYou're now ready to use the app.
Package: django-humans-txt
django-humans-txt is a Django reusable application to handle humans.txt (http://humanstxt.org/)ContentsInstallationConfigurationSettingsUsageContributingLicensingContactsInstallationObtain your copy of source code from the git repository:$ git clonehttps://github.com/vint21h/django-humans-txt.git. Or download the latest release fromhttps://github.com/vint21h/django-humans-txt/tags/.Run$ python ./setup.py installfrom the repository source tree or the unpacked archive. Or use pip:$ pip installdjango-humans-txt.ConfigurationAdd"humans_txt"tosettings.INSTALLED_APPS:# settings.pyINSTALLED_APPS+=["humans_txt",]Add"humans_txt"to your URLs definitions:# urls.pyfromdjango.urlsimportre_pathurlpatterns+=[re_path(r"^humans\.txt",include("humans_txt.urls")),]Run$ python ./manage.py migratein your project folder to apply app migrations.SettingsHUMANS_TXT_BANNERContains a banner that placed at the start of humans.txt response. Defaults to"".HUMANS_TXT_LAST_UPDATEContains project last update date. Defaults toNone.HUMANS_TXT_LANGUAGESContains list of site supported languages. Defaults toNone.UsageInclude"humans_txt/includes/humans_txt_meta.html"in your base template rel meta tag to<head>HTML tag:{# base.html #}<head>{%include"humans_txt/includes/humans_txt_meta.html"%}</head>Just fill Django humans.txt models instances in your admin in your taste.ContributingFork itInstallGNU MakeInstall and configurepyenvandpyenv-virtualenv pluginInstall and configuredirenvCreate environment config from examplecp.env.example.envInstall development dependencies:makeinstallCreate your fix/feature branch:gitcheckout-bmy-new-fix-or-featureCheck code style and moreover:makecheckRun tests:maketestPush to the branch:gitpushoriginmy-new-fix-or-featureCreate a new Pull RequestLicensingdjango-humans-txt is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (a
t your option) any later version.
For complete license text see COPYING file.ContactsProject Website:https://github.com/vint21h/django-humans-txt/Author: Alexei Andrushievich <vint21h@vint21h.pp.ua>For other authors list see AUTHORS file.
Package: django-hunger
Django-hunger provides a flexible private beta phase for Django
projects.Features and Design DecisionsThree ways to get into the beta.Users self-signup for the beta. An admin can choose to invite
them at any time.An admin can grant in-beta users with a limited number of
invites to invite their friends.An admin can create a limited number public beta code that
anybody can use to join the beta. Useful for
press releases.Hunger is a post-registration app, meaning the intended behavior
is to let users sign up freely, but restrict the rest of the site to
beta participants. This makes it easy to integrate with social login
and user management apps.Email as the method of choice for communication. Emails are used to
send people their invites.Flexible design with many entry points for customization of default
behavior.TODO: Tracking and user analytics for the beta phase. Want to know
which users are the most excited about your site? Find out by
analyzing the invite graph.DocumentationCheck out the full documentation athttp://django-hunger.readthedocs.org/.
Package: django-hunger2
Django-hunger provides a flexible private beta phase for Django
projects.This is a fork for unsupportedhttp://github.com/joshuakarjala/django-hungerapp.Features and Design DecisionsThree ways to get into the beta.Users self-signup for the beta. An admin can choose to invite
them at any time.An admin can grant in-beta users with a limited number of
invites to invite their friends.An admin can create a limited number public beta code that
anybody can use to join the beta. Useful for
press releases.Hunger is a post-registration app, meaning the intended behavior
is to let users sign up freely, but restrict the rest of the site to
beta participants. This makes it easy to integrate with social login
and user management apps.Email as the method of choice for communication. Emails are used to
send people their invites.Flexible design with many entry points for customization of default
behavior.TODO: Tracking and user analytics for the beta phase. Want to know
which users are the most excited about your site? Find out by
analyzing the invite graph.DocumentationCheck out the full documentation athttp://django-hunger.readthedocs.org/.
Package: django-huyho-polls
Polls is a simple Django app to conduct Web-based polls. For each
question, visitors can choose between a fixed number of answers.Detailed documentation is in the “docs” directory.Quick startAdd “polls” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'polls',
]Include the polls URLconf in your project urls.py like this:path('polls/', include('polls.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/polls/to participate in the poll.
Package: django-hydra
=====
HydraHydra is a Django app to build templates easily, and generate site page like django admin.Detailed documentation is in the "docs" directory.Quick startAdd "hydra" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'hydra',
]Include the polls URLconf in your project urls.py like this::path('polls/', include('polls.urls')),Runpython manage.py migrateto create the polls migrations.Continue
Package: django-hype
HypeA Django module that implements referral link logic.ConceptsThis library implements two models:TheReferralLink. This object represents a user's referral link, or invitation link.
It has a string identifier which allows the user to share their link as/ref/<refid>/.TheReferralHit. This is an instance of a user (logged in or anonymous) actually following
a referral link.The Anonymous CookieWhen a ReferralLink is followed, aReferralHitobject is created. If the link was followed
by a logged in user, that user will be available on the ReferralHit object as a foreign key.
If the link was followed by an anonymous user, a cookie will be set on the user for future
reference.The cookie contains a random UUID which is set on the ReferralHit. At any time, you may get
that cookie and, should the user log in, update all ReferralHit objects with that matching
UUID.
The library includes a middleware which will automatically do this for every logged in users,
seehype.middleware.AnonymousReferralMiddleware.Confirming ReferralsYou may wish to implement aSuccessfulReferralmodel which is created when a user who
previously followed aReferralLink(and thus created aReferralHit) actually completes
whichever steps the referral system requires referred users to complete (for example:
Register to the website, make their first purchase, post their first comment, ...).TheReferralHitmodel also has aconfirmedDateTimeField which you may use for this purpose.Supporting Referral Links on Any URLImplementers may find it useful to allow a referral on any URL. This is implemented in thehype.middleware.ReferralLinkMiddlewaremiddleware, which looks at all GET requests
and, should a valid referral link be present in the GET parameters, redirects to that referral
link's URL with thenextparameter set to the original URL, without the referral link present.Example:/accounts/signup/?ref=abc123defredirects to.../ref/abs123def?next=/accounts/signup/which redirects to.../accounts/signup/, after creating a ReferralHit.Setup and configurationInstall viapython -m pip install django-hypeAddhypeto yourINSTALLED_APPSIncludehype.urlsin your URLs. Example:url(r"^ref/", include("hype.urls"))Addhype.middleware.AnonymousReferralMiddlewareto yourMIDDLEWARE.
This is required to update referrals for anonymous users when they log in.(optional) Addhype.middleware.ReferralLinkMiddlewareto yourMIDDLEWARE.
This is required if you want?ref=...to redirect properly.These steps are enough to start gathering referral information.
You create a referral link, and watch theReferralHittable fill up as users follow it.In addition to having that data, you may want to "confirm" referrals. TheConfirmedReferralmodel is there as a convenience model to allow you to filter down the referral hits in question.
Upon creating a ConfirmedReferral you may also want to do something else, such as crediting a
user some points.
The atomicity and idempotency of such events is left as an exercise for the reader.LicenseThis project is licensed under the MIT license. The full license text is
available in the LICENSE file.
Package: django-hyperview
django-hyperviewDjango extensions for Hyperview mobile appsInstallation and SetupInstall with pippython-mpipinstalldjango-hyperviewConfigureAdd the app, once installed, to yourINSTALLED_APPSINSTALLED_APPS=[..."django_hv",...]Optionally, you can add theHyperviewMiddlewaremiddleware to your settings.MIDDLEWARE=[..."django_hv.middleware.HyperviewMiddleware",]Usagexml-based form fieldsAs with Django, you can dynamically create your xml-based forms with this package.from.modelsimportContactfromdjango_hv.formsimportModelFormfromdjango_hvimportwidgetsclassContactForm(ModelForm):classMeta:model=Contactfields=("first_name","last_name","phone_number","email")widgets={"first_name":widgets.TextField(attrs={"placeholder":"First name"}),"last_name":widgets.TextField(attrs={"placeholder":"Last name"}),"phone_number":widgets.TextField(attrs={"placeholder":"Phone number"}),"email":widgets.TextField(attrs={"placeholder":"Email address"}),}In your view you can initiate the form as usual:defcontact_new(request):context={"form":ContactForm(request.POSTorNone)}ifrequest.method=="GET":response=render(request,"new.xml",context)elifrequest.method=="POST":form=ContactForm(request.POST)ifform.is_valid():context["saved"]=Truecontext["contact"]=form.save()response=render(request,"form_fields.xml",context)returnhv_repond(response)And the xml template, you can render the form as follows:{%loadhv_tags%}<viewxmlns="https://hyperview.org/hyperview"style="edit-group">{%ifsaved%}<behaviortrigger="load"once="true"action="dispatch-event"event-name="contact-updated"/><behaviortrigger="load"once="true"action="reload"href="{{ contact.detail_url }}"/>{%endif%}
{%hv_csrf_tokenrequest%}
{{form}}</view>Note that you can create a CSRF token if you load the template tags of this package:{% hv_csrf_token request %}. It needs therequestas an argument since Django requires that object to create a token.Hyperview responseYou can use this package for your views.from.modelsimportContactfrom.formsimportContactFormfromdjango_hv.httpimporthv_reponddefcontact_detail(request,id):response=render(request,"show.xml",{"contact":Contact.objects.get(id=id)})returnhv_repond(response)defcontact_new(request):...returnHyperviewResponse(request,"new.xml",context={})Check if the request comes from a Hypermedia clientFor this to work, you need to addHyperviewMiddlewaretoMIDDLEWARE.defcontact_detail(request,id):template="show.xml"ifrequest.hvelse"show.html"response=render(request,template,{"contact":Contact.objects.get(id=id)})returnhv_repond(response)The propertyrequest.hvchecks if the request has a specific header that is passed by the Hypermedia client.
Package: django-hyval
HyvalHyval will store your information encrypted and decrypt it when needed :>Usage:instalation:for install package :pip install django-hyvalexample :1- in settings.py:HIDE_MY_VALUE = {
	'salt' : 'test',
	'key': 'test',
	'length' : 32,
	'iteration': 1000,
}2- in model:from django.db import models
from hyval import HideMyValue


class TestHyval(models.Model):
    name = models.CharField(max_length=50)
    password = HideMyValue(max_length=32)then:action = TestHyval()
action.name = "test"
action.password = "test"
action.save()Now your 'password' field on database stored with encryption so to retrieve value :my_model = TestHyval.objects.get(pk=1)
my_model.password
>>> 'test'mistakethere was mistake by me , so i deleted 'repository' and '.git' folder anciently, so there isn't any commit about past.
Package: django-i18n
i18n engine for Django FrameworkInstallationUse the package managerpipto install django-i18npip3installdjango-i18nSetupBefore using library, you need setup some things in your django project, please follow this stepsSetup all required variables in your settings.pyLOCALE='es'# MandatoryLOCALE_FALLBACK='en'# Optional, default =  'en'LOCALES=['es']# MandatoryLOCALES_PATH=os.path.join(BASE_DIR,'locales')# Optional, default path './locales' folderINSTALLED_APPS=[...'django_i18n',...]After that, you need create a locales folder (Setted in LOCALES_PATH variable in your settings.py), inside your folder you need some yml files withEXACTnames as you setted in LOCALES variable, next you can see an exampleen:my:title:"Anincredibletitle"content:"Hello%{name}"Usage in python filesfromdjango_i18n.toolsimporttranslate,set_locale,handle_orm_errorstranslate("my.title")# ORtranslate('my.content',name='World')# Set localeset_locale(locale="en",fallback="es")# Fallback is optional, default value is 'en'# Handle ORM errorsform=MyForm(data)handle_orm_errors(list_errors=form.errors,as_json=False)# List errors is a Django forms errors#as_json return dict as json stringUsage in template{% load t from django_i18n %}

<html>
  <head>
    <title>{% t 'my.title' %}</title>
  </head>
  <body>
    <h1>{% t 'my.content' name='World' %}</h1>
  </body>
</head>Fallback responseIf you have setted a fallback, each translation may be returntranslate('my.locale')#> Fallback: An incredible titleIf that key doesn't exists in your locale and your fallback, this is the responsetranslate('my.locale2')#> Translation missin my.locale2To DoForms complete support handlerDefault messages for Django formsOther supported formatsContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: django-i18next
django-i18next- Additions to Django’s i18n module.PrerequisitesDjango 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10Python >= 2.6.8, >= 2.7, >= 3.4RoadmapSee theTODOSfor the full list of planned-, pending- in-development- or to-be-implemented
features.InstallationInstall latest stable version from PyPI:pipinstalldjango-i18nextOr latest stable version from GitHub:pipinstall-egit+https://github.com/barseghyanartur/django-i18next@stable#egg=django-i18nextOr latest stable version from BitBucket:pipinstall-ehg+https://bitbucket.org/barseghyanartur/django-i18next@stable#egg=django-i18nextAddi18nexttoINSTALLED_APPSof the your projects’ Django settings.INSTALLED_APPS=(# ...'i18next',# Other project specific apps'foo',# Test app# ...)UsageOverride localeNo matter what your current locale is, you can override it for a certain part
of your template using theoverridelocaletemplate tag.Load the templatetags.{% load i18n i18next %}The following code forces Dutch locale for whatever is put inside theoverridelocaleblock.{% overridelocale 'nl' %}<p><ahref="/login/">{% trans "Log in" %}</a></p>{% endoverridelocale %}The following code forces Russian locale for whatever is put inside theoverridelocaleblock.{% overridelocale 'ru' %}<p><ahref="/login/">{% trans "Log in" %}</a></p>{% endoverridelocale %}The following code forces English locale for whatever is put inside theoverridelocaleblock.{% overridelocale 'en' %}<p><ahref="/login/">{% trans "Log in" %}</a></p>{% endoverridelocale %}Disable translationsNo matter what your current locale is, you can disable translations for a
certain part of your template using thedisabletranslationstemplate tag.{% load i18n i18next %}

{% disabletranslations %}<p><ahref="/login/">{% trans "Log in" %}</a></p>{% enddisabletranslations %}DemoLive demoSee thelive demo appon Heroku.Run demo locallyIn order to be able to quickly evaluate thedjango-i18next, a demo app (with
a quick installer) has been created (works on Ubuntu/Debian, may work on other
Linux systems as well, although not guaranteed). Follow the instructions below
for having the demo running within a minute.Grab the latestdjango_i18next_example_app_installer.sh:wgethttps://raw.github.com/barseghyanartur/django-i18next/stable/examples/django_i18next_example_app_installer.shAssign execute rights to the installer and run thedjango_i18next_example_app_installer.sh:chmod+xdjango_i18next_example_app_installer.sh./django_i18next_example_app_installer.shOpen your browser and test the app.URL:http://127.0.0.1:8001/nl/If quick installer doesn’t work for you, see the manual steps on running theexample project.DebuggingBy default debugging is turned off. Set theI18NEXT_DEBUGto True
in thesettings.pyof your project in order to do so.LicenseGPL 2.0/LGPL 2.1SupportFor any issues contact me at the e-mail given in theAuthorsection.AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: django-i18nfield
This is yet another way to store multi-lingual content inDjango. In contrast to other options
likedjango-hvad,django-modeltranslationordjango-parlerit does not require additonal
database tables and you can reconfigure the available languages without any changes to the database
schema. In constrast tonece, it is not specific to PostgreSQL.How does it work then? It stores JSON data into aTextField. Yes, this is kinda dirty and violates
the1NF. This makes it harder for non-django based programs to interact directly with your database
and is not perfectly efficient in terms of storage space.
It also lacks the ability to do useful lookups, searches and indices on internationalized fields.
If one of those things are important to you,this project is not for you, please choose one of the
ones that we linked above.However if those limitations are fine for you, this provides you with a very lightweight, easy to use and
flexible solution. This approach has been in use inpretixfor quite a while, so it has been tested in
production. The package contains not only the model fields, but also form fields and everything you need
to get them running.FeaturesVery easy installationInternationalized versions ofCharFieldandTextFieldtypesIntegrated form fields types and widgetsAutomatic migration from non-localized fields with a simple migrationFull support for forms and formsetsPossibility to dynamically limit the displayed languagesVery basic integration with django adminIntegration with Django RestframeworkComprehensive test suite and production-testedTested with:Python 3.6 to 3.10Django 3.2 to 4.0LicenseThe code in this repository is published under the terms of the Apache License.
See the LICENSE file for the complete license text.This project is maintained by Raphael Michel <mail@raphaelmichel.de>. See the
AUTHORS file for a list of all the awesome folks who contributed to this project.
Package: django_i18nize
# django_i18nizeDjango i18nize extends the i18nize python client. This package contains template tag for rendering translation and management command for fetching translations.## Links* *Website:* http://www.i18nize.com* *Python client*: https://github.com/iktw/i18nize* *JavaScript client*: https://github.com/iktw/i18nize-javascript## Installation```pip install django_i18nize```## Example configuration (settings.py)```pythonDJANGO_I18NIZE_CONFIG = {"project_id": "852c3729-6098-410e-ad9e-9783958bbc2d","live": False,'destination_dir': os.path.realpath(os.path.join(REPO_DIR, 'staticfiles', 'locale'))}```### Example 1: Template tag with simple translations (Uses the django language)```html<p>{% i18n_switch "hello" %}</p>```### Example 2: Template tag example with custom language:```html<p>{% i18n_switch "hello" "sv" %}</p>```### Example 3: Template tag example with values#### Passed view context:```pythoncontext = {'values': {'name': 'John Doe'}}```#### Your translation at www.i18nize.com:`"Hello {{name}}!"`#### Inside your django template:```html<p>{% i18n_switch "greet_person" "en" values %}</p>```### Example 4: Usage within your python code```pythonfrom django_i18nize.utils import get_translation as _# Simple translation (Uses the django language)text = _('hello')# Translation with custom languagetext = _('hello', language='sv')# Translation with custom values, remember that your key should be injected within your translation.# For example, your translated key at www.i18nize.com should be "Hello {{name}}!"text = _('greeting', values={"name": "John Doe"})```
Package: django-i18n-sitemap
Addi18nsitemapto yourINSTALLED_APPSIn your Sitemap class who supports i18n inherit from i18nsitemap.I18nSitemap instead from django.Seti18n = TrueThat’s it. And there is no problem on usingI18nSitemapon any Sitemap class, no needs to add or remove anything.Here it follows an exampleclass BlogSitemap(I18nSitemap):
    changefreq = "never"
    priority = 0.5
    i18n = True

    def items(self):
        return Entry.objects.filter(is_draft=False)

    def lastmod(self, obj):
        return obj.pub_date
Package: django-i18nurl
Django i18n url lets you manage your multilingual url using Django.
You can change the language and stay on the same page.Authors: Rémy Hubscher andcontributorsLicence: BSDCompatibility: Django 1.5+, python2.7 up to python3.3Project URL:https://github.com/novagile/django-i18nurlGetting StartedInstall django-i18nurl:pip install django-i18nurlAdd it to yourINSTALLED_APPSsettings:INSTALLED_APPS = (
    '...',
    'i18nurl',
)Using itPythonUse it in Python code:from i18nurl import reverse_i18n

url_de = reverse_i18n('app:home', 'de')Django templateUse it as a templatetag:{% load i18nurl %}
{% i18nurl 'app:home' 'de' %}Get the current page in other languages:{% load i18nurl %}
{% current_i18nurl 'de' %}Note: to usecurrent_i18nurltemplate tag you will need the request context processors:TEMPLATE_CONTEXT_PROCESSORS = (
    "...",
    "django.core.context_processors.request",
    "...",
)