Saravanan666/pypi-org huggingface dataset:
Package: django-template-standalone
django-template-standaloneSimple setup to use django's template engine for non-django applications.Installpip install django-template-standaloneUsagefrom django_template_standalone import render

from django_template_standalone import register_dirs
from django_template_standalone import render_template


msg = render("hello {{name}}, how are you?", {"name": "Cissie"})
assert msg == "hello Cissie, how are you?"

reigster_dirs("./templates/")
html = render_template("index.html", {"title": "This is an index Page"})
assert html == "<h1>This is an index Page</h1>"Content of./templates/index.htmlis:<h1>{{title}}</h1>Methodsrender(template_text, context): Render a template text with context.render_template(template_filename, context): Render a template file with context.reigster_dirs(*dirs): Add template dirs.register_apps(*apps): Add template apps.setup(template_dirs, apps): Setup django's template engine with template dirs and apps.Note:When usingreigster_appsmethod or usingappsparameter insetupmethod, there must be atemplatessub-folder under the APP's root folder.Thesetupmethod will be auto called in other functions, so you really don't need to call it manually.Releasesv0.1.0 2021/11/30First release.
Package: django-templates-variables
Installation$[sudo]pipinstalldjango-templates-variablessettings.pyINSTALLED_APPS+=['django_templates_variables']TEMPLATES=[{# …'OPTIONS':{'context_processors':['django_templates_variables.context_processors.templates_variables',],},},]Examplessettings.pyTEMPLATES_VARIABLES=dict(settings=dict(DEBUG=DEBUG,VAR="VALUE"))template.html:{% if settings.DEBUG %}
    {{ settings.VAR }}
{% endif %}readme42.com
Package: django-template-tag
Project ScopeThis project serves as an exploration of the sllist topic and is not intended for global use.Package FunctionalityThe package I have developed is specifically designed for handling integer data. It does not support other data types, and therefore, no tests have been conducted using non-numeric data. If you encounter errors while using non-numeric values, please note that such behavior is expected.Functionality and TestingThe package offers a variety of functions that may cater to your needs, along with corresponding tests to help identify any errors. If you intend to modify any of the functions, it is advisable to test their functionality to ensure their effectiveness.Documentation and Code CommentsDetailed documentation for each function can be found in the index.py file. This documentation provides a clear understanding of each function's purpose, parameter types, input requirements, return values, and data types of the output. Additionally, the code includes brief comments alongside each function, describing its functionality and usage.InstallationYou can install the package usingpip:pipinstalldjango-template-tagMake sure you have upgraded version of pip:Windowspy-mpipinstall--upgradepipLinux/MAC OSpython3-mpipinstall--upgradepipIf you want to use tests in my package you need to install pytest:pipinstallpytestHow to use functions:
Package: django-templatetag-handlebars
django-templatetag-handlebarsallows you to embedHandlebars.jstemplates in your django templates.Most of the template tag code comes fromMiguel Araujo’s verbatim snippet.INSTALLpip install django-templatetag-handlebarsUSAGEAddtemplatetag_handlebarsto yourINSTALLED_APPSAdd the HTML header :{% load templatetag_handlebars %}

<head>
{% handlebars_js %}
...
</head>Call the template tag, and write your Handlebars template :{% tplhandlebars "tpl-infos" %}
    {{total}} {% trans "result(s)." %}
    <p>{% trans "Min" %}: {{min}}</p>
    <p>{% trans "Max" %}: {{max}}</p>
{% endtplhandlebars %}The following block with end-up in your page :<script type="text/x-handlebars" id="tpl-infos">

    {{total}} result(s).
    <p>Min: {{min}}</p>
    <p>Max: {{max}}</p>
<script>Render it, client-side, as usual usingHandlebars.jsAPI :var properties = {
    total: 10,
    min: 4,
    max: 5
};

var template = Handlebars.compile($('#tpl-infos').html()),
    rendered = template(properties);Your rendered string is ready, and waiting to be inserted in your DOM :)10 result(s).
<p>Min: 4</p>
<p>Max: 5</p>AdvancedA{% verbatim %}tag is available to escape a specific part. For
example, you may want a subpart of yourHandlebarstemplate to be
rendered by Django :<script type="text/x-handlebars" id="tpl-django-form">

    <form>
        {% verbatim %}
            {{#if id}}<h1>{{first}} {{last}}</h1>{{/if}}

            {% trans "Your id is" %} {{ id }}
        {% endverbatim %}
        {{ yourform.as_p }}
    </form>
</script>Using Ember.jsInsettings.pyensure to set the following attribute toTrue. This is due toEmber.jsexpecting a slightly different script id declarationUSE_EMBER_STYLE_ATTRS = TrueThe script block will be rendered like`<scripttype="text/x-handlebars"data-template-name="%s">`.AUTHORSMathieu Leplatre <mathieu.leplatre@makina-corpus.com>Miguel Araujo <https://github.com/maraujop>Ross Crawford-d’Heureuse <https://github.com/stard0g101>Similar toolsdjango-handlebars by Sergii Iavorskyi, which focuses on server-side Handlebars rendering.django-handlebars by Chris Vigelius, with templates in separate files, and served in one block.LICENSELesser GNU Public LicenseHandlebars.jsis released under the MIT license - Copyright 2011 Yehuda KatzCHANGELOG1.3.1 (2016-01-04)Add Python3 compatibility (thanks Tadas Dailyda)1.3.0 (2015-05-26)Add Django 1.8 compatibility (thanks @markvl)1.2.0 (2012-05-30)Add compatibility with Ember.js with a setting (default False). See README.rst.1.1.0 (2012-03-26)Remove dependency to template Egg loader using template tag1.0.1 (2012-03-16)Fix packaging1.0.0 (2012-03-16)Initial working version
Package: django-templatetags-bundle
django-stylus-watcher======================This add a command .Usage=====Put ``'stylus_watcher'`` into ``INSTALLED_APPS``.Set settings ``STYLUS_WATCHER = [('relative/path/to/main/stylus/file.styl', 'relative/path/to/compiled/file.css'), # A compilation rules('relative/path/to/main/stylus/file.styl', 'relative/path/to/compiled/file.css'), # Antoher compilation rules...etc]The watcher listen changes in every installed apps ``styl`` folderThen run ``python manage.py stylus_watcher``
Package: django-templatetags-ext
django-templatetags-extensionsDjango TemplateTags ExtensionsInstallationpipinstalldjango-templatetags-extSettings.pyINSTALLED_APPS=(...'django_templatetags_ext',...)Usage{%loadtemplatehelper%}{{googol|googolformat}}{{googol|googolformat:ndigits}}{{googol|googolformat2}}{{googol|googolformat2:ndigits}}{{price|fen2yuan}}{{price|fen2yuan:ndigits}}{{value|truncatechars2:length}}{{value|truncatechars2:'length,truncate'}}{{value|truncatewidth:length}}{{value|truncatewidth:'length,truncate'}}{{value|remove_line_break}}{{value|remove_line_break:repl}}
Package: django-templatetag-sugar
A library to make writing templatetags in Django sweet.Here’s an example of using:fromdjangoimporttemplatefromtemplatetag_sugar.registerimporttagfromtemplatetag_sugar.parserimportName,Variable,Constant,Optional,Modelregister=template.Library()@tag(register,[Constant("for"),Variable(),Optional([Constant("as"),Name()])]):defexample_tag(context,val,asvar=None):ifasvar:context[asvar]=valreturn""else:returnvalAs you can see it makes it super simple to define the syntax for a tag.
Package: django-templatetag-sugarv2
A library to make writing templatetags in Django sweet.Here’s an example of using:fromdjangoimporttemplatefromtemplatetag_sugar.registerimporttagfromtemplatetag_sugar.parserimportName,Variable,Constant,Optional,Modelregister=template.Library()@tag(register,[Constant("for"),Variable(),Optional([Constant("as"),Name()])]):defexample_tag(context,val,asvar=None):ifasvar:context[asvar]=valreturn""else:returnvalAs you can see it makes it super simple to define the syntax for a tag.
Package: django-template-theming
Django application, implement theming concept for templates, flexible and configurable from admin interface.InstallationYou can install the most recentDjango Template Themingversion using pip:pip install django-template-themingSetupNOTE: The following settings should be added to the project filesettings.py.Add ‘theming’ toINSTALLED_APPS:INSTALLED_APPS += ( 'theming', )

if using django-compressor make sure put theming before compressorAdd ‘theming.middleware.ThemingMiddleware’ toMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES += ( 'theming.middleware.ThemingMiddleware', )Add ‘theming.template.Loader’ toTEMPLATE_LOADERS:TEMPLATE_LOADERS += ( 'theming.template.Loader', )UsageIt should create a folderthemesat the project with the following structure:django_project/
| -- themes/
    | -- default/  ** theme name
        | -- static/  ** will collected by `collectstatic` management command
        |   | -- styles/
        |   | -- scripts/
        |   | -- images/
        | -- templatefiles and foldersContributingDevelopment ofdjango-template-theminghappens at github and any idea and contribution is wellcome.https://github.com/wtayyeb/django-template-themingCreditsw.Tayyeb:https://github.com/wtayyeb
Package: django-template-toolkit
This project is a collection of useful templates & tags for the Django web framework.
I made this mainly for my own projects where I noticed I was copying the same set of
templates and template tags & filters over to each new project, but hopefully it will
be useful for other people as well.Django >= 2.2 and Python >= 3.6 are supported.Documentation and examples will follow in the future. For now, to use this package in your
Django project install it withpipthen add it to yourINSTALLED_APPSlist
in settings. You can then include the templates as{% include 'toolkit/forms/field.html' %}(for example)
and the template tags with{% load toolkit %}. For now see the source code for which
template tags & filters are available.
Package: django-template-tree
Generate diagrams showing relationships between templates in Django projectsDocumentationThe full documentation is athttps://django_template_tree.readthedocs.io.QuickstartInstall django-template_tree:pip install django_template_treeAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'template_tree',...)Add django-template_tree’s URL patterns:fromtemplate_treeimporturlsastemplate_tree_urlsfromdjangoimportsettingsifsettings.DEBUG:urlpatterns+=[url(r'^__tt__/',include('template_tree.urls',namespace='template_tree')),]FeaturesDisplays a collapsible tree diagram showing the hierarchy of templates used by a Django application.Nodes can be collapsed and expanded, by clicking on them.Apps can be filtered out of the tree, using the ‘exclude_app’ querystring parameter, thus:http://localhost:8000/__tt__/?exclude_app=template_tree&exclude_app=adminBy default, admin is excluded, sohttp://localhost:8000/__tt__/is equivalent tohttp://localhost:8000/__tt__/?exclude_app=adminIn order to show the admin app as well, you will need to ‘unexclude’ it thus:http://localhost:8000/__tt__/?exclude_app=Visiting the template_tree url, requesting an application/json response will return json data
compatible with d3 hierarchies, so you can roll your own diagrams.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 (2018-01-06)First release on PyPI.
Package: django-template-url-optional
Installation$[sudo]pipinstalldjango-template-url-optionalExamplessettings.pyINSTALLED_APPS=[...'django_template_url_optional',...]{% load url_optional %}<ahref="{% url_optional 'item_list' variable %}"><ahref="{% url_optional 'item_list' %}">urls.pyurlpatterns=[path('<str:name>/',views.ItemListView.as_view(),name='item_list'),path('',views.ItemListView.as_view(),name='item_list'),]readme42.com
Package: django-template-website-ui
Django Template Website UIBehold My Awesome Project!License: Apache Software License 2.0SettingsMoved tosettings.Basic CommandsSetting Up Your UsersTo create anormal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.To create asuperuser account, use this command:$ python manage.py createsuperuserFor convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.Type checksRunning type checks with mypy:$ mypy appsTest coverageTo run the tests, check your test coverage, and generate an HTML coverage report:$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.htmlRunning tests with pytest$ pytestLive reloading and Sass CSS compilationMoved toLive reloading and SASS compilation.CeleryThis app comes with Celery.To run a celery worker:cdapps
celery-Aconfig.celery_appworker-linfoPlease note: For Celery's import magic to work, it is importantwherethe celery commands are run. If you are in the same folder withmanage.py, you should be right.To runperiodic tasks, you'll need to start the celery beat scheduler service. You can start it as a standalone process:cdapps
celery-Aconfig.celery_appbeator you can embed the beat service inside a worker with the-Boption (not recommended for production use):cdapps
celery-Aconfig.celery_appworker-B-linfoEmail ServerIn development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP serverMailpitwith a web interface is available as docker container.Container mailpit will start automatically when you will run all docker containers.
Please checkcookiecutter-django Docker documentationfor more details how to start all containers.With Mailpit running, to view messages that are sent by your application, open your browser and go tohttp://127.0.0.1:8025SentrySentry is an error logging aggregator service. You can sign up for a free account athttps://sentry.io/signup/?code=cookiecutteror download and host it yourself.
The system is set up with reasonable defaults, including 404 logging and integration with the WSGI application.You must set the DSN url in production.DeploymentThe following details how to deploy this application.DockerSee detailedcookiecutter-django Docker documentation.
Package: django-templation
The easy way to allow designers edit templates and assets.DocumentationThe full documentation is athttp://django-templation.rtfd.org.InstallationInstall django-templation:pip install django-templationFeaturesResource Access administration via Django admin.WebDAV access for designers to easily edit templates and static files from anywhere.Sandboxed templates: restrict the use of Django builtin template tags and filtersHistory0.1.0 (2014-01-24)First release.0.1.1 (2014-05-22)Bug fixes:Fixed import error when using a Custom Resource Access Model
Package: django-tempocal
An extension of the Python stdlib’scalendar.HTMLCalendarthat makes use of Django templates to customise the output. After all, it’s pretty lame having hard-coded HTML output.Usage:pip installdjango-tempocalAdd'tempocal'to yourINSTALLED_APPS.fromtempocalimportTemplatedCalendardefmyview(request,year,month):calendar=TemplatedCalendar()month_table=calendar.formatmonth(int(year),int(month))returnrender_to_response('myview.html',{'month_table':month_table})This will use thetempocal/month.htmlthat comes with tempocal, you can override this via the normal Django mechanism.
Package: django-temporal-models
======================Django-temporal-models======================Django-temporal-models это темпоральные модели навеянные 1совскими регистрами сведений.Небольшой пример==============>>> from temporal.models import models, TemporalForeignKey, TemporalModel, TemporalTrail>>>>>> class Person(TemporalModel):>>>     first_name = models.CharField(max_length=255)>>>     last_name = models.CharField(max_length=255)>>>     salary = models.PositiveIntegerField()>>>     organization = TemporalForeignKey('Organization')>>>>>>     history = TemporalTrail()>>>>>>     def __str__(self):>>>         return u"%s %s" % (self.first_name, self.last_name)>>>>>> class Organization(TemporalModel):>>>     name = models.CharField(max_length=255)>>>>>>     history = TemporalTrail()>>>>>>     def __str__(self):>>>         return u"%s" % (self.name)>>>>>> from datetime import date>>>>>>	org = Organization.objects.create(name=u'Муниципальное унитарное предприятие городского транспорта "Тюменьгортранс"', date_begin=date(1997, 01, 31))>>>>>> org.name = u'Муниципальное учреждение пассажирского городского транспорта "Тюменьгортранс"'>>> org.date_begin = date(2004,7,1)>>> org.save()>>>>>> org.name = u'Муниципальное казенное учреждение "Тюменьгортранс"'>>> org.date_begin = date(2012,1,11)>>> org.save()>>>>>> org.get_actual(date(2010,1,1))<OrganizationTemporal: Муниципальное учреждение пассажирского городского транспорта "Тюменьгортранс" as of 2004-07-01..2012-01-10>>>>>>> person = Person.objects.create(first_name=u'Василий', last_name=u'Пупкин', salary=7000, organization=org, date_begin=date(2000,5,10))>>>>>> person.date_begin=date(2005,1,1)>>> person.salary=12000>>> person.save()>>>>>> person.date_begin=date(2010,1,1)>>> person.salary=17000>>> person.save()>>>>>> person.date_begin=date(2012,2,1)>>> person.salary=20000>>> person.save()>>>>>> person.get_actual()<PersonTemporal: Василий Пупкин as of 2012-02-01..>>>>>>> person.get_actual().organization<OrganizationTemporal: Муниципальное казенное учреждение "Тюменьгортранс" as of 2012-01-11..>>>>>>> person.get_actual(date(2011,10,1))<PersonTemporal: Василий Пупкин as of 2010-01-01..2012-01-31>>>>>>> person.get_actual(date(2011,10,1)).organization<OrganizationTemporal: Муниципальное учреждение пассажирского городского транспорта "Тюменьгортранс" as of 2004-07-01..2012-01-10>
Package: django-tenancy
Handle multi-tenancy in Django with no additional global state using schemas.InstallationAssuming you have django installed, the first step is to installdjango-tenancy:pip install django-tenancyNow you can import thetenancymodule in your Django project.Using django-tenancyDefine a Tenant ModelThe tenant model must be a subclass oftenancy.models.AbstractTenant.For instance, yourmyapp/models.pymight look like:from tenancy.models import AbstractTenant

class MyTenantModel(AbstractTenant):
   name = models.CharField(max_length=50)
   # other fields
   def natural_key(self):
      return (self.name, )Important note: thenatural_keymethod must return a tuple that will
be used to prefix the model and its database table. This prefix must be unique
to the tenant.Declare the Tenant ModelNow that you have your tenant model, let’s declare in your project insettings.py:TENANCY_TENANT_MODEL = 'myapp.MyTenantModel'Run a database synchronization to create the corresponding table:python manage.py syncdbDefine the tenant-specific modelsThe tenant-specific models must subclasstenancy.models.TenantModel.For instance, each tenant will have projects and reports. Here is howmyapp/models.pymight look like:from tenancy.models import AbstractTenant, TenantModel

class MyTenantModel(AbstractTenant):
   name = models.CharField(max_length=50)
   # other fields
   def natural_key(self):
      return (self.name, )

class Project(TenantModel):
   name = models.CharField(max_length=50)
   description = models.CharField(max_length=300, blank=True, null=True)

class Report(TenantModel):
   name = models.CharField(max_length=50)
   content = models.CharField(max_length=300, blank=True, null=True)Playing with the defined modelsYou can manipulate the tenant and tenant-specific models as any other Django
models.Create a tenant instancetenant = MyTenantModel.objects.create("myfirsttenant")Get a tenant-specific model: for_tenant()<TenantModel>.for_tenant(<AbtractTenantConcreteSubclass instance>)TenantModelcomes with a method that allows you to get the specificAbstractTenantModelfor a given Tenant instance. For instance:tenant_project = Project.for_tenant(tenant)Create a tenant-specific model instancetenant_project.objects.create("myfirsttenant_project")Python 3.5An issue with circular references betweenModelobjects prevent garbage
collection of tenant specific models on tenant deletion.
Package: django-tenanet
django-tenanetTenanet is a simple multi-tenancy framework for Django.
It features a simple tenant data model, a middleware to handle tenant
resolution, a context processor and a query manager to handle tenant data
isolation.Works well with django-allauth or other custom User models. TenantUser
association is inlined in the default User admin form and the default User
serializer.A swappable Tenant metaclass is provided to allow for custom metadata
(e.g. app-specific preferences, filters, feature flags, etc.) to be added to
the Tenants.FeaturesTenant data modelTenant middlewareTenant query managerSwappable Tenant metaclassRequirements (tested)Python 3.6+Django 4.0+Installationpip install django-tenanetUsageSettingsAdd tenanet to your INSTALLED_APPS:INSTALLED_APPS=(...'tenanet',)Add tenanet.middleware.TenantMiddleware to your MIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES=(...'tenanet.middleware.TenantMiddleware',)Override the TENANET_TENANT_MODEL setting to point to your custom tenant model:TENANET_TENANT_MODEL='myapp.MyTenantModel'ModelsTenantMetafromtenanet.modelsimportBaseTenantMetaclassMyTenantMeta(BaseTenantMeta):# Add custom tenant metadata fields hereTenant scoped data with TenantDataModelfromtenanet.modelsimportTenantDataModelclassMyTenantModel(TenantDataModel):# Add custom tenant data model fields hereAdminTenantUser inlinefromdjango.contribimportadminfromdjango.contrib.auth.adminimportUserAdminfromdjango.contrib.auth.modelsimportUserfromtenanet.adminimportTenantUserAssociationInlineclassMyUserAdmin(UserAdmin):# your user admin config hereinlines=(TenantUserAssociationInline,)admin.site.unregister(User)admin.site.register(User,MyUserAdmin)LicenseThis project is licensed under the terms of the Django-Tenanet Limited Use License.
See the LICENSE file for license rights and limitations.
Package: django-tenant-admin
django-tenant-adminQuick StartIn the settings.py:Add "tenant_admin.apps.Config" to your INSTALLED_APPSAdd TENANT_TENANT_MODEL and TENANT_STRATEGYsettings.pyINSTALLED_APPS = [
    "demoapp.apps.Config",
    ...
    # 'django.contrib.admin',
    ...
    "django.contrib.staticfiles",
    "smart_admin.apps.SmartTemplateConfig",
    "smart_admin.apps.SmartConfig",
    "admin_extra_buttons",
    "tenant_admin.apps.Config",
]

TENANT_TENANT_MODEL = "<app_label>.<model_name>"
TENANT_STRATEGY = "<app_label>.YourStrategy"urls.pyimport tenant_admin.sites


urlpatterns = (
    path("manage/", tenant_admin.sites.site.urls),
    ...
)Some clarification:`Strategy` is about visibility
`Permission` is about authorizationContributinggit checkout https://gitlab.com/os4d/django-tenant-admin.git
cd django-tenant-admin
python -m venv .venv
. .venv/bin/activate
pip install -e .[dev]
pre-commit installCreate sample dataThis will create the DB ./django_tenant_admin.sqlite and populate with some example data../manage.py demoThis will create:4Countryrecords: 'Afghanistan', 'Ukraine', 'Somalia', 'Sudan'4Officerecords: 'Afghanistan Office', 'Ukraine Office', 'Somalia Office', 'Sudan Office'10Employeerecords: 'Employee 0' to 'Employee 9'An 'admin-ukr' user assigned to 'Ukraine Office'An 'admin-afg' user and 8 additional users (username3tousername12) assigned to 'Afghanistan Office'An 'admin' user not assigned to any officeTry it with:./manage.py runserverConnect tohttp://localhost:8000NB:No need to create users as for demo purposes there is a backend that will create the user on the fly using any
password