Saravanan666/pypi-org huggingface dataset:
Package: django-template-admin
Django application for advanced template managementAllows staff member (with corresponding permissions) to:list all templates used in the project and examine their contentchange the content of any templatecreate new templatessee the differencesbetween the default content (from filesystem or other loader) and the changed contentsee if the original content has changedsince the last changeInstallationInstalldjango-template-admineither from source or using pip.ConfigurationAdd'template_admin'tosettings.INSTALLED_APPS.Configure template loaders:TEMPLATES[0]['OPTIONS']['loaders'] = [
    ('template_admin.loader.Loader', [
        ('django.template.loaders.cached.Loader', [
            'django.template.loaders.filesystem.Loader',
            'django.template.loaders.app_directories.Loader',
        ]),
    ]),
]
Package: django-template-admin-urls
django-template-admin-urlsMicro-package that provides a helping utility for manual tesing. Like for example template block with links for editing current page instance in admin.Installation$ pip install django-template-admin-urlsAdddj_template_admin_urlstoINSTALLED_APPSTemplate blocksadmin_links.jinja- provides header block with links such as:admin dashboard urladmin's url of object pageTemplate tagsobject_admin_url- returns object's url in adminadmin_url- admin dashboard url
Package: django-template-analyzer
django-template-analyzerThetemplate_analyzerpackage offers an API to analyze the Django template structure.
It can be used to find nodes of a particular type, e.g. to do automatic detection of placeholder tags.Supported featuresThe scanner finds tags in various situations, including:Extend nodesInclude nodesOverwritten blocks with new definitionsBlocks with or without{{ block.super }}Reorganized blocksIgnoring nodes outside blocks in extending templatesHandling multiple levels of super includesThe returned nodes are provided in a natural ordering,
as they would be expected to appear in the outputted page.While Django offers atemplate.nodelist.get_nodes_of_type()function,
this function does not produce the same results.API examplefromdjango.template.loaderimportget_templatefrommycms.templatetags.placeholdertagsimportPlaceholderfromtemplate_analyzer.djangoanalyzerimportget_node_instances# Load a Django templatetemplate=get_template("mycms/default-page.html")# Find all tags in the template:placeholders=get_node_instances(template,Placeholder)# Read information from the template tag themselves:# (this is an example, accessing a custom method on the Placeholder object)placeholder_names=[p.get_name()forpinplaceholders]InstallationFirst install the module, preferably in a virtual environment. It can be installed from PyPI:pip install django-template-analyzerOr the current folder can be installed:pip install .CreditsThis package is based on the work ofDjango CMS.Many thanks to the contributors ofcms/utils/placeholder.py/cms/utils/plugins.pyin Django CMS!
Package: django-template-backend
Django Template BackendA template for Django apps with support for Django REST Framework, filters, Celery tasks, Beat schedules tasks, pytest,
and other things.SetupInstall the project dependencies$ pipenv install --devRefactor "template" names throughout project to desired nameCreate modelsMake migrations and migrate the database$ pipenv run python manage.py makemigrations
$ pipenv run python manage.py migrateStart the Django server$ pipenv run python manage.py runserverOptionally start the Celery related processes$ redis-server
$ pipenv run celery -A template_project worker -l info
$ pipenv run celery -A template_project beat -l info --scheduler django_celery_beat.schedulers:DatabaseSchedulerTestsTests are setup to run through Pytest. They can be invoked with:$ pipenv run python manage.py testor$ pipenv run python -m pytest
Package: django_template_breakpoint
django-template-breakpointDrop into a Python debugger from inside your Django templates.Inspired bydjango-template-debug.InstallationInstall with pip:python -m pip install django-template-breakpointUsageAdd the app to yourINSTALLED_APPSsetting:INSTALLED_APPS = [
    ...,
    "django_template_breakpoint",
    ...,
]In a template, load the tag:{% load breakpoint %}Then set the breakpoint:{% breakpoint %}When this line is rendered by Django,sys.breakpointhook()will be called.
By default, this callspdb.set_trace().All template variables in use are added to the current scope.
If usingpdb.set_trace(),
you can rundir()to see the names of all template variables.DevelopmentThere's a test!  Run it withpython -m pytest.
Package: django-template-check
django-template-checkThis package makes it possible to easily check for basic syntax errors in all loaded Django templates. This can be useful as part of a continuous integration step in a build process, so as not to discover these problems at runtime.Currently, checking is very minimal, simply relying on the exceptions raised by Django’s compile and render template pipeline. Furthermore, only the default Django template backend is tested and supported.RequirementsThis package requires Django version 1.8 or greater, and has been tested with 2.2 and 3.0InstallationSimply get the package frompip:pip install django-template-checkThen make sure to adddjango_template_checkto yourINSTALLED_APPSin yoursettings.py.
It also requires theBASE_DIRsetting to exist in yoursettings.py, which should be present if you used the Djangostartprojecttemplate.UsageAfter installing this package, simply use it by calling the management command:python manage.py templatecheckOptionally, only check templates that live inside the project directory by specifying the--project-onlyflag. This can be useful to ignore errors in 3rd party dependencies.LicenseAll included code is available under the CC0 1.0 Universal Public Domain Dedication.django-template-check Changelog0.3.1 (2018-01-08)Fix Django 2.0 support (thanks to Thom Wiggers).0.3.0 (2016-08-25)Add –project-only option to ignore 3rd party code.0.2.1 (2016-08-11)Fix a typo in the install instructions.0.2.0 (2016-08-11)Return 1 when there are errors.0.1.1 (2016-08-11)Fix packaging to actually include code.0.1.0 (2016-08-11)Initial working prototype.
Package: django-template-cli
Installation$[sudo]pipinstalldjango-template-cliHow it worksindex.html
context.json (optional)Examplesindex.html:{% for v in values %}
{{ forloop.counter0 }}: {{ v }}
{% endfor %}context.json:{"values":["value1","value2","value3"]}$django-template-cliindex.html0:value11:value22:value3readme42.com
Package: django-template-dashboard
Django Template DashboardA dashboard based on Django template.InstallationInstall the package via pip:pipinstalldjango-template-dashboardConfigurationAfter installing the package, add it to yourINSTALLED_APPSin thesettings.pyfile of your Django project:INSTALLED_APPS=[# ... other apps,'dashboard',]Include the dashboard urls in your project'surls.pyfile:fromdjango.urlsimportinclude,pathurlpatterns=[# ... other urls,path('dashboard/',include('dashboard.urls')),]UsageNavigate to/dashboard/in your browser to access the dashboard.DevelopmentTo contribute or report issues, please visit
thedashboard.LicenseThis project is licensed under theMIT License.
Package: django-template-debug
A small collection of template tags for debugging and introspecting Django templatesDocumentationRequirementsNone, but the latest ipdb is highly recommended.Installationdjango-template-debug is available on pypi, so the easiest way to install it
is using pip:pip install django-template-debugSetupAdd ‘template_debug’ to the INSTALLED_APPS iterable in your settings file. For example:INSTALLED_APPS = (
    ...
    'template_debug',
    ...
)AddTEMPLATE_DEBUG = Trueto your local or development settings if it is not already set.Unless TEMPLATE_DEBUG is set to True, the django-template-debug templates will return an empty string without doing anything. This behavior prevents your application from calling set_trace() or print in a production environment if django-template-debug template tags are accidentally commited and deployed.UsageAdd {% load debug_tags %} in any Django template.The available tags to use are {% set_trace %} {% variables %} {% attributes varname %} and {% details varname %}SeeExample Usagedocs for more detailsDeveloper SetupCreate a fresh virtualenv and install the test requirements:mkvirtualenv template-debug
pip install -r requirements/test.txtUse manage.py in the project directory along with the example.settings file
for local testing.To run unittests using the virtualenv’s Python and Django, use theruntestsscript. To test all supported versions of Python and Django, run the unittests
using tox.
Package: django-templated-mail
A simple wrapper fordjango.core.mail.EmailMultiAlternativeswhich makes
use of Django template system to store email content in separate file.Developed bySUNSCRAPERSwith passion & patience.InstallationSimply install usingpip:$pipinstall-Udjango-templated-mailDocumentationDocumentation is available to study athttp://django-templated-mail.readthedocs.ioand indocsdirectory.Contributing and developmentTo start developing ondjango-templated-mail, clone the repository:$gitclonegit@github.com:sunscrapers/django-templated-mail.gitIf you are apipenvuser you can quickly setup testing environment by
using Make commands:$makeinit$maketest
Package: django-template-email
django-template-email provides a set of tools that allows you to easily build
plain-text or HTML emails using templates.UsageAfter installing django-templatee-email, addtemplate_emailto yourINSTALLED_APPSinsettings.py.TemplatesAn email template is like any other django template. To use the template as an
email, however, you must load the “email” templatetag library and use its tags
to define the different parts of the email.  The email templatetag library
gives you three different tags to use:subject,body, andbodyhtml, each with their respectiveendsubject,endbody, andendbodyhtml.For example{% load email %}
{% subject %}Thank you for signing up!{% endsubject %}
{% body %}
Hello, {{ first_name }}.

Thank you for signing up. To find out more information, please visit
http://www.example.com/foo/.

Sincerely,
The Team
{% endbody %}
{% bodyhtml %}
Hello, <em>{{ first_name }}</em>.

Thank you for signing up.  To find out more information, click
<a href="http://www.example.com/foo/">here</a>.
{% endbodyhtml %}Each tag is entirely optional. You can set any part of the email as you
normally would with Djanog’s EmailMessage class.Sending EmailThe TemplateEmail class is a subclass of
django.core.mail.EmailMultiAlternatives, which itself is a subclass of
django.core.mail.EmailMessage.To send your email template as an email, simply instantiate the TemplateEmail
class while passing it your template and (optionally) a context dict:from template_email import TemplateEmail

context = {'first_name': user.first_name}
email = TemplateEmail(template='email/confirmation_message.html', context)
email.send()TemplateEmail ClassOf course, you may also extend the TemplateEmail class to suit your needs.
The TemplateEmail class is initialized with optional keyword arguments
oftemplateandcontext.  However, template and context variables may be
overridden as a property as well.  The TemplateEmail class has the following
properties:template: The template used to render the emailcontext: The context provided to the templatesubject: The subject of the emailbody: The plan-text body of the emailhtml: The html to attach as an alternative typeThesubject,body, andhtmlproperties are intended as defaults,
and will be overridden by whatever is given in the template.When you call thesend()method, the TemplateEmail class first renders the
given template into the different parts of the email. The templatetags simply
dump their contents into temporary context variables for therender()method
use.  The render method then renders the contents of each tag separately into
the class’ssubject,body, andbodyhtmlproperties.As a convienience, thesend()method will automatically convert User model
instances to email recipients, formatting them as “first_name last_name
<email>”.
Package: django-template-field
A Django template field with a manager to return the rendered template.DocumentationThe full documentation is athttps://django-template-field.readthedocs.org.QuickstartInstall django-template-field:pip install django-template-fieldThen use it in a project:from django.db import models

from templatefield import fields, managers


class TemplatedText(models.Model):
    value = fields.TemplateTextField()

    # Manager that returns rendered templates. This will be the default
    # manager since it is first. Now, when accessed via `Related Models`_
    # this field will also be rendered.
    objects_rendered = managers.RenderTemplateManager()
    # Django's default manager returns unrendered templates.
    objects_unrendered = models.Manager()Extra context can be added insettingslike so:TEMPLATE_FIELD_CONTEXT = { ‘template_var’: value }Context can also be added to querysets like so:TemplatedText.objects_rendered.with_context({‘template_var2’: value2})If you dump fixtures withRenderTemplateManageras the default manager,
django will render the exported data. To work around that, create an alternate
settings file for your project with the following setting:TEMPLATE_FIELD_RENDER = FalseThen you can dump your unrendered data like so:./manage.py dumpdata myapp.mymodel –settings=myapp.dump_settingsRelated ModelsIf aTemplateTextFieldwill be accessed from another model through aForeignKeyrelationship, Django will use the default manager to render theTemplateTextField. For example, if we define this additional model:class RelatedToTemplatedText(models.Model):templated_text = models.ForeignKey(TemplatedText)We can expect to see fields accessed viatemplated_textrendered properly.AdminUsingRenderTemplateManageras the default has the unfortunate side effect
of rendering your fields in the Django admin, so we have provided a class from
which you can inherit to solve that problem. Ex:from templatefield import adminclass TemplatedTextAdmin(admin.UnrenderedAdmin):…Running Testssource <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements/test.txt
(myenv) $ python runtests.pyHistory0.3.1 (2016-01-11)Add setting to disable rendering0.3.0 (2016-01-06)Enable rendering in related field access0.2.0 (2015-10-23)Addwith_contexttoRenderTemplateManager0.1.0 (2015-10-02)First release on PyPI.
Package: django-template-finder
django-template-finder is a simple Django utility that allows you to find
templates with names matching given pattern.Suppose you are writing an app and want to allow your user to choose one of
predefined templates, but don’t want to hardcode their names in any way. Scan
for files? What if they are not store in the same directory? This is where
django-template-finder can help you!Supported template loaders:django.template.loaders.app_directories.Loaderdjango.template.loaders.filesystem.Loaderdjango.template.loaders.cached.LoaderContributions and comments are welcome using Github at:http://github.com/TyMaszWeb/django-template-finderInstallationpip install django-template-finderThat’s it! It’s just a simple utility library, no need to add anything toINSTALLED_APPS.You will need a recent version of Django. Chances are django-template-finder
will work with Django 1.2+, however only versions above 1.3 are supported.UsageSearch for all404.htmltemplates, recursively, in all template loaders:from templatefinder import find_all_templates

find_all_templates('404.html')Search for all4xx.htmltemplates, recursively, in all template loaders:from templatefinder import find_all_templates

find_all_templates('4*.html')Search for all templates undermenu/, recursively, in all template loaders:from templatefinder import find_all_templates

find_all_templates('menu/*')Generate nicer, human-friendly names for discovered templates in forms:from templatefinder import find_all_templates, template_choices
from django.forms.widgets import Select

class MyForm(Form):
    def __init__(self, *args, **kwargs):
        super(MyForm, self).__init__(*args, **kwargs)
        found_templates = find_all_templates('menu/*')
        choices = template_choices(templates=found_templates, display_names=None)
        self.fields['myfield'].widget = Select(choices=list(choices))Providing human-friendly names for discovered templates, overriding the built-in
name calculation:from templatefinder import find_all_templates, template_choices

found_templates = find_all_templates('menu/*')
choices = template_choices(templates=found_templates, display_names={
    'menu/menu.html': 'My super awesome menu',
})Using a project-wide setting for overriding the template display names:from django.conf import settings
# note: this should be in your Django project's settings module, and is
# only set here for illustration purposes.
settings.TEMPLATEFINDER_DISPLAY_NAMES = {
    'menu/menu.html': 'Super menu',
    'menu/another-menu.html': 'Another menu',
}

from templatefinder import find_all_templates, template_choices

found_templates = find_all_templates('menu/*')
choices = template_choices(found_templates)Bugs & ContributionPlease use Github to report bugs, feature requests and submit your code:http://github.com/TyMaszWeb/django-template-finderauthor:Piotr Kilczukdate:2013/03/27
Package: django_template_goodies
A set of simple tools that will make your life easier in django templates.
Based on greatdjango-classytagslibrary.InstallationInstall the package$> pip install django-template-goodiesput “template_goodies” into INSTALLED_APPS.Usage: render_with & def_block and use_blockThis is sort of macro-like solution allowing you to define base
template that looks always the same, and fill just a “block” inside it
differently.Assuming you have partial template person_wrapper.html:{% load goodies %}
<div class="person-wrapper">
    <div class="first-name">{{ first_name }}</div>
    {% use_block "block" %}
</div>You can use it in following way:{% load goodies %}
{% render_with "person_wrapper.html" first_name="First" last_name="Last" %}
    {% def_block "block" %}
    <div class="last-name">{{ last_name }}</div>
    {% end %}
{% end %}This invocation will substitude “{% use_block “block” %}” in
person_wrapper.html with the contents within “{% def_block …. %}”
and “{% end %}” insidee “render_with”. So the outcome of above will be
more or less:<div class="person-wrapper">
    <div class="first-name">First</div>
    <div class="last-name">Last</div>
</div>Another example with tables, table.html:{% load goodies %}
<table class="{{ opts.table_class }}">
    <thead>
        <tr>
            {% use_block "headers" %}
        </tr>
    </thead>
    <tbody>
        {% for row in object_list %}
        <tr>
            {% use_block "row" %}
        </tr>
        {% endfor %}
    </tbody>
</table>can be used in following way:{% render_with "table.html" object_list=people %}{% def_block "headers" %}
    <td>ID</td>
    <td>First name</td>
    <td>Last Name</td>
    <td>Age</td>
{% end %}{% def_block "row" %}
    <td>{{ forloop.counter }}</td>
    <td>{{ row.first_name }}</td>
    <td>{{ row.last_name }}</td>
    <td>{{ row.age }}</td>
{% end %}{% end %}Usage: dictUpdates or creates dictionary inside template. You can use all kinds
of filters on variable if you need:{% load goodies %}

{% dict opts name="first"|title %}
{% dict opts last_name="last" value=opts.name %}

{{ opts.first }} - {{ opts.last_name}} || {{ opts.value }}The outcome will be more or less following:First - last || firstRequirementsdjango-classytagsAuthorsJakub Janoszek (kuba.janoszek@gmail.com)
Package: django-template-helpers
django-template-helpersprovides template tags to add missing features to the
Django template language.FeaturesTemplate tag to set a new context variablesetTemplate filter to split a string into a listsplitContext processor to expose selected settings to the templatesGenericTemplateView for static pagesRequirementsdjango-template-helpers supports Python 3 only and requires at least Django 1.11.Prepare for developmentA Python 3.6 interpreter is required in addition to pipenv.$pipenvinstall--python3.6--dev$pipenvshell$pipinstall-e.Now you’re ready to run the tests:$pipenvrunpy.testResourcesDocumentationBug TrackerCode
Package: django-templateloaderwithpriorities
Django TemplateLoaderWithPrioritiesA django template loader that allows you to control the order which the template dirs (filesystem directories or apps’ template directories) are resolved in.Useful when you want to override third party apps templates.Installation and useGettemplateloaderwithprioritiesfrom pypy or github:$ pip install django-templateloaderwithprioritiesor:$ pip install -e git+git://github.com/qubird/django-templateloaderwithpriorities#egg=templateloaderwithprioritiesOnce installed, put the loader on top ofsettings.TEMPLATE_LOADERS:TEMPLATE_LOADERS = ('templateloaderwithpriorities.Loader', ) + TEMPLATE_LOADERSBe sure that it’s the first item ofTEMPLATE_LOADERS, else your priorities will be ignored.Then addTEMPLATE_LOADER_PRIORITIESto your settings.py:TEMPLATE_LOADER_PRIORITIES = [
    'my.app',
    '/path/to/my/custom/templates'
]The loader searches for templates in the given order, looking for thetemplatesdirectory if the item is an app, or the directory itself if the item is an absolute path.First come, first served.
Package: django-template-mail
==========Django-Template-Mail==========:Info: A Django application to send email using django's templating system:Author: Benoît Bar (http://github.com/benoitbar, http://twitter.com/benoitbar)Get started===========Installing----------::pip install django-template-mailConfigure your mail backend---------------------------django-template-mail ships with same backends as Django (https://docs.djangoproject.com/en/dev/topics/email/#email-backends). Just replace **django.core.mail** by **templatemail** ::EMAIL_BACKEND = 'templatemail.backends.smtp.EmailBackend'Convert HTML into plain text----------------------------By default, django-template-backend use a minimalist process to convert HTML into plain text. I suggest you to use **html2text** (https://github.com/aaronsw/html2text) ::EMAIL_HTML2TEXT = 'html2text.html2text'You can also write your own method and use it ::EMAIL_HTML2TEXT = 'your.module.yourhtml2textmethod'Sending emails==============To send email with django-template-mail you simply should use the method described in the Django documentation (https://docs.djangoproject.com/en/dev/topics/email/) and replacing the **message** attribute as a tuple **('directory_template/template.html', {'key': 'value'}, context_instance)** ::from django.core.mail import send_mailsend_mail('Welcome',('mail/welcome.html',{'username': request.user.username,'full_name': request.user.get_full_name(),'signup_date': request.user.date_joined}),'from@example.com',['to@example.com'],fail_silently=False)django-template-mail looked in django template directories/loaders ::<p>Hi {{full_name}},</p><p>You just signed up using:<ul><li>username: {{username}}</li><li>join date: {{signup_date}}</li></ul></p><p>Thanks!</p>
Package: django-template-maths
=====Django Template Maths=====Django Template Maths is a simple filter for execute maths in templateQuick start-----------1. Add "django_template_maths" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [...'django_template_maths',]Example usage-------------```html{% load django_template_maths %}{{ 10|add:5 }} # print 15{{ 10|sub:5 }} # print 5{{ 10|div:5 }} # print 2{{ 10|mul:5 }} # print 50{{ 10|mod:5 }} # print 0{{ 10|exp:5 }} # print 100000{{ 10|flr:5 }} # print 2{{ 10|sqr }}   # 3.1622776601683795{{ 10|add:5|add_decimal:2 }} # print 15.00{{ 1000|add:5|add_decimal:2|separator:'comma' }} # print 1,005.00{{ 1000|add:5|add_decimal:2|separator:'dot' }} # print 1.005,00{{ 1000|remove_decimal|separator:'dot' }} # print 1.005{{ 50|percent_of_number:500 }} # print 10,0```