Skip to main content

Django Multiple Domain

Django middleware for serving single Django instance in multiple domains with different urls.

Installation

ost recent Django Multiple Domain version using pip:

pip install django-multiple-domains

Setup

NOTE: The following settings should be added to the project file ‘settings.py’.

  1. Add ‘multipledomain’ to ‘’INSTALLED_APPS’’:

    INSTALLED_APPS += ( 'multipledomain', )
  2. Add ‘multipledomain.middleware.MultipleDomainMiddleware’ to ‘’MIDDLEWARE_CLASSES’’:

    MIDDLEWARE_CLASSES += ( 'multipledomain.middleware.MultipleDomainMiddleware', )
  3. 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'),
  4. 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

Metadata

Release files for django-multiple-domains 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-multiple-domains 0.0.1
File Size Uploaded Provenance Actions
django-multiple-domains-0.0.1.tar.gz 2.1 kB Without provenance Details for django-multiple-domains-0.0.1.tar.gz

Release files / django-multiple-domains-0.0.1.tar.gz

Download URL django-multiple-domains-0.0.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3cc41ca52101d465aa1f3c17db5b32adae7c0a9f3b2b041c551ceb6907136fa1
BLAKE2b-256 checksum
How to use checksums
82bffb2675c8ecf5c7810159aec0ea03170e5610f856c65029b670ab84afa55c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-multiple-domains 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page