Saravanan666/pypi-org huggingface dataset:
Package: django-multiple-authentication
Django Multiple Authentication allows you to use either email or username field or any other
field on your user model for your user authentication.Source codehttps://github.com/KoredeDavid/django-multiple-authentication/Documentationhttps://django-multiple-authentication.readthedocs.io/en/latest/RationaleDjango’s default authentication only accepts username for user authentication.
So the package allows you to use either email or username or any other stuff on your user table for user authentication.
It works with django’s in-built authentication function, so
it works as long as django’s authentication function is called.RequirementsPython >= 3.6Django (3.0, 3.1, 3.2, 4.0, 4.1)These are the officially supported python and django package versions.  Other versions
will probably work.InstallationDjango Multiple Authentication can be installed with pip:pip install django
pip install django-multiple-authenticationProject ConfigurationAddmultiple_authto your list ofINSTALLED_APPSin yoursettings.py:INSTALLED_APPS=[..."multiple_auth",]Now we tell django whatAUTHENTICATION_BACKENDSwe want to use for user authentication.
Update yoursettings.pywith this:AUTHENTICATION_BACKENDS=('multiple_auth.backends.MultipleAuthentication',)Usage & IllustrationStartup up a new project like this if you haven’tdjango-admin startproject sampleproject

cd sampleproject

python manage.py makemigrations

python manage.py migrateCreate a superuserpython manage.py createsuperuser --username=test --email=test@email.comIt will bring a prompt to setpassword. So just set your password and you’re done creating a user.Now we tell django whatAUTHENTICATION_BACKENDSwe want to use for user authentication.
Update yoursettings.pywith this:AUTHENTICATION_BACKENDS=('multiple_auth.backends.MultipleAuthentication',)AddMULTIPLE_AUTHsettings (a dictionary) to your settings.py. Include a key ofauth_fieldsa value of the list of
field(s) in your User Model you want to accept for your authentication.You can use one or more fields. For illustration,
we will be using theusernameandemailfields. So update your settings like this:MULTIPLE_AUTH={'auth_fields':['username','email']}You can test it with your login page or your API. It works also on the django-admin panel.Note that the theauth_fieldsis not just limited two fields you can have one, two or more fields.One Field:MULTIPLE_AUTH={'auth_fields':['id']}Two OR More fieldsMULTIPLE_AUTH={'auth_fields':['email','username','phone_number','id',...]}Here’s a GIF showing a user logging in with his ``email``, ``username`` and ``id``.NOTEIt also works withDjango AdminandREST APIs!!!
Package: django-multiple-domain
# django-multiple-domainApp for multi domain in django. Python2.x, Python3.x, Django>=1.4Add request.host with subdomain value or NoneQuick start-----------1. Add "multidomain" to your INSTALLED_APPS setting like this:```INSTALLED_APPS = (...'multidomain',)```2. Include the 'multidomain.middleware.GetDomainMiddleware' MIDDLEWARE in your project settings.py like this:```MIDDLEWARE = [...'multidomain.middleware.GetDomainMiddleware',]```3. Run `python manage.py migrate` to create the multidomain models.In request object add two objects:* request.domain - Domain model from request objects or None* request.get_domain(request, reverse_url=None, *args, **kwargs) - Function by get domain.* request - required argument* reverse_lazy = optional. String format for reverse_lazy django function.* args, kwargs - optional arguments, for reverse_lazy.TODO:1) Localization2) Many-Level domain3) Docs4) ...
Package: django-multiple-domains
Django middleware for serving single Django instance in multiple domains with different urls.Installationost recentDjango Multiple Domainversion using pip:pip install django-multiple-domainsSetupNOTE: The following settings should be added to the project file ‘settings.py’.Add ‘multipledomain’ to ‘’INSTALLED_APPS’’:INSTALLED_APPS += ( 'multipledomain', )Add ‘multipledomain.middleware.MultipleDomainMiddleware’ to ‘’MIDDLEWARE_CLASSES’’:MIDDLEWARE_CLASSES += ( 'multipledomain.middleware.MultipleDomainMiddleware', )Create different urls config file for each domain (Ex: ‘site.com’ and ‘blog.com’):* urls_site.py   (by default)
    url(r'^$', TemplateView.as_view(template_name='site.html'), name='site'),

