Skip to content

Commit

Permalink
Update README to document development mode
Browse files Browse the repository at this point in the history
see #5
  • Loading branch information
Becky Smith committed Apr 19, 2018
1 parent 3596326 commit 97190c6
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ Add to your settings.py TEMPLATES loaders in the OPTIONS section::
...
]

Or for Django 1.7 and earlier, add to settings.py TEMPLATES_LOADERS::
Or for Django <= 1.7, add to settings.py TEMPLATES_LOADERS::

TEMPLATE_LOADERS = (
'multisite.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)

Edit settings.py MIDDLEWARE_CLASSES::
Edit settings.py MIDDLEWARE (MIDDLEWARE_CLASSES for Django < 1.0)::

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
...
'multisite.middleware.DynamicSiteMiddleware',
...
Expand Down Expand Up @@ -115,6 +115,26 @@ include wildcards.::
# will match any host ending '.example.com'


Development Environments
------------------------
Multisite returns a valid Alias when in "development mode" (defaulting to the
alias associated with the default SiteID.

Development mode is either:
- Running tests, i.e. manage.py test
- Running locally in settings.DEBUG = True, where the hostname is a
top-level name, i.e. localhost

In order to have multisite use aliases in local environments, add entries to
your local etc/hosts file to match aliases in your applications. E.g. ::

127.0.0.1 example.com
127.0.0.1 examplealias.com

And access your application at example.com:8000 or examplealias.com:8000 instead of
the usual localhost:8000.


Domain fallbacks
----------------

Expand Down Expand Up @@ -156,9 +176,9 @@ Cross-domain cookies
In order to support `cross-domain cookies`_,
for purposes like single-sign-on,
prepend the following to the top of
settings.py MIDDLEWARE_CLASSES::
settings.py MIDDLEWARE (MIDDLEWARE_CLASSES for Django < 1.10)::

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'multisite.middleware.CookieDomainMiddleware',
...
)
Expand Down

0 comments on commit 97190c6

Please sign in to comment.