Skip to main content

Lightweight django subdomains handler

Project description

=====
Django Lightweight Subdomains Handler
=====

This is a very short Django Middleware to handle each subdomains
with a specific URLconf file.

Example
-------

If you want to have something like::

api.example.org

with a specific URLconf file for each of your subdomains

This what you're looking for!

Quick start
-----------

1. Add this on top of your MIDDLEWARE_CLASSES setting like this::

MIDDLEWARE_CLASSES = (
'lightsub.middleware.SubDomainMiddleware',
...
)

2. Add the SUBDOMAINS_URLCONF dict to your setting project file::

SUBDOMAINS_URLCONF = {
'api': 'api.urls',
}

Where 'api.urls' is your Django-app 'api' and urls is your urls.py module

3. Run your Django project and try to reach api.example.org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-subdomains-handler-0.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file django-subdomains-handler-0.2.tar.gz.

File metadata

File hashes

Hashes for django-subdomains-handler-0.2.tar.gz
Algorithm Hash digest
SHA256 740de9a912bf123c8abdbcba2a6a013e1cc85ab89de3a455e7b1d73e4e13f47c
MD5 d5c399e0ce3661ae9a684c34970e2008
BLAKE2b-256 59b9bd01b8e23545757d441e18356e678c33470153e2166efbaa1c32be0555fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page