* urls_blog.py
    url(r'^$', TemplateView.as_view(template_name='blog.html'), name='blog'),Declare host/domain urlconfig tuple ‘’MULTIURL_CONFIG’’:MULTIURL_CONFIG = {
    'site.com': 'urls_site',
    'blog.com': 'urls_blog',
}

ROOT_URLCONF = 'urls_site'Related urls:https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_host
Package: django-multiple-email-backends
An easy solution to send your email to more than one backend, e.g. if you want to send it to the user via SMTP but also log it to keep the record of send’ emails.UsageThis example.py will output your emails to the console and save it in a folder on your filesystem. You could ofcourse combine this as you want, e.g. the SMTP backend and the filebackend.EMAIL_BACKEND = "django_multiple_email_backends.backend.CombinedEmailBackend"
EMAIL_BACKEND_LIST = ['django.core.mail.backends.console.EmailBackend',
                      'django.core.mail.backends.filebased.EmailBackend']LicenseBSD
Package: django-multipleformwizard
An extension to the official Django form wizard supporting multiple forms on a wizard step.DocumentationThe full documentation is athttps://django-multipleformwizard.readthedocs.org.QuickstartInstall django-multipleformwizard:pip install django-multipleformwizardThen use it in a project:# Every *WizardView that can be imported is an equivalent of a builtin *WizardView in Django
from multipleformwizard import (SessionMultipleFormWizardView, CookieMultipleFormWizardView,
                                NamedUrlSessionMultipleFormWizardView, NamedUrlCookieMultipleFormWizardView,
                                MultipleFormWizardView, NamedUrlMultipleFormWizardView)Example usefrom__future__importunicode_literalsfromdjangoimportformsfromdjango.shortcutsimportrender_to_responsefrommultipleformwizardimportSessionMultipleFormWizardViewfrom.formsimportForm1,Form2,Form3classWizard(SessionMultipleFormWizardView):form_list=[("start",Form1),("user_info",(('account',Form2),('address',Form3))]templates={"start":'demo/wizard-start.html',"user_info":'demo/wizard-user_info.html'}defget_template_names(self):return[self.templates[self.steps.current]]defdone(self,form_dict,**kwargs):result={}forkeyinform_dict:form_collection=form_dict[key]ifisinstance(form_collection,forms.Form):result[key]=form_collection.cleaned_dataelifisinstance(form_collection,dict):result[key]={}forsubkeyinform_collection:result[key][subkey]=form_collection[subkey].cleaned_datareturnrender_to_response('demo/wizard-end.html',{'form_data':result,})History0.2.16 (2015-04-28)Bugfix.0.2.15 (2015-04-24)Bugfix.0.2.14 (2015-04-23)Added Django Formtools as a dependency, to be compatible with Django >= 1.8.0.2.13 (2015-03-24)Bugfix.0.2.12 (2015-03-17)Bugfix.0.2.11 (2015-03-17)Bugfixes and refactored lazy form list initialization.0.2.10 (2015-03-16)Bugfix.0.2.9 (2015-03-16)Extended interface with possibility to load form_list lazily.0.2.8 (2015-03-09)Bugfix.0.2.7 (2015-03-05)Extended interface with optional setting to expose cleaned_data of previous to the context of the current step.0.2.6 (2015-03-05)Bugfix.0.2.5 (2015-03-05)Extended interface with convenience method: get_all_cleaned_data_dict().0.2.4 (2015-03-05)Bugfixes.0.2.3 (2015-03-04)Updated meta info.0.2.2 (2015-03-03)Updated documentation.0.2.1 (2015-03-03)Updated documentation.0.2.0 (2015-03-03)Included documentation.0.1.9 (2015-03-03)Various bugfixes.0.1.7 (2015-03-02)First stable release on PyPI.
Package: django-multipleimageinput
Django MultipleImageInputWidget for multiple image fields. Works good with PostgreSQL array fields.ExampleIn this example i usecrispy_formssettings.pyimportpathlibimportosBASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))MEDIA_URL='/media/'MEDIA_ROOT=pathlib.Path(BASE_DIR)/'common'/'media'model.pyfromdjango.contrib.postgres.fieldsimportArrayFieldfromdjango.dbimportmodelsclassProduct(models.Model):classMeta:db_table='product'verbose_name='товар'verbose_name_plural='товары'IMAGE_PATH='common/image/product'title=models.TextField('заголовок',null=True,blank=True)description=models.TextField('описание',null=True,blank=True)price=models.IntegerField('цена')youtube_url=models.URLField('видео youtube',null=True,blank=True)image_list=ArrayField(models.TextField("картинки"),default=list,verbose_name='картинки',blank=True)view.pyfromsettingsimportMEDIA_ROOTfrommodelsimportProductimportdjango_multipleimageinputclassUploadImageView(django_multipleimageinput.UploadImageView):media_root=MEDIA_ROOTimage_path=Product.IMAGE_PATHforms.pyfromdjangoimportformsfrommodelsimportProductfromdjango_multipleimageinputimportMultipleImageInputfromdjango.urlsimportreverse_lazyfromcrispy_forms.helperimportFormHelperfromcrispy_forms.layoutimportButtonHolder,Submit,LayoutclassProductForm(forms.ModelForm):classMeta:model=Productfields=["title","description","price","youtube_url","image_list"]widgets={"title":forms.TextInput(),"description":forms.Textarea(attrs={'rows':4,'cols':15}),"image_list":MultipleImageInput(reverse_lazy('common:product/upload-image'),MEDIA_URL)}def__init__(self,*args,**kwargs):self.helper=FormHelper()self.helper.layout=Layout('title','description','price','youtube_url','image_list',ButtonHolder(Submit('submit','Сохранить')))super(ProductForm,self).__init__(*args,**kwargs)urls.pyfromdjango.urlsimportpathfromdjango.conf.urls.staticimportstaticassttcimportviewsimportsettingsapp_name='common'urlpatterns=[path('product/upload-image',views.UploadImageView.as_view(),name='product/upload-image'),]+sttc(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
Package: django-multiple-include
A version of{% include %}that accepts multiple template names.UsageAddmultiple_includetoINSTALLED_APPS.Then, in your template:{% load multiple_include %}

{% multiple_include "template1.html" "template2.html" "template2.html" with object=item %}The templatetag will include the first existing template from the list. This allows more interesting uses as:{% load multiple_include %}

{% with "story_"|add:object.category_slug|add:".html" as category_template %}
{% multiple_include category_template "news/story_default.html" %}
{% endwith %}Note: For a cleaner string concatenation, you can use thecapturetag shipped withDjango Basic Apps:In your settings:INSTALLED_APPS += ('basic.tools')Template:{% load multiple_include capture %}

{% capture as category_template %}
    story_{{ object.category_slug}}.html
{% endcapture %}

{% multiple_include category_template "news/story_default.html" %}
Package: django-multipleselectionfield
django-multipleselectionfieldA new model and form field. With this you can get a multiple select from a choicesInitial code got fromhttps://github.com/goinnn/django-multiselectfieldby Pablo MartinBut after more than 2 years without activity and no fork taking the control of it, it may be time
to move on. Here is an attempt of a small renaming (to avoid name conflicts in packages),
and including the improvements of most of the existing forks.The LPGL v3 licence is preserved.Originally, this egg is inspired by this [snippet](<http://djangosnippets.org/snippets/1200/)InstallationIn your models.pyfrom multipleselectionfield import MultipleSelectionField

...

MY_CHOICES = (('item_key1', 'Item title 1.1'),
              ('item_key2', 'Item title 1.2'),
              ('item_key3', 'Item title 1.3'),
              ('item_key4', 'Item title 1.4'),
              ('item_key5', 'Item title 1.5'))

MY_CHOICES2 = ((1, 'Item title 2.1'),
               (2, 'Item title 2.2'),
               (3, 'Item title 2.3'),
               (4, 'Item title 2.4'),
               (5, 'Item title 2.5'))

class MyModel(models.Model):

    .....

    my_field = MultipleSelectionField(choices=MY_CHOICES)
    my_field2 = MultipleSelectionField(choices=MY_CHOICES2,
                                 max_choices=3,
                                 max_length=3)In your settings.pyOnly you need it, if you want the translation of django-multipleselectionfieldINSTALLED_APPS = (
    #...
    'multipleselectionfield',
    #...        
)Example projectIn the source tree, you will find a directory calledexampleIt contains a readily setup project that uses django-multipleselectionfield. You can run it as usual:python manage.py migrate --noinput
python manage.py loaddata app_data
python manage.py runserver1.1.0 (2022-10-06)Drop support Python 2Drop support Django 3 (use v1.0.0)Added support Django 41.0.0 (2019-05-19)Make the project work again0.9.0 (2016-09-06)Initial import fromhttps://github.com/goinnn/django-multiselectfieldcommit c232d1776c95abd20d1eacbf33c68bd6bad73bbaSupport for Django 1.10
Package: django-multisafepay
django-multisafepayPayment gateway integration forMultiSafepay.
MultiSafepay is a large payment gateway based in The Netherlands that supports many international payment methods.MultiSafepay offers two methods for payments, seehttps://www.multisafepay.com/en/Payment-services/:Fast checkoutrequires customers to create a MultiSafePay account.
You only have to pay a transaction fee, but the account system is not very user-friendly.Connectprovides direct payments.
As a merchant, you have to pay a monthly subscription.InstallationInstall via pip:pip install django-multisafepayConfigurationIn the MultiSafepay merchantsite settings,
add a new website. Use those settings to configure the application:MULTISAFEPAY_ACCOUNT_IDThe account ID, provided by MultiSafepay.MULTISAFEPAY_SITE_IDThe site ID, found in the MultiSafepay website settings panel.MULTISAFEPAY_SITE_CODEThe site security code, found in the MultiSafepay website settings panel.MULTISAFEPAY_TESTINGWhether or not to run in testing mode. Defaults toTrue.Add tourls.py:urlpatterns += patterns('',
    url(r'^api/multisafepay/', include('django_multisafepay.urls')),
)As recommendation, temporary log all events from this package as well:LOGGING = {
    # ...

    'handlers': {
        # ...

        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
        },
    },
    'loggers': {
        # ...

        'django_multisafepay': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}UsageCreating a new payment transaction:from django_multisafepay.client import MultiSafepayClient
from django_multisafepay.data import Transaction, Customer
from django.shortcuts import redirect

def pay(request):

    client = MultiSafepayClient()
    reply = client.start_checkout(
        transaction = Transaction(

        ),
        customer = Customer(

        )
    )

    return redirect(reply.payment_url)For the Fast Checkout, use thestart_checkout()method.For the Connect method, use theredirect_transaction()method.Both methods return an URL to redirect the user to.Fetching status:client = MultiSafepayClient()
statusreply = client.status(self.transaction_id)TODOIntegrate nicely indjango-merchantordjango-getpaid.Not all XML features are implemented, e.g.:checkout-shopping-cartcustom-fieldsshippingiDEAL issuers request (simple to add)
Package: django-multiseek
[![Build Status](https://github.com/mpasternak/django-multiseek/actions/workflows/tests.yml/badge.svg)](https://github.com/mpasternak/django-multiseek/actions)
[![Coverage Status](https://coveralls.io/repos/github/mpasternak/django-multiseek/badge.svg?branch=master)](https://coveralls.io/github/mpasternak/django-multiseek?branch=master)
[![PyPI version](https://badge.fury.io/py/django-multiseek.svg)](https://badge.fury.io/py/django-multiseek)Graphical query builder for Django. Uses Foundation 6.Depends on:
* Django
* django-autocomplete-light
* Foundation 6Supported configurations:
* Django 3.2
* Python 3.8, 3.9, 3.10django-multiseek’s purpose is to enable end-user of the web page to build a query form and query the database using multiple parameters.Launch the demo, then look for a book called “A book with a title” written by John Smith.To run the demotest_projectdemo uses yarn to handle javascript dependencies, so:mkvirtualenv django-multiseek
pip install -r requirements_dev.txtcd test_project
export PYTHONPATH=..:$PYTHONPATH
export DJANGO_SETTINGS_MODULE=test_project.settingsyarn
python manage.py collectstatic –noinput -v0python manage.py migrate
python manage.py initial_data
python manage.py runserver
Package: django-multi-sessions
Multiple backends for your sessions!Designed for moving sessions from one session engine to another, without stopping the current sessions. It consistently passes backends in the list (settings.SESSION_MULTISESSIONS_POOL) and depending on the modes of doing the necessary.For more information see:http://adw0rd.com/2012/django-multi-sessions/en/- article about it in Englishhttp://adw0rd.com/2012/django-multi-sessions/en/- article about it in Russianhttp://pypi.python.org/pypi/django-multi-sessions- the PyPI pagehttps://github.com/adw0rd/django-multi-sessions- the GitHub repositoryInstallation1. Download the archive and runpython setup.py installorpip installdjango-multi-sessions2. Setmulti_sessions.sessionas your session engine, like so:SESSION_ENGINE = "multi_sessions.session"3. Example settings:SESSION_MULTISESSIONS_POOL = (
    {"backend": "redis_sessions.session", "modes": ["read", "write"]},
    {"backend": "django.contrib.sessions.backends.db", "modes": ["read", "delete"]},
)4. Available modes:“read”   - Allows launch “load” method;“write”  - Allows launch “save” and “create” method;“delete” - Allows launch the “delete” method.
Package: django-multi-tenancy
django
多租户方案实现方案，本插件的是在数据库层对租户数据进行了隔离，保证每个租户只能访问自己的数据库信息，完整兼容django所有功能安装pipinstalldjango-multi-tenancy兼容性django >= 3.2其他django版本未测试，不保证兼容性配置INSTALLED_APPS=['multi_tenant.tenant','django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',...'multi_tenant.proxy',#  rest_framework 需要加载rest app'multi_tenant.rest']MIDDLEWARE=['django.middleware.security.SecurityMiddleware','django.contrib.sessions.middleware.SessionMiddleware','corsheaders.middleware.CorsMiddleware','django.middleware.common.CommonMiddleware','django.middleware.csrf.CsrfViewMiddleware',# 需要注释调官方自带的AuthenticationMiddleware，采用插件的MultTenantAuthenticationMiddleware# 'django.contrib.auth.middleware.AuthenticationMiddleware','multi_tenant.tenant.middleware.authentication.MultTenantAuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','django.middleware.clickjacking.XFrameOptionsMiddleware',]# AUTH_USER_MODEL 全局用户模型,必须指定AUTH_USER_MODEL='tenant.GlobalUser'# 租户用户模型,不指定默认为：'auth.User'AUTH_TENANT_USER_MODEL='info.User'# 租户模型,不指定默认为：'tenant.Tenant'DEFAULT_TENANT_MODEL='tenant.Tenant'## 数据库映射，这里只需要定义共用的appDATABASE_APPS_MAPPING={'tenant':'default','admin':'default','sessions':'default'}## 数据库映射路由DATABASE_ROUTERS=['multi_tenant.tenant.utils.db.MultTenantDBRouter']主要模块说明以及使用数据库模块默认default数据库为主数据库,只保存公共模块数据，租户数据库可以动态创建，创建一个租户，会自动在数据库中创建了一个对应租户的数据库，所有租户的数据库结构相同可以在DATABASE_APPS_MAPPING中指定某个app属于公共app,还是租户app,公共app默认数据库链接为defaultmulti_tenant.tenant多租户模块Tenant为租户模型，当然你可以继承AbstractTenant来自定义自己的租户模块，并在settings中指定DEFAULT_TENANT_MODEL常量来指定租户模型GlobalUser为全局用户，不分数据哪个租户，这里用GlobalUser替代了django.contrib.auth.models.User模块，因此django.contrib.auth.get_user_model获取的是GlobalUser对象，相应的request.user也是GlobalUser对象，用户可以被加入租户，也可以选择不加入租户，加入租户的用户只能访问相应租户数据，不加入租户的用户如果是超级管理员可以访问全局用户和租户信息租户用户表默认采用django.contrib.auth.models.User,当然你可以选择继承django.contrib.auth.models.AbstractUser来自定义自己的租户用户模块，并在settings中指定AUTH_TENANT_USER_MODEL常量来指定租户用户，用户可以在租户层面完整的使用django.contrib.auth所有功能，包括User、Group、Permission、Admin可以登录Admin
后台创建租户，也可以使用createtenant命令行来创建租户multi_tenant.proxy代理模块ProxyContentTypecontentType代理，因为在多租户模型中，主数据库和租户数据库数据模型不一样，在不断的迭代更新中，新的租户和老的租户模型ContentType数据信息也不一样，django默认自带的ContentType模型默认自带缓存，ProxyContentType模型无缓存，每次的数据访问都是直接访问数据库，这样避免了ContentType信息不一致导致的异常multi_tenant.restrest_framework适配模块对rest_framework进行了适配,保证租户只能访问自己的租户的数据提供了一个IsTanenatUser权限类，判断是不是租户用户适配了rest_framework的内置权限IsAdminUser、DjangoModelPermissions、DjangoModelPermissionsOrAnonReadOnly、DjangoObjectPermissionsmigrate模块迁移租户数据库，请给migrate指定--database参数值,--database也可以使用‘multimigrate’,必须指定--database参数值，或者直接使用--all,来迁移所有租户表结构支持的数据库适配了支持django所有支持的数据库（SQLite3、MySQL、Posgres、Oracle）例子可以参考examples的使用
Package: django-multitenancy-manager
django-multitenancyDjango Multitenancy is a Django app that handles user subscriptions for saas multi tenant apps.
The aim of this project is to speed up the process of launch your saas app.:warning: This package is still in its alpha stage and is not ready for productionRequirementsPython 3.6+Django 3.0+InstallationClone the repository:git clone git@github.com:tekanokhambane/django-multitenancy.git🔥 FeaturesManage Customers and TeamsHelpdesk, Ticket systemCreate and manage templatesAutomated subscriptions and billing systemsAdmin, Staff and Client dashboardCustomizable pricing plansManage subscriptions - Activate, suspend, deactivate subscriptionRuns on a Raspberry Pi or a multi-datacenter cloud platformDomain managementUse for any Saas App
Package: djangomultitenant
## Django Multitenant ##This app can be used to implement multitenant architecture within your django project very easily.Inorder to install the app```pip install djangomultitenant```Modify the project settings file as shown below```DATABASES = {'default': {},# DB for tenant 1'akhil': {'ENGINE': 'django.db.backends.sqlite3','NAME': os.path.join(BASE_DIR, 'akhil.sqlite3'),},# DB for tenant 2'nikhil': {'ENGINE': 'django.db.backends.sqlite3','NAME': os.path.join(BASE_DIR, 'nikhil.sqlite3'),}}INSTALLED_APPS = ['djangomultitenant',]DATABASE_ROUTERS = ['djangomultitenant.Router',]MIDDLEWARE = ['djangomultitenant.Middleware',  # this has to be the first one]```Use the TENANT-CODE header in all your requests to the django project. You can use [requestly](https://chrome.google.com/webstore/detail/requestly/mdnleldcmiljblolnjhpnblkcekpdkpa?hl=en) to send the headers while accessing project. In the production environment, these headers can be configured in the webservers.```TENANT-CODE: akhil```Tada !!! You are all equipped with multitenancy !!!Note: migrations and management commands are not handled by this app. so please dont forget to use --database
Package: django-multi-tenants
django-multi-tenantThis project is based ondjango-tenant-schemas.readthedocs.io. All our thanks to its creators.This is a customisation we need in order to have details of the tenants' applications.There are three variables that we need to declare in thesettings.pyfile to describe the application schema:SHARED_APPSdescribe the applications whose migration is carried out in the public scheme.TENANT_APPSdescribe the applications whose migration is carried out in the main tenant scheme.TENANT_DETAIL_APPSdescribe the applications whose migration is carried out in the detailed
tenant scheme. The detailed tenant scheme is associated with a single main tenant.
For example, if you want to separate information between years, such as accounting software.