Adds Cache-Control: no-store and an X-Dev-Site header to the dev site
switcher so a browser cannot reuse another site's page or redirect, and
the selected site is visible in dev tools.
Each site gets a home page and four child pages, and there are twelve
dummy customers. The dummy admin password is now fixed through
DUMMY_ADMIN_PASSWORD. --purge removes all of it.
The cookie is shared by all tabs and redirects dropped ?site=, so opening
several sites made them all show the last one. The site is now taken from
<domain>.<anything> hosts (each site its own origin), with ?site= and the
cookie as fallback, and redirects keep ?site=. /dev-sites/ links use the
per-site hostnames, via sslip.io when accessed by IP.
The seed_dummy_data command creates one CMS page per site and a dummy
admin and customer, idempotently. --purge removes exactly what it
created. It runs on start when SEED_DUMMY_DATA=True and a failure does
not stop the web server.
With DEBUG on, ?site=<domain> selects the site without DNS or hosts
entries and is remembered in a cookie. /dev-sites/ lists all
configured sites as links.
Runs postgres, redis, the web app and a celery worker. Dev defaults live
in .env.docker with an optional .env override. The entrypoint generates
and persists the Django secret key and waits for postgres; the web
service migrates and creates a Site row for every configured domain.
SQL dumps placed in db-init/ are restored on first start and are
git-ignored.
Fixes
Traceback (most recent call last):
File "<console>", line 2, in <module>
File "/home/app/pyvenv/lib/python3.5/site-packages/django/db/models/manager.py", line 122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/app/pyvenv/lib/python3.5/site-packages/django/db/models/query.py", line 391, in get
(self.model._meta.object_name, num)
hosting.models.MultipleObjectsReturned: get() returned more than one UserCardDetail -- it returned 2!