Skip to content

tpetr/django-simpledomains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

django-simpledomains

An easy way to support multiple domains in your Django app.

Getting Started

  • Add simpledomains to your PYTHONPATH
  • Add simpledomains.middleware.DomainMiddleware to the MIDDLEWARE_CLASSES list in settings.py:
MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    ...
    'simpledomains.middleware.DomainMiddleware',
)
  • Create a domain --> urlconf mapping dict named DOMAIN_URLCONFS in settings.py:
DOMAIN_URLCONFS = {
    r'test.domain.com': 'myapp.urls',
    r'(?P<user>\w+).domain.com': 'myall.urls_userpage',
}

Note: Requests that match nothing will default to the ROOT_URLCONF setting. If you specify capture groups in your domain regex, they'll be accessible via request.domain_groupdict

About

Simple multi-domain support for Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages