Saravanan666/pypi-org huggingface dataset:
Package: django-formsets-bootstrap3
============================+Inline forms with bootstrap3============================+Form-inline-bootstrap a simple Django app to create form with forsets.Use with crispy-forms.Quick start-----------1. Add 'django_form_inline__bootstrap3' to your INSTALLED_APPS setting like this:settings.pyINSTALLED_APPS = (...'crispy_forms','easy_formsets_bootstrap')2.  EXAMPLEmodels.py:class Company(models.Model):name = models.CharField(max_length=250)class Employe(models.Model):name = models.CharField(max_length=250)company = models.ForeignKey(Company, related_name='employes')```forms.pyclass FormMixin(object):def __init__(self, *args, **kwargs):super(FormMixin, self).__init__(*args, **kwargs)self.helper = FormHelper()self.helper.form_tag = Falseclass CompanyForm(FormMixin, forms.ModelForm):class Meta:model = Companyclass EmployeForm(FormMixin, forms.ModelForm):class Meta:model = EmployeEmplyeFormSet = inlineformset_factory(Company, Employe, form=EmployeForm, extra=1)views.pyclass CompanyFormMixin(object):model = Companyformsets_class = [EmployeFormSet]form_class = CompanyFormclass CompanyCreate(CompanyFormMixin, FormsetMixin, CreateView):passclass CompanyUpdate(CompanyFormMixin, FormsetMixin, UpdateView):is_update_view = Truecompany_form.html/* here need jquery <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> /*{% load form_inlines %}{% load crispy_forms_tags %}<form action="" method="post" enctype="multipart/form-data">{{ form.errors|as_crispy_errors }}{% main_form form formsets %}{% render_formsets formsets %}<div class="form-actions col-md-24"><button type="submit" class="btn btn-primary">Save</button></div></form>{% empty_formsets formsets %}3. profit
Package: django-forms-ext
These are extensions for Django’s forms.Currently this contains the following:FieldsForeignKeyChoiceFieldWhen you have a formset that has a foreign key, Django will
fire off a new (identical) query to build the choices for
that field for each form in the formset by default. Using this
field will allow you to run the query once for the choices and
re-use that queryset for each form in the formset.CommaSeparatedFieldDjango has a comma separated integer field, but not just strings.
Stupid, I know… we created one for use with stringsQuerysetChoiceFieldWhen you want to build a select box with a queryset but don’t want
a model instance when saving, use this thing.ViewsFormSetViewDjango 1.3’s generic views do not include a FormSet view. That’s
what this is.
Package: django-forms-fieldset
django-forms-fieldsetDjango form fieldset inspire django admin fieldsetInstallationpipinstalldjango-forms-fieldsetUsagesettingsAddforms_fieldsetto your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'forms_fieldset',]load template{% load forms_fieldset static %}<linkrel="stylesheet"type="text/css"href="{% static 'forms_fieldset/css/main.css' %}"><form>{{ form|fieldset:'#42945c' }}</form>Note: The fieldset filter receives the color of the titles of the form groups, by default this color is used: # 79AEC8)Complete Guidemodelsfromdjango.dbimportmodels# Create your models here.classStudent(models.Model):first_name=models.CharField(max_length=200,verbose_name="First Name")last_name=models.CharField(max_length=200,verbose_name="Last Name")email=models.EmailField(unique=True,verbose_name="Email")adress=models.CharField(max_length=200,verbose_name="Adress")mother_name=models.CharField(max_length=200,verbose_name="Mother Name")father_name=models.CharField(max_length=200,verbose_name="Father Name")classNote(models.Model):SUBJECTS=(('Math','Math'),('French','French'),('Physical','Physical'),)student=models.ForeignKey('Student',on_delete=models.CASCADE,related_name="notes")subject=models.CharField(max_length=200,choices=SUBJECTS,verbose_name="Subject")value=models.IntegerField(verbose_name="Notation")classMeta:verbose_name="Les notes"verbose_name_plural="Les notes"formsfromdjango.formsimportModelFormfrom.modelsimportStudentclassStudentForm(ModelForm):fieldsets=[("Student Information",{'fields':[('first_name','last_name'),('email','adress'),]}),("Parent Information",{'fields':['mother_name','father_name',]}),]classMeta:model=Studentfields='__all__'viewsfromdjango.shortcutsimportrenderfromdjango.formsimportinlineformset_factoryfrom.formsimportStudentFormfrom.modelsimportStudent,Note# Create your views here.defhome(request):form=StudentForm()InlineForm=inlineformset_factory(Student,Note,fields=('subject','value',),exclude=('pk',),can_delete=False,)ifrequest.method=='POST':form=Form(request.POST,request.FILES)formset=InlineForm(request.POST,request.FILES)#save...context={'form':form,'inline_form':InlineForm()}returnrender(request,'home.html',context)template{% load forms_fieldset static %}
<!DOCTYPE html>
<html>
<head>
	<title>Home page</title>
	<link rel="stylesheet" type="text/css" href="{% static 'forms_fieldset/css/main.css' %}">
</head>
<body style="width: 75%; margin: 50px auto">
	<h1>Student form information</h1>

	<form>
		{{ form|fieldset:'#42945c' }}
		{{ form_inline|inline_fieldset:"#42945c,Note des eleves" }}
	</form>
</body>
</html>enjoyFeaturesFieldset django formFieldset (tabular style) inline formCreditHarouna Diallo
Package: django_forms_plus
django_forms_plus (DFP)The extendable ReactJS-powered rendering layer for Django Forms.The state of the projectThis package is in ALPHA state. DON'T USE ON PRODUCTION (or do it on your own risk).
The architecture and approaches can get changed significantly in next versions.Also, there aren't so many supported fields and widgets for now
since it's just a proof of concept mostly.DocsWill be available in next versions.DependenciesJavascriptreact, react-domreact-hook-form -siteyup -npmclassnamesPythonpydanticLicenseMIT
Package: django-forms-smoq
=====FORMS-SMOQ=====Forms-SmoQ django is a simple application that contains useful formsfor use in django.Detailed documentation is in the "docs" directory.Quick start-----------1. Install pip install django-forms-smoq2. Add "forms-smoq" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'forms-smoq',)3. Import the form where you want.Configuration-----------GENERIC_DEFAULT_MODEL = If we have a generic model of a foreign key isa model by default, the form will create a selection list.We write "app_label.Model"GENERIC_%s_MODEL % YOUR_MODEL = If you are using forms in several differentmodels, we can insert the exact form in which the model is to use what model.Instead YOUR_MODEL enter the model name of which it is applicable.We write "app_label.Model"
Package: django-form-tags
Django templatetags to easily render fieldholders, fieldwrappers and fields.Installationpipinstalldjango-form-tagsUsageINSTALLED_APPS=(# ...'form_tags',# ...){% load forms %}Developmentisortdocker-composerun--rm--no-depspythonisort[module/path][options]flake8docker-composerun--rm--no-depspythonflake8[module/path]blackdocker-composerun--rm--no-depspythonblack[module/path]pytestdocker-composerun--rm--no-depspythoncoveragerun./runtests.pyTranslationsUpdating translationsdocker-composerun--rm--no-depsmanagemakemessages-lnl--no-wrap--no-location--no-obsoletedocker-composerun--rm--no-depsmanagecompilemessages
Package: django-formtools
Django’s “formtools” is a set of high-level abstractions for Django forms.
Currently for form previews and multi-step forms.This code used to live in Django proper – indjango.contrib.formtools– but was separated into a standalone package in Django 1.8 to keep the
framework’s core clean.For a full list of available formtools, seehttps://django-formtools.readthedocs.io/django-formtools can also be found on and installed from the Python
Package Index:https://pypi.python.org/pypi/django-formtoolsTo get more help:Join the #django channel on irc.libera.chat. Lots of helpful people hang out
there.Join the django-users mailing list, or read the archives, athttps://groups.google.com/group/django-users.Contributing to django-formtoolsSeeCONTRIBUTING.rstfor information about contributing patches todjango-formtools.Running tests is as simple asinstalling Toxand running it in the root
Git clone directory:$ git clone https://github.com/jazzband/django-formtools
[..]
$ cd django-formtools
$ tox
[..]
  congratulations :)The previous command will run the tests in different combinations of Python
(if available) and Django versions. To see the full list of combinations use
the-loption:$ tox -l
...
py310-djangoAB
py310-djangomainYou can run each environment with the-eoption:$ tox -e py310-djangoAB  # runs the tests only on Python 3.10 and Django A.B.x
Package: django-form-utils-bootstrap3
Render forms with fieldsets using Bootstrap markup via django-form-utils and django-bootstrap3ConfigurationModify your Django project settings to include:BOOTSTRAP3 = {
    'form_renderers': {
        'default': 'form_utils_bootstrap3.renderers.BetterFormRenderer'
    }
}You can continue using the same{% bootstrap_form form %}tags, but they now take into account the existence of fieldsets inBetterForminstances.Installationpip install django-form-utils-bootstrap3RequirementsA Django project using:django-form-utilsdjango-bootstrap3LicenceMITAuthorsdjango-form-utils-bootstrap3was written byFederico Bond.
Package: django-formwizard
WarningThe 1.0+ releases are incompatible with all previous releases (<=0.6) of
django-formwizard!If you want to use the old version, please install django-formwizard==0.6
(version 0.6 is the last version with the old api)django-formwizard is a reusable app to work with multi-page forms. Besides
normalForms, it  supportsFormSets,ModelFormsandModelFormSets.NoteThis app was originally developed as an external library for Django but
the code made it to Django itself. Beginning with release 1.4 of Django,
the form-wizard will be available in Django directly
(django.contrib.formtools.wizard).This code is a backport of thedjango.contrib.formtools.wizardcode!Until the 1.4 release, django-formwizard will be maintained to let
Django 1.3 users work with the new form-wizard.To install django-formwizard, simply run# pip install django-formwizardThe source is available onGitHub.If you are interested in contributing, just fork the repository on GitHub and
commit your changes. Don’t forget to send a pull request.
Package: django-formwizard-deprecated
This package contains the originaldjango.contrib.formtools.legacy.FormWizardfrom Django 1.5.12.It’s intended as backward-compatible quick fix for your project if you’re upgrading to
Django 1.6, which deprecates the old implementation.InstallationThis package is also available on PyPI.$ pip install django-formwizard-deprecatedUsageReplace your imports. Old:from django.contrib.formtools import FormWizardNew:from formwizard_deprecated import FormWizardSupportThis package will updated only when (and if)django.contrib.formtools.legacy.FormWizardwill ever change in the Django 1.5.x series.
It is only for backward-compatibility purposes and there will be no support nor bugfixes.
Package: django-fortune
django-fortuneA Django template-tag that provides a fortune.The Template Tag{% load fortune_tags %}
{% fortune %}The Management Commands$pythonmanage.pyfortune# Get a fortune.Fortuneswillimproveafterloadingsome.# Oops, no fortunes loaded.$pythonmanage.pyfortune_list_packs# List available fortune packs.--Installed:----Available:--artascii-artcomputerscookiedefinitions..$pythonmanage.pyfortune_load_packart# Load art fortunes.$pythonmanage.pyfortune# Get an art fortune."My life is a soap opera, but who has the rights?"--Madame$pythonmanage.pyfortune_unload_packart# Unload art fortunes.$pythonmanage.pyfortune# No fortunes available again. :-(Fortuneswillimproveafterloadingsome.$The Python Interface$pythonmanage.pyshell..>>>fromfortune.modelsimportFortune,Pack>>>Fortune.fortune()'Fortunes will improve after loading some.'>>>fromfortuneimportutils>>>fortunes_path=utils.get_fortunes_path()>>>art_fortunes_path=fortunes.path.joinpath("art")>>>Pack.load(str(art_fortunes_path))>>>Fortune.fortune()u"\nThey can't stop us... we're on a mission from God!\n\t\t-- The Blues Brother">>>art_fortunes=Pack.objects.get(name="art".title())>>>art_fortunes.unload()>>>Fortune.fortune()'Fortunes will improve after loading some.'>>>InstallationInstall using pip;$pipinstalldjango-fortunethen add “fortune” to INSTALLED_APPS in your app’s settings.py.
Package: django-fortunecookie
Django-FortuneCookieThe Django-FortuneCookie library provides a reusable Django application with
model definitions to store everything about fortune cookies. It includes a test
fixture to provide sample data for testing third-party apps.It is tested against:Django 1.8 (Python 2.7, 3.3, 3.4 and 3.5)Django 1.9 (Python 2.7, 3.4 and 3.5)Django 1.10 (Python 2.7, 3.4 and 3.5)Django 1.11 (Python 2.7, 3.4, 3.5 and 3.6)Django master/2.0 (Python 3.5 and 3.6)
Package: django-forumbr
A simple, everyday django forumDjango-forumbr is a project to create a simple, easy-to-use and complete forum
for django projects on the run.Releasesdjango-forumbr 0.4 (23/04/2014): Compatible with Django 1.6django-forumbr 0.3.1.3 (15/12/2012): Compatible with Django 1.3/1.4Install instructionspip install django-forumbr# then add forum to your settings INSTALLED_APPS
# and url(r’^forum/’, include(‘forum.urls’, namespace=’forum’)) to your urls.py# create the models and you’re done
python manage.py syncdbOptionalForumBR uses a set of libraries to provide text formatting support.
The default formatting syntax for replies is plain text.
To turn on the support, install the disired library:pip install bbcode
pip install markdown
pip install textile
pip install docutils
pip install html5lib # for plain html supportand then, set the FORUM_MARKUP language of your choice.App SettingsForumBR comes with a large set of configurable settings. For a complete list of options,
take a look atdjango-forumbr/app_settings.AuthSeedjango-forum/test_projectfor an example on how
to integrate with django-registration.
Package: django-forums
# django-forums[![Build Status](https://travis-ci.org/byteweaver/django-forums.svg?branch=master)](https://travis-ci.org/byteweaver/django-forums)Small standalone django forums application.## Key features* Reusable forums app* Templates use Bootstrap (twitter) styles* ...## InstallationIf you want to install the latest stable release from PyPi:$ pip install django-forumsIf you want to install the latest development version from GitHub:$ pip install -e git://github.com/byteweaver/django-forums#egg=django-forumsAdd `forums` to your `INSTALLED_APPS`:INSTALLED_APPS = (...'forums',...)Hook this app into your ``urls.py``:urlpatterns = patterns('',...url(r'^forums/', include('forums.urls', namespace='forums')),...)## VersionsWith the latest update, starting from version 0.1.x, django-forums supports django 1.5 and beyond. The default templates are now based on bootstrap-3.If you use an older version of django or bootstrap, please have a look at version 0.9.0, but remember it is no longer maintained. The template syntax changed between django 1.4 and 1.5 (namespace of url tags are required to be quoted) so using a django version prior to 1.5 leads to template syntax errors.## TestsTo run the tests you need the test runner `tox`:$ pip install toxThen just call him:$ tox## Tips and tricksTo improve the bootstrap form integration check out tzangms/django-bootstrap-form and override the forms.html template or have a look at issue #8 how to path the source code.To override the template file make sure you add the application containing the new template first.
Package: django_fotorama
=====Fotorama slider=====Фоторама слайдер - это простое приложение для Django,для интеграции js-css галереи FotoramaQuick start-----------1. Добавьте fotorama в файл settings.py в кортеж INSTALLED_APPS::INSTALLED_APPS = (...'fotorama',)2. В переменную FOTORAMA_CROP_SIZE - размер кропа для изображений::FOTORAMA_CROP_SIZE = '600x300'3. Запустите `python manage.py syncdb` для создании таблицы в базе данных.Using-----1. Подгрузить CSS и JS файлы фоторамы с помощью шаблонных тегов из библиотеки fotorama, для работы необходим jquery::{% load fotorama %}<head>...{% fotorama_css %}{% fotorama_js %}</head>2. В админской панели добавьте фотографии в слайдер3. Вывести с помощью шаблонного тега fotorama_slider::{% fotorama_slider %}4. Для изменения стандартного шаблона фоторамы - измените /templates/fotorama/default.html
Package: django-foundation-formtags
Django Foundation FormtagsDjango template tags to work with Zurb Foundation formsGetting StartedCreate a virtualenv:$ virtualenv my-envAt the command line:$ pip install django-foundation-formtagsUsageTo start use django-foundation-forms in a project you must include in your settings:INSTALLED_APPS = (
    'foundation_formtags',
)In the template load foundation tags by:{% load foundation_formtags %}To use the django-form-foundation filter:<form class="form" action="{{ url }}" method="POST">
    {% csrf_token %}
    {{ form|as_foundation }}
</form>To use the django-form-foundation field tags:<form class="form" action="{{ url }}" method="POST">
    {% csrf_token %}
    {% render_field form.name %}

    {% render_field form.subject %}

    {% render_field form.message %}
</form>Required versus optional fieldsThe normal behaviour is to mark required fields with*. If you want to mark only optional fields, you can add the following setting to your project settings file.FOUNDATION_FORMTAGS_USE_OPTIONAL = TrueTo learn more about optional fields read thisblog.ContributingContributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.Free software: BSD licenseDocumentation:https://django-foundation-formtags.readthedocs.org.History0.1.0 (2017-06-05)Provide users option to use * or optional0.0.9 (2017-06-05)Cleaned up travis configuration for tox to improve testing0.0.8 (2017-05-09)Make it Compatible with Django 1.110.0.7 (2016-09-25)Make Compatible with Django 1.10Minimum version is now Django 1.8. For earlier versions of Django use 0.0.60.0.6 (2016-08-05)Fix for checkbox rendering and New error class for Non field errors in Foundation 60.0.5 (2016-07-12)First release on PyPI.
Package: django-fractions
Fraction display and form fields for DjangoDocumentationThe full documentation is athttps://django-fractions.readthedocs.org.QuickstartInstall django-fractions:pip install django-fractionsAdddjfractionstosettings.INSTALLED_APPSThen use it in a project:import djfractionsIn templates:{% load fractions %}
{% display_fraction 1.25 %}In Forms:from djfractions.forms import DecimalFractionField
from django import forms

class MyForm(forms.Form):
    a_fraction = DecimalFractionField()FeaturesTemplate tag for displaying float and Decimal values as fractions including mixed numbersDecimalFractionField form field which handles input such as “1/4”, “1 1/2”, “1 and 1/2”, and converts to a
decimal.Decimal instanceTODOAdd unicode_fraction template tag to display the unicode fraction entity if availableforms.FloatDecimalField to return a float rather than Decimalforms.SplitFractionWidget for having separate numerator and denominator form fieldsforms.SplitMixedFractionWidget for handling mixed number fractions with separate fieldsmodels.DecimalBackedFractionField() to store a Decimal value but return/accept it as a fractionmodels.FloatBackedFractionField() to store a Decimal value but return/accept it as a fractionCookiecutter Tools Used in Making This Packagecookiecuttercookiecutter-djangopackage
Package: django-fragment-cache
Django Fragment CacheDjango provides template fragment caching, such as :{% load cache %}
{% cache 500 sidebar %}
    .. sidebar ..
{% endcache %}But the variablesidebarstill to be passed to the template every time, otherwise the fragment is blank when the cache expires.If the data acquisition process is time consuming, then the fragment cache is to exist in name only.So, this module provides another way to use the template cache.How to use?Installpip install django-fragment-cacheInstall Requires:django >= 2edit your settings.py to addfragment_cacheto yourNSTALLED_APPS.INSTALLED_APPS = (
    ...
    'fragment_cache',
    ...
)Useyou need provide a callable object to tell module how to get data, and the function return a dict.only call function when cache expires.import time
def get_data(num=10):
    time.sleep(3)
    return {'nums': list(range(num))}

def test(request):
    return render(request, 'test.html', {'get_data': get_data})The{% fragment_cache %}template tag is similar to{% cache %}, for example:{% load fragment_cache %}
{% fragment_cache 500 get_data %}
    <ul>
        {% for i in nums %}
            <li> {{ i }}</li>
        {% endfor %}
    </ul>
{% endfragment_cache %}Sometimes, you might want to cache multiple copies of a fragment depending on some dynamic data that appears inside the fragment.This allows different parameters to be cached to cache different results, for example:{% load fragment_cache %}
{% fragment_cache 500 get_data 6 %}
    <ul>
        {% for i in nums %}
            <li> {{ i }}</li>
        {% endfor %}
    </ul>
{% endfragment_cache %}Enjoy yourself.
Package: django-fragments
django-fragmentsPurposeUsed for partial template rendering of:<input>,<svg>tags. Originally for a Djangoboilerplate, refactored out into an independent library.SetupAfter installation, e.g.pip install django-fragmentsINSTALLED_APPS=["django_fragments",# add this]...FRAGMENTS={"icons_prefix":"heroicons",# prefix to use for icons"icons_path":BASE_DIR/"templates"/"xxx"# type: Path, location where svg icons will be stored}Seedocumentation.
Package: django-francedata
Django-FrancedataProvides a database structure, API and import scripts to manage French communes, intercommunalités, départements and régions, with their structure and data from Insee and the DGCL.This app was created as a part ofOpen Collectivités.Unaccent extensionIf the PostgreSQL user specified in the Django settings is not a superuser, connect to the postgres user and create the Unaccent extension manually:psql
\c <dbname>
"CREATE EXTENSION  IF NOT EXISTS unaccent;"QuickstartAdd “francedata” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    "django_json_widget",
    "simple_history",
    "francedata",
]Runpython manage.py migrateto create the francedata models.Run the two initialization commands to get the communes, EPCIs, départements and régions structure:python manage.py cog_import
python manage.py banatic_importVisithttp://127.0.0.1:8000/admin/to see the data.Commandscog_import:goal: load the following data from the Code officiel géographique (COG): list of regions, departements and communes, with how they are linked and:
* insee and siren ids for the regions/departements
* insee for the communesparameters:
* –level: partial import of only the specified level (the script expects the higher ones to already be installed) Allowed values:regions,departements,communes* –years: import the specified year (min: 2019), by default it imports the latest available one inhttps://www.data.gouv.fr/fr/datasets/code-officiel-geographique-cog/banatic_import:goal: load the following data from the Banatic:
* siren ids and population data for the communes
* insee for the communesThe script expects thatcog_importwas already run and that the communes level is passed before the epci level.parameters:
* –level: partial import of only the specified level. Allowed values:communes,epci* –years: import the specified year (min: 2019 for the communes level (data is taken from the fileTable de correspondance code SIREN / Code Insee des communesfromhttps://www.banatic.interieur.gouv.fr/V5/fichiers-en-telechargement/fichiers-telech.php), by default it imports the latest available one)warning: The epci level only works for the current year (data is taken fromhttps://www.data.gouv.fr/fr/datasets/base-nationale-sur-les-intercommunalites/)