Saravanan666/pypi-org huggingface dataset:
Package: django-thema
ADjangoapplication that providesEDItEUR Thema categories. It supplies translation to all languages EDItEUR supports, so if you are using Django’s internationalization in your project, you will also get translation.RequirementsThis application requires:djangomockpolibxlrdInstallationInstall the application from Pypi:$ pip install django-themaAdd the application to your Django project:INSTALLED_APPS = [
    ...
    'thema',
    ...
]Migrate the application$ ./manage.py migrate themaYou should populate the model with the data in EDItEUR database, for this use the commandpopulate_thema_categories$ ./manage.py populate_thema_categoriesAlso, please make sure the tests passed smoothly$ ./manage.py test themaIf any test fails, then you could end up with missing data in your database or malfunction of the application.How it worksdjango-thema offers a model ThemaCategory, each instance is a Thema category....>>>fromthema.modelsimportThemaCategory>>>thema_aba=ThemaCategory.objects.get(code='ABA')>>>thema_aba.header'Theory of art'...Getting translation:...>>>fromdjango.utils.translationimportactivate>>>activate('es')>>>thema_aba.local_header'Teoría del arte'>>>activate('da')>>>thema_aba.local_header'Kunstteori'...Note: the translation will work only if you have enabledDjango’s internationalizationin your project.Getting the parent category:...>>>thema_aba.parent<ThemaCategory:AB>...Supported languagesThe application supports the languages covered by EDItEUR:ArabicDanishEnglishSpanishFrenchGermanHungarianItalianJapaneseLithuanianNorwegianPolishPortugueseSwedishTurkishWe don’t do any translation, we just use the data provided by EDItEUR, so if you find a missing translation or a translation error, pleasecontact EDItEUR directly.AuthorsDannier Trinchet AlmaguerMikkel Munch MortensenVladir Antonio ParradoSøren Howe GersagerTobias LeyMaintenanceTo submit bugs, feature requests, submit patches, please usethe official repository.Copyright and licensing informationBSD License 2.0, 3-clause license.
Package: django-themagicapi
# django-themagicapiDjango application. To launch an api server without endpoint.Create the database on demand.We can create multiple databases for different applications.Just focusing on the client.According to how we do the JSON query the server.It will create, alter the table, insert,list or delete data from an entire database automatically.Requirements------------* Django 1.5+* django-tokenapi* valleorm* django-cors-middlewareInstallation------------First obtain `themagicapi` package and place it somewhere on your PYTHONPATH, for examplein your project directory (where settings.py is).Alternatively, if you areusing some sort of virtual environment, like [virtualenv][], you can perform aregular installation or use [pip][]:python setup.py install# or ...pip install django-themagicapi[virtualenv]: http://pypi.python.org/pypi/virtualenv[pip]: http://pip.openplans.org/Add 'themagicapi', 'tokenapi' and 'corsheaders' to your `INSTALLED_APPS`.###These are the modifications of settings.py file:```python#Add these linesPATH_DBS = os.path.join(BASE_DIR, "[path-of-databases]/")MEDIA_ROOT = os.path.join(BASE_DIR, 'docfiles')MEDIA_URL = '/docfiles/'INSTALLED_APPS = ['themagicapi.apps.ThemagicapiConfig','corsheaders',#......]MIDDLEWARE = ['corsheaders.middleware.CorsMiddleware'#......]AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend','tokenapi.backends.TokenBackend'#.....]CORS_ORIGIN_ALLOW_ALL = True```Include `themagicapi.urls` and `tokenapi.urls` in your `urls.py`.It will look something like this:urlpatterns = [url(r'^token/', include('tokenapi.urls')),url('', include('themagicapi.urls')),]Configuration and usage of token--------------------------------You can change the number of days that a token is valid for by setting`TOKEN_TIMEOUT_DAYS` in `settings.py`. The default is `7`.more information see [django-tokenapi]: https://github.com/jpulgarin/django-tokenapi.gitUsage-----### Create new table user if not exists and add new user.paramsRow = {'add':{"db":"valleorm.db",'user':{"nombre": "Pepito","apellido": "Lopez",}}}### Modify a user with know ID. Alter table automatically.paramsRow = {'add':{"db":"valleorm.db",'user':{'ID': 1,'apodo': 'donpepito','telf': '666666'}}}### Get all userparamsRow = {'get':{"db":"valleorm.db",'user':{}}}### Get by IDparamsRow = {'get':{"db":"valleorm.db",'user':{'ID': 1,}}}### Remove row by IDparamsRow = {'rm':{"db":"valleorm.db",'user':{'ID': 1,}}}For more requests see [themagic-apiserver]: https://github.com/vallemrv/themagic-apiserver.gitRequests example----------------```pythonimport requestsimport jsondata = json.dumps(***someparams***)#for get token see https://github.com/jpulgarin/django-tokenapi.gittoken = {'user': 1, #user number'token': 'some token','data': data}r = requests.post("http://localhost:8000/", data=token)print r.json()```:scroll: License----------------Licensed under the Apache-2.0, see `LICENSE`:heart_eyes: Contributors--------------------------Manuel Rodriguez <valle.mrv@gmail.com>
Package: django-theme
django-themeAllow a Django user to set a theme preference.QuickstartInstall django-theme via pip:pip install django-themeAddthemeto yourINSTALLED_APPSin your project settings.py file:INSTALLED_APPS=['...','theme',]Run migrate:python manage.py migrateAdd the following to yourcontext_processorssetting:TEMPLATES=[{'BACKEND':'...','OPTIONS':{'context_processors':['...','...','theme.context_processors.theme',],},},]In your template, you can then use the following snippet (theme options
are 'system', 'dark' and 'light'):<body class="{% spaceless %}
        {% if theme == 'dark' %}
                dark-theme
        {% endif %}
{% endspaceless %}">TheThememodel defines a one-to-one relationship with theUsermodel.
Therefore, the theme object for a user can be retrieved by using:theme=user.themeCompatibilityCompatible with Python 3.8 and above.Compatible with Django 3.2 and above.VersioningThis project followssemantic versioning(SemVer).License and code of conductCheck the root of the repo for these files.
Package: django-themes
# Django Themes#### Brandon R. Stoner <monokrome@monokro.me>## What is this?Django Themes provides a mechanism for theming media for your web applications. This is done by storing a Theme model that contains a name for your theme and it's related directory. You can then access the list of themes and the current theme through these custom context_processors:### themes.context_processors.listGets the complete theme list and sets it to a context variable, theme_list### themes.context_processors.currentGets the current theme and sets it to a context variable, current_theme## Future developments:- Tie this system into the template system, so that themes can override othertemplates if needed.- Provide template tags that are functionally equivalent to the currentlyprovided context processors.
Package: django-themeswitch
# django-themeswitch_django-themeswitch_ is a django app that allows users to easily switch between a set of predefined stylings.## UsageTo use _django-themeswitch_ update your `settings.py`:- add `themeswitch` to your `INSTALLED_APPS`- add 'themeswitch.context_processors.selected_theme' to your `TEMPLATE_CONTEXT_PROCESSORS`Then add an entry in your `urls.py` to include `themeswitch.urls`.In your templates after you `{% load themeswitch_tags %}` you have access to the template tags `{% get_available_themes as VARIABLENAME %}`and `{% render_selected_theme_css %}`. Place the `{% render_selected_theme_css %}` somewhere in your template's `<head>`.Now add an entry `THEMESWITCHER_THEMES` to your `settings.py`. `THEMESWITCHER_THEMES` should be a dictionary that contains mappings of `<theme_name>: <URL>`.The URLs must be absolute, but can exclude the host. Example:```pythonTHEMESWITCHER_THEMES = {'green': '/static/green.css'}```This would make `get_available_themes` return just one theme, named 'green'.Check out the [examples subdirectory](https://github.com/nschlemm/django-themeswitch/tree/master/examples).# LicenseCopyright (c) 2013-2014, Nikolaus SchlemmAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, thislist of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, thislist of conditions and the following disclaimer in the documentation and/orother materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: djangotheming
Django ThemingTheDjango Themingis a standalone theming solution for django sites. You
can use it customize the look and feel of any of your django site.OverviewDjango theming provides a way for django sites owners to customize the look
and feel of django sites without having to alter the code of the base site.InstallationInstall using pip:pipinstalldjangothemingUsageAdd'theming'to yourINSTALLED_APPS.INSTALLED_APPS=[...'theming',]Add'django.contrib.sites.middleware.CurrentSiteMiddleware','theming.middleware.CurrentRequestMiddleware'and'theming.middleware.CurrentThemeMiddleware'to yourMIDDLEWAREAddtheming.template.loaders.theme.Loaderto your'TEMPLATES['OPTIONS']['loaders']'TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','DIRS':[os.path.join(BASE_DIR,'templates')],'APP_DIRS':False,'OPTIONS':{'loaders':['theming.template.loaders.theme.Loader','django.template.loaders.app_directories.Loader',],'context_processors':['django.template.context_processors.debug','django.template.context_processors.request','django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages',],},},]Set'theming.static.storage.ThemeStorage'as your'STATICFILES_STORAGE'STATICFILES_STORAGE="theming.static.storage.ThemeStorage"Add'theming.static.finders.ThemeFilesFinder'to your'STATICFILES_FINDERS'STATICFILES_FINDERS=('theming.static.finders.ThemeFilesFinder','django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder',)Finally, Set the'THEMING'setting to something like.#  Theming settings.THEMING={'ENABLED':True,'DEFAULT':'<theme-name>','DIRS':[os.path.join(<absolute-path-to-themes-dir>)],}LicenseThe code in this repository is licensed under the GNU GENERAL PUBLIC LICENSE Version 3 unless otherwise noted.Please seeLICENSEfor details.How To ContributeContributions are very welcome.I will add info on how to contribute soon.Reporting Security IssuesPlease do not report security issues in public. Please emailsaleem_ee@hotmail.com.Change Log[0.1.0] - 2016-10-13First release on PyPI.Models and Django admin integration
Package: django-theming
Django application, implement theming concept, flexible and configurable. Allow theming for host url.InstallationYou can install the most recentDjango Themingversion using pip:pip install django-themingSetupNOTE: The following settings should be added to the project filesettings.py.Add ‘theming’ toINSTALLED_APPS:INSTALLED_APPS += ( 'theming', )Add ‘theming.middleware.ThemingMiddleware’ toMIDDLEWARE_CLASSES:MIDDLEWARE_CLASSES += ( 'theming.middleware.ThemingMiddleware', )Add ‘theming.loaders.ThemeLoader’ toTEMPLATE_LOADERS:TEMPLATE_LOADERS += ( 'theming.loaders.ThemeLoader', )DeclareTHEME_ROOTandMEDIA_ROOT:BASE_DIR = os.path.dirname(os.path.dirname(__file__))

THEME_ROOT = os.path.join(BASE_DIR, 'themes')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')DeclareMEDIA_URL:MEDIA_URL = '/media/'DeclareTHEME_MEDIA_ROOTyTHEME_MEDIA_URL:THEME_MEDIA_ROOT = os.path.join(MEDIA_ROOT, 'themes')
THEME_MEDIA_URL = os.path.join(MEDIA_URL, 'themes')Declare host/theme config tupleTHEME_CONFIG:THEME_CONFIG = (
    (r'^(.+\.)?dominio\.pe', 'default'),
    (r'^(.+\.)?test\.pe', 'test'),
)UsageIt should create a folderthemesat the project with the following structure:project_django/
| -- themes/
    | -- default/  ** theme name
        | -- templates/
        | -- media/
        |   | -- styles/
        |   | -- scripts/
        |   | -- images/
        | -- metadata.jsonNOTE: We usemediainstead ofstaticfor independent assets by theme.In the filemetadata.jsonit should include information on the theme:{
    "slug": "default",
    "name": "Default",
    "description": "Theme Default",
    "author": "Author",
    "version": "1.0"
}You can use the template tagthemeto refer to the theme assets as follows:<link rel="stylesheet" href="{% theme 'styles/main.css' %}" />NOTE: The tamplate tagthemewill refer to themedia/themes/<theme_name>folder, if not find the file in that path, it will search instatic/You can use the commandcollectthemesto copy all assets of the theme to the locationmedia/:python manage.py collectthemes

options:
- l, --link : Create a symbolic link to each file instead of copying.
- f, --force: Force to overwrite content.ContributingDevelopment ofdjango-theminghappens at github:https://github.com/achavezu89/django-themingCreditsAndres Chavez:https://github.com/achavezu89Giorgio Leveroni:https://github.com/ppoldAntonio Ognio:https://github.com/gnrfanAntonio Kobashikawa:https://github.com/akobashikawa
Package: django-thermostat
Cronothermostat developed as a Django app. It belongs to the Python Home Automation ProjectDjango Home Automation is a set of Django apps which provides a REST API meant to
control home automation devices. It also provides a modular framework for
developing home automation drivers to enable more protocolos to be drived by this project.It relies on the hautomation_restclient module to send domotic commands to the serverFurther documentation found athttp://jpardobl.com/home-automation-python-project/
Package: django-thjodskra
django-thjodskra================django-thjodskra is a simple app for integrating the icelandic national registry into your project.You still need to aquire the data files through the proper channel. This project only contains django models and functions for dealing with the archaic fileformat provided by the registry distributors.###Installation:pip install django-thjodskra###Usage:thjodskra.models.Person corresponds to rows in the national registry.python manage.py import_entitiesThis should only be used for the initial import of registry data, i.e. when you have an empty DB and a big text file containing the complete registry.python manage.py fetch_updateFetches update file via FTP, this file can then be used with update_peopleRequires django settings:THJODSKRA = {'host': [Address of your update provider],'username': [FTP Username],'password': [FTP Password],'file': [Path and name of update file to fetch]}python manage.py update_entities [filename]Imports people that have not yet been added to local database and updates the info of those who have.This can then be added to any script or cronjob as needed.
Package: django-thjwt
thapi is a simple app to connect to th-ciloud platform applcationsdetauk documentation is in the “docs” directoryQuick startAdd “thjwt” to your INSTALLED_APPS setting like this:INSTALL_APPS = [
    ...
    'thjwt',
]Include the thapi URLconf in your project urls.py like this:url(r'^thjwt/',include('thjwt.urls')),Runpython manage.py migrateto create thapi modelsStart the development server and visithttp://127.0.0.1:8000/admin/to create a thapi (you’ll need the Admin app enabled).Vistihttp://127.0.0.1:8000/thjwt/to participate int he thapi
Package: django-thorbanks
django-thorbanksDjango app for integrating Estonian banklinks into your project.FeaturesBankProtocolAuthenticationPaymentSwedbankiPizza:heavy_check_mark::heavy_check_mark:SEBiPizza:heavy_check_mark::heavy_check_mark:DanskeiPizza:heavy_check_mark::heavy_check_mark:LHViPizza:heavy_check_mark::heavy_check_mark:KrediidipankiPizza:heavy_check_mark::heavy_check_mark:NordeaiPizza:heavy_check_mark::heavy_check_mark:Usage1. Install it:Pip:pipinstalldjango-thorbanksPipenv:pipenvinstalldjango-thorbanksPoetry:poetryadddjango-thorbanks2. Add to installed appsINSTALLED_APPS=(# Add the following apps:"thorbanks","thorbanks_models",)3. Configure and create migrations:With MANUAL_MODELS:Remove"thorbanks_models"fromINSTALLED_APPSfollow instructions fromthorbanks.settings.get_model.With default models:Make django aware that thorbanks migrations are in your local apps folder via settings.MIGRATION_MODULES:Note: Replaceshopwith the name of an existing app in your project.# Tell django that thorbanks_models migrations are in shop app (in thorbanks_migrations module)MIGRATION_MODULES={"thorbanks_models":"shop.thorbanks_migrations"}Now runmakemigrations thorbanks_modelsandmigratemanagement commands to create and apply the migrations.4. Add settings.BANKLINKSFor a working example see the definitions inexample/settings.py.Note:
You will need a public and private key for each bank integration.
In case you don't have the public key, you can generate one out of a certificate by:openssl x509 -pubkey -noout -in cert.pem  > pubkey.pem5. Link Transaction to your Order modelNote: When using MANUAL_MODELS replacethorbanks_modelswith your local app nameclassOrder(models.Model):# ... other fieldstransaction=models.OneToOneField("thorbanks_models.Transaction",null=True,on_delete=models.SET_NULL)6. Include thorbanks urlsurlpatterns=[# This is where the user will be redirected after returning from the banklink pageurl(r"^banks/",include("thorbanks.urls")),]7. Add listeners to banklinks success & failure callbacks:Seeexample.shop.models.banklink_success_callbackandexample.shop.models.banklink_failed_callback.8. Create views and forms for payments:seeexample.shop.viewsandexample.shop.forms.iPizza protocolTest serviceSwedbankSpecSEBLHV Bank
Package: django-thread
Helpers for using Django from threadsWhen handling requests djangomanages database connection lifecycles for
you.  By default closing them after each request or keeping
them alive allowing re-use for a specified amount of time whenCONN_MAX_AGEis set so long as no errors are encountered.Sometimes you want to do work outside of a web request. When the work is large and you would like to distribute it, likely to places other than where the web requests are
served, there are systems likeCelery.  There are other cases though were you're just trying
to do work outside of the request & response cycle even and it's lightweight enough that running a full-blown job queuing system and it's associated data store is too
involved.  You just wantThreads or even better aThreadPoolExecutor.If you just jump straight in and use either of those you'll run into slow to manifest and tough to track down problems with broken database connections.  This is because
Django automatically opens a connection per-thread when a database is accessed and leaves them lying around in that thread indefinitely.  This results in errors when the
database has timed out the connection or it has otherwise encountered problems.django_threadprovides a this problem by implementing aThreadclass that mimics Django's request connection handling and provides aThreadPoolExecutorthat does so
around the invocations of submitted calls.UsageThreaddjango_thread.Threadis a 100% drop-in replacement forthreading.Thread.  Seethreading.Threadfor
usage and documentation.fromdjango_threadimportThreadclassExampleThread(Thread):defrun(self):forsome_modelinSomeModel.objects.filter(...):...thread=ExampleThread()thread.start()# do other thingsthread.join()ThreadPoolExecutordjango_thread.ThreadPoolExecutoris a 100% drop-in replacement forconcurrent.futures.ThreadPoolExecutor.  Seeconcurrent.futures.ThreadPoolExecutorfor usage and documentation.fromconcurrent.futuresimportas_completedfromdjango_threadimportThreadPoolExecutordefupdate_or_create_thing(name):thing,_=Thing.objects.update_or_create(name=name)returnthing.idexecutor=ThreadPoolExecutor()futures=[]foriinrange(5):future=executor.submit(update_or_create_thing,f'Name i')futures.append(future)ids=[f.result()forfinfutures]
Package: django-threaded-messages
===============Django-Threaded-Messages===============This app is very similar to the Messaging System on Facebook.There are tests, but they are from the project I forked it from. I will update and improve them once I get around to it.Features===============* Each Message is a thread with participants and messages* Inbox with filter for read and unread messages* Outbox* Fulltext search support using Haystack* Users are notified using django-notification when new messages arrive* Batch update to set messages to read/unread/delete* Ajax posting of messages within thread* Can be used with jquery.tokeninput to offer a similar usuability as Facebook when it comes to selecting recipients.* Installable using pip and easy_install* Modular message sending using faceboxUser Search===============The app comes with a very basic user search component. If you want to extend it or adapt it to your needslook at views.recipient_search. Adapt your own version in a seperate app and thenchange the call in your compose templates::$("#id_recipient").tokenInput("{% url recipient_search %}?format=json", parameters)to point to your custom view.Dependencies===============* Haystack* Django-notification* django-avatar* django-pagination* django-uni-formInstall===============pip install -e http://github.com/philippWassibauer/django-threaded-messages.git#egg=threaded-messagesorpip install django-threaded-messagesSimilar Projects===============There are two other repositories doing this (one of them is not maintained anymore):https://github.com/typeish/django-threaded-messagesI am not sure what the exact differences are to this implementation. I am pretty certain that they don't include read/unread, fulltext search, pip install etc.Follow Me===============http://github.com/philippWassibauerhttp://twitter.com/__philw__http://philippw.tumblr.comhttps://bitbucket.org/philippwassibauer
Package: django-threaded-sync-to-async
django_threaded_sync_to_asyncTools for replacingsync_to_asynccalls tosync_to_async(thread_sensitive=False, executor=...), effectively allowing Django to make calls to database concurrently.pip3 install django_threaded_sync_to_asyncExecutorimportdjango_threaded_sync_to_asyncasyncwithdjango_threaded_sync_to_async.Executor(thread_name_prefix="thread",max_workers=3)asexecutor:a=asgiref.sync.sync_to_async(long_call)(1)b=asgiref.sync.sync_to_async(long_call)(2)c=asgiref.sync.sync_to_async(long_call)(3)d=asgiref.sync.sync_to_async(long_call)(4)awaitasyncio.gather(a,b,c,d)SharedExecutorMaintains global dictionary of executors (concurrent.futures.ThreadPoolExecutor) accessed by name and allows to limit utilization of executor for a single context.importdjango_threaded_sync_to_async@django_threaded_sync_to_async.SharedExecutor("common",max_workers=3,max_tasks=2)asyncdefoperations():a=asgiref.sync.sync_to_async(long_call)(1)b=asgiref.sync.sync_to_async(long_call)(2)c=asgiref.sync.sync_to_async(long_call)(3)d=asgiref.sync.sync_to_async(long_call)(4)awaitasyncio.gather(a,b,c,d)