Saravanan666/pypi-org huggingface dataset:
Package: django-label-templates
A custom template loader for multi-site set-ups.This is intended for users ofdjango.contrib.sitesfor multi-site cases
where a different site can have different templates, not only a different
styling.The custom template loaders will try to find a template for the currently
active site, and fall back on a generic template.InstallationInstall with pip:pip install django-label-templatesConfigurationInstalled appsMake sure thatdjango.contrib.sitesis in yourINSTALLED_APPS.Specify template loadersYou also need to enable the loader in the settings, similar to Django’s
cached template loader. The loader takes an iterable (list or tuple) of
loaders to find the templates. Example - and probably most used - set-up:TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates',# APP_DIRS must be False if you specify the loaders yourself'APP_DIRS':False,'DIRS':[os.path.join(PROJECT_DIR,'templates'),],'OPTIONS':{'loaders':[('label_templates.loaders.Loader',['django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader',]),],},},]If you wish, this template loader can also be wrapped in other loaders,
likedjango.template.loaders.cached.Loader.Configure the site labelsFor the final step, one extra custom settings is required:SITELABELS.# the import is safe and does NOT depend on django.conf.settingsfromlabel_templates.sitesimportSiteLabels,SiteChoiceclassSITELABELS(SiteLabels):site=SiteChoice('example.com',site_id=1)site2=SiteChoice('example2.com',site_id=2)This settings is used to look up the label-prefix for the templates. The site
withID=1will resolve to a subfoldersite/, so to load the templateexample.html, the loader will try to findsite/example.htmlfirst, and
failing that, will try to just loadexample.html.For the site withID=2, the prefixsite2is used.NoteTo find the matching site, the loader tries to get the label for theSiteChoicebased ondjango.contrib.sites.models.Site.name, with a
fallback todomain. So, for the first argument ofSiteChoice, it’s
safest to enter theSite.namevalue.LimitationsSince the{% extends %}tag uses the same loader configuration, you can not
let a label-specific template inherit from a generic template with the same
name.A workaround is the following structure:templates/
├── mylabel/
|   └── base.html  # extends _base.html and overrides stuff
├── _base.html
└── base.html  # extends _base.html, overrides nothingVersions supportedThis library is tested against Django 1.8 and 1.9. The corresponding Python
versions for the Django versions apply. Consulttox.inifor an up to date
build matrix.
Package: django-lab-inventory
lab-inventorylab-inventory is a Django application used by our lab to to track inventory and orders. The basic idea is that users add items that can be purchased to the database, and then associate them with orders when they want to get the item. This allows us to quickly locate information about things we have purchased throughout the history of the lab. There is also some rudimentary support for keeping track of where items are located in the lab, when their warranties expire, and other useful information.You'll probably need some familiarity withDjangoand some knowledge about how to deploy a web application to use it.lab-inventory is licensed for you to use under the BSD 3-Clause License. See COPYING for detailsQuick startRequires Python 3.8+ and Django 4.0+Install the package from pypi:pip install django-lab-inventory. Worth putting in a virtualenv.Addinventoryto your INSTALLED_APPS setting like this:INSTALLED_APPS=(...'inventory',)Include the inventory URLconf in your project urls.py like this::re_path(r'^inventory/',include('inventory.urls')),Runpython manage.py migrateto create the inventory models.Start the development server and visithttp://127.0.0.1:8000/admin/inventory/to create items, vendors, manufacturers, etc. (you'll need the Admin app enabled).Visithttp://127.0.0.1:8000/inventory/to use views.
Package: django-laboratory
Django LaboratoryA Django application for managing collections of scientific instrumentsDocumentationThe full documentation is athttps://ssjenny90.github.io/django-laboratory/QuickstartInstall Django Laboratory::pip install django-laboratoryAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'laboratory',
    ...
)Add Django Laboratory's URL patterns:urlpatterns = [
    ...
    path('', include("laboratory.urls")),
    ...
]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCredits
Package: django-laconicurls
Introductiondjango-laconicurls is different to other Django URL Shortener apps. It uses Django’s GenericForeignKeys and get_absolute_url to provide short urls for instances of Django models. The goal is to provide short, human readable urls, that can be featured within emails, print campaigns, qr codes and social media etc. These URLs will continue to work across site restructures etcQuick startRunpip install django-laconicurlsto install django-laconicurlsAdd “laconicurls” to INSTALLED_APPS in settings.py:INSTALLED_APPS = (
    ...
    'laconicurls',
)Add laconicurls urlconf to urls.py. If possible it’s best to use a single case insensitive character for this:url(r'^(?i)Z', include('laconicurls.urls')),Runpython manage.py migrateto create the necessary models.In your code, create some urls:from laconicurls.models import laconic_url_for_object
#this can be any django object that supports get_absolute_url
article = MyArticleModel.objects.get(pk=1)
short_url = laconic_url_for_object(article)FeaturesCreates and manages shortcut URLs for any instance of a Django model that implements get_absolute_urlCase insensitive Base27 encoding of URLs. Alphabet excludes vowels and numbers which look like vowels to reduce the likelyhood of offensive URLs (at least in English)One laconic URL per object. Repeat calls tolaconic_url_for_objectfor a given object will always result in the same URLExample UsageSay you have two models, Product and Promotion, which both implement get_absolute_url and have search engine friendly URLs:>>> Product.objects.get(pk=100).get_absolute_url()
'/products/garden/100-fancy-green-electric-lawnmower'
>>> Promotion.objects.get(pk=50).get_absolute_url()
'/promotions-and-hot-deals/50-up-to-twenty-percent-off-gardening-equipment'Clearly these URLs are not suitable for a print campaign, and are likely to change over time, subject to different SEO trends.To add support for laconic URLs you need to pick a suitable prefix which doesn’t clash with any existing URLs. Ideally this will be a single character and won’t be case sensitive, but if you want it can be longer or contain slashes. For example, add the following to your urls.py to have laconicurls that begin with the letter Q:url(r'^(?i)Q', include('laconicurls.urls')),The easiest way to get laconic urls is to use thelaconic_url_for_objecthelper. Example output might be as follows:>>> from laconicurls.models import laconic_url_for_object
>>> laconic_url_for_object(Product.objects.get(pk=100))
'/QGH3'
>>> laconic_url_for_object(Promotion.objects.get(pk=50))
'/QGH4'When accessed these URLs will redirect to the locations returned by their respectve get_absolute_url method callsTODOAdd support for templatetagsInvestigate ways to support alternate alphabets, as some users will not require case insensitive urls and may prefer a more efficient encoding (e.g. base 62)Management commands for inspecting URLs
Package: django-la-facebook
Dedicated facebook authentication for Django that does it via the backend and not javascript. Has lots of tests and a trivial-to-setup test project with working code.Reason:http://pydanny.blogspot.com/2011/01/what-i-want-for-django-facebook-connect.htmlFull Documentation:http://django-la-facebook.readthedocs.org/en/latest/index.htmlUsageGetdjango-la-facebookinto your python path:pip install django-la-facebookAddla_facebookto your INSTALLED_APPS in settings.py:INSTALLED_APPS = (
    ...
    'la_facebook',
    ...
    )Addla_facebookto your root urlconf (urls.py):urlpatterns = patterns('',
    ...,
    url(r"^la_facebook/", include("la_facebook.urls")),
    ...,
)Add settings just as:FACEBOOK_ACCESS_SETTINGS = {
        "FACEBOOK_APP_ID": FACEBOOK_APP_ID,
        "FACEBOOK_APP_SECRET": FACEBOOK_APP_SECRET,
        # The following keys are optional
        # "CALLBACK": "la_facebook.callbacks.default.default_facebook_callback",
        # "PROVIDER_SCOPE": ['email','read_stream'],
        # "LOG_LEVEL": "DEBUG",
        # "LOG_FILE": "/tmp/la_facebook.log",
}
Package: django_lair
Analytics and metrics app to both store and display user actionsDocumentationdjango_lair will ingest user metrics, store in django configured database,
and show views for the user. Provides an API in your django application to
POST user data in key, value form to support arbitrary types of data.Clients generate their own UUID and save locally. There is no special
authentication or authorization.QuickstartInstall django_lair:pip install django_lairAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_lair',...)Add django_lair’s URL patterns:fromdjango_lairimporturlsasdjango_lair_urlsurlpatterns=[...url(r'^',include(django_lair_urls)),...]Migrate app:./manage.py migrate django_lairUsageFor the top level dashboard, navigate to<endpoint>/datum/, e.g.:http://localhost:8000/datum/To create a new user with metric datum, POST to endpoint/datum/create/with metric data. Make sure you use theuuidparam (it is suggested to
always use uuid form):curl --data "uuid=abcdefgh-1234-1234-9876-abcdefghijkl&name=metric1&value=value1" http://localhost:8000/datum/create/To add metric data, POST to endpoint/datum/create/with user, metric
name, and metric value information:curl --data "user=abcdefgh-1234-1234-9876-abcdefghijkl&name=metric1&value=value1" http://localhost:8000/datum/create/Be sure to include uuid/user, name, and value in the POST for each metricFeaturesStores users and shows list view of metrics hitProvides simplistic list view of saved datums including unique user graphsProvides detailed user page with frequency graphSearch, sort, and filter paginated tables of user dataRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Package: django-lamson
django-lamsonThe purpose of this django application is to integrate The Lamson Mail Server(TM) within existing django projects. It is currently geared towards projects that need to receive email. It provides management commands for starting/stopping the lamson daemon and the ability to configure the daemon from your django project settings module. The purpose is to eliminate multiple configuration points and to ease off the deployment and distribution of your django project.InstallationInstall with pip or easy_install:pip install django-lamsoneasy_install django-lamsonAdddjango-lamsonto your installed apps list in your settings.pyUsage exampleFor an example project using this application please look at thetestprojectfolder within the app sourcecode.
Package: django-landing-page
AboutA reusable app to create and manage a landing page for your project - with supplied themes.Version 0.1.1 - initial release, not ready for general use. Seriously. Don’t.Project home:https://github.com/weholt/django-landing-pageAuthor:thomas@weholt.orgQuickstartInstall django-landing-page:pip install django-landing-pageAdd the app and it requirements to yourINSTALLED_APPS:INSTALLED_APPS=(...'landing_page','fontawesome','sorl.thumbnail','ckeditor',...)See the requirements.txt in the source-folder at github for details.Add django-landing-page’s URL patterns:fromlanding_pageimporturlsaslanding_page_urlsurlpatterns=[...url(r'^',include('landing_page.urls',namespace='landing_page')),...]FeaturesTODOCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2018-10-03)First release on PyPI.
Package: django-lang
django-langGitHubTestCheck Demo ProjectCheck the demo repo onGitHubRequirementsPython 3.8+ supported.Django 3.2+ supported.SetupInstall frompip:pipinstalldjango-langModifysettings.pyby adding the app toINSTALLED_APPS:INSTALLED_APPS=[# ..."lang",# ...]Modifysettings.pyby adding the app toINSTALLED_APPS:TEMPLATES=[{"BACKEND":"django.template.backends.django.DjangoTemplates","DIRS":[os.path.join(PROJECT_DIR,"templates")],"APP_DIRS":True,"OPTIONS":{"context_processors":["django.template.context_processors.debug","django.template.context_processors.request","django.contrib.auth.context_processors.auth","django.contrib.messages.context_processors.messages","lang.context_processors.from_settings",],},},]Modify your project's base templatebase.htmlto include language's switcher styles:<head>...<linkrel="stylesheet"type="text/css"href="{% static 'lang/css/nav-link.css' %}">...</head>Modify your project's nav templatenav.htmlto include language's switcher:<navclass="navbar">...<ulclass="nav navbar-nav">{% include "nav-link.html" %}</ul>...</nav>Modify your project's base templatebase.htmlto include attributes usingtranslate_urltemplate's tag:<head>...<metaname="language"content="{{ LANGUAGE_CODE }}"/>{% include "hreflang.html" %}
    ...</head>Run Example Projectgitclone--depth=50--branch=django-langhttps://github.com/DLRSP/example.gitDLRSP/examplecdDLRSP/example
pythonmanage.pyrunserverNow browser the app @http://127.0.0.1:8000Referencesbrainstorm.it- Language's switchinghakibenita.com- Url's translation for "hreflang" html's attributes
Package: django-langchain
Django LangchainWhat's this ?This package aims to provide integration between LangChain and Django.This is very early and the current stage is :alphaCompatibilityLangChain is moving at a fast pace and interfaces may change.
Version pinning is not enforced at the time to be able to use latest releases.This package is built usingLangChain v0.0.229Django 4.2Python 3.9Database requirementsYou have to use a pgvector-enabled Postgresql databaseRoadmapNever ending todo :Base document models (chunks and sources)A LangChain-compliant document storeEmbeddings are computed viaSourceDocument.parse_fileBare-bone admin management interfaceSerializers (output) to use with Django REST FrameworkComprehensive set of utilities binding LLM & chains(TBC)Serializers (input) to use with Django REST Framework(TBC) Add support for celery or other async queuing system(TBC) Add support for data visualization in django adminQuickstartUsing the admin siteStore a file inSourceDocumentmodelPerform the admin actionParse and index fileCheck forDocumentChunkinstancesPerform a similarity search using Django's admin built-in search (returns 5 most relevant results)Using the consolefromdjango_langchain.modelsimportSourceDocumentsource_doc=SourceDocument(title='< Title >',file='< /path/to/file/ >')source_doc.save()#: This could take some time and some non-trivial amount of RAMsource_doc.parse_file()print(source_doc.documentchunk_set.count())fromdjango_langchain.modelsimportDocumentChunk,DocumentChunkStore# Perform a similarity searchqueryset=DocumentChunk.objects.search('< query >',max_results=5)# Or using DocumentStore Langchain interfacestore=DocumentChunkStore()source,doc=store.search("< query >")print(doc.metadata)print(doc.page_content)
Package: django_langlink
This is a simple Django apllication that provide an abstract class to create a language model and
a management command to populate your model with language titles and their codes.A ManyToMany relationship to this language model can be useful to define a language field on other models.Source of the Language codes which are used in this application is:http://data.okfn.org/data/core/language-codes#resource-language-codesInstallationInstall the application package using pip:pip install django-langlinkadd ‘langlink’ to the INSTALLED_APPS list on your settings fileHow to useImport the Language abstract model from langlink and use it to create your language model:from langlink.models import Language

class MyLanguageModel(Language):
    passafter you create and migrate your models, run this management command to populate the data:python manage.py add_languages my_app_name mylanguagemodel
Package: django-lang-pref-middleware
Django Language Preference MiddlewareThis repo contains basic middleware that retrieves a user’s language
preference and sets it on the request session.UsageSubclassLanguagePreferenceMiddlewareand override theget_user_language_preferencemethod.Your new middleware should be
tested by includingLangPrefMiddlewareTestCaseMixinin your test case and
overriding themiddleware_class,get_user, andset_user_language_preferenceattributes.Testing$ make validateHow to ContributeContributions are very welcome, but for legal reasons, you must submit a signed
[individual contributor’s agreement](http://code.edx.org/individual-contributor-agreement.pdf)
before we can accept your contribution. See our
[CONTRIBUTING](https://github.com/openedx/.github/blob/master/CONTRIBUTING.md)
file for more information – it also contains guidelines for how to maintain
high code quality, which will make your contribution more likely to be accepted.
Package: django-langswitch
=====langswitch=====langswitch - is django app, that can be used on multilingual sites to allow users switch site language, and use some template tags for maintain multilang links etc.Quick start-----------1. Add "langswitch" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'langswitch',)and make sure that you have django.core.context_processors.request in TEMPLATE_CONTEXT_PROCESSORS:TEMPLATE_CONTEXT_PROCESSORS = (...'django.core.context_processors.request',...)2. Load langswitch in your template:{% load lang_switch %}3. Use template tag {% set_lang_from_path %} to activate translation, from url path (like /en/example/article/ for english language or /ru/example/article/ for russian)this tag also defines variable 'lang' in template context, so you can use it.4. Also you can just get variable 'lang' to template context with {% get_lang %} template tag
Package: django-lang-switch
Language switch for Django.InstallationYou can installdjango-lang-switchfrom PyPi:$pipinstalldjango-lang-switchConfigurationYou need to adddjango_lang_switch.apps.DjangoLangSwitchConfiginto yourINSTALLED_APPSsetting.
If you want to add enable language switch in django admin site, you have to add it beforedjango.contrib.admin.
Otherwise, you need to putdjango.contrib.adminfirst.
If you don’t use django admin site, the order does not matter.If you tweaked theadmin/base_site.htmltemplate yourself,
put this application after yours and use the template tag as described below.You also need to includedjango-lang-switchurls to yourROOT_URLCONF. Example:fromdjango.urlsimportinclude,pathurlpatterns=[...path('django_lang_switch/',include('django_lang_switch.urls')),]You can of course change the path to suit your needs.UsageIf you just want to add language switch to django admin site,
add this application to yourINSTALLED_APPSas described above and you are done.If you want to use the same switch elsewhere, add template tagelang_switch_dropdownto your template.
Don’t forget to loadlang_switchtag collection to your template. Example:{% extends myapp/base_site.html %}
{% load lang_switch %}<divid="header">Welcome to MyApp!<divclass="right">{% lang_switch_dropdown %}</div></div>StylingLanguage switch in django admin site is already styled to fit the default design.
If you want to style the lang switch yourselves,
you may set css for thediv.lang-switchelement and its descendants.
Package: django-language-field
Language Field for Django apps. Includes all language choices from the IANA Language Subtag Registry.Included is:LanguageField, a model fieldLanguageField, a form field (Not yet implemented)regenerate.py, a script to parse the latest language list from IANAInstallationpip install django-language-fieldBasic usageAddlanguagesto the list of the installed apps in
yoursettings.pyfile:INSTALLED_APPS = [
    ...
    'languages',
    ...
]Then, you can use it like any regular model field:from languages.fields import LanguageField

class MyModel(models.Model):
    ..
    language = LanguageField()
    ..Internally, LanguageField is based uponCharFieldand by default
represents the as a string.As withCharField’s, it is discouraged to usenull=Trueuseblank=Trueif you want to make it a non-required field.
Package: django-language-fields
Language and Region Fields for Django apps. Includes all language choices from the IANA Language Subtag Registry.Included is:LanguageField, a model fieldRegionField, a model fieldInstallationpip install django-language-fieldsBasic usageAddlanguagesto the list of the installed apps in
yoursettings.pyfile:INSTALLED_APPS = [
    ...
    'languages',
    ...
]Then, you can use it like any regular model field:from languages.fields import LanguageField, RegionField

class MyModel(models.Model):
    ..
    language = LanguageField()
    ..

class MyModel(models.Model):
    ..
    region = RegionField()
    ..Internally, LanguageField and RegionField are based uponCharFieldand by default
represented as strings.As withCharField’s, it is discouraged to usenull=Trueuseblank=Trueif you want to make it a non-required field.
Package: django-language-flags
Flags is a simple Django app that helps display national flags. For
efficiency, there is just one huge PNG file with all the flags, and
individual flags are selected for display using CSS trickery.Quick startAdd “language_flags” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'language_flags',
]In templates where you want to use language_flags, include the
language_flags template tag library:{% load language_flags_tags %}You can use theflags_for_languagetag to display a number
of flags of nations where a language is spoken. Right now the
language can be either English or German:{% flags_for_language COUNT LANGUAGE %}This will display COUNT flags for language LANGUAGE; the flags will
always include the first country listed for LANGUAGE, while the
remainder will be randomly selected from the other countries.AcknowledgmentsThe flag sprite was downloaded fromhttps://www.flag-sprites.comand
is derived from the FamFamFam flag icon set athttp://www.famfamfam.com/lab/icons/flags/.