Skip to content

Commit 043dcee

Browse files
author
Mario Colombo
committed
allow for simpler production deployment
1 parent 17f2aff commit 043dcee

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ docker compose run web python manage.py createsuperuser
2525

2626
Then open http://django-cms-quickstart.127.0.0.1.nip.io:8000 (or just http://127.0.0.1:8000) in your browser.
2727

28-
2928
## Customising the project
3029

3130
This project is ready-to-go without making any changes at all, but also gives you some options.
@@ -49,3 +48,16 @@ See the django-whitenoise settings in settings.py and the `quickstart/templates/
4948
## Contribution
5049

5150
Here is the official django CMS repository: [https://github.com/django-cms/django-cms-quickstart/](https://github.com/django-cms/django-cms-quickstart/).
51+
52+
53+
## Deployment
54+
55+
Env variables:
56+
- to deploy this project in testing modus (recommended) set the environment variable `DJANGO_DEBUG` to `True` in your hosting environment.
57+
- For production environment instead set the env var `DOMAIN` to the domain that you want the application to run under.
58+
- If you want the media hosted on S3 set the `DEFAULT_FILE_STORAGE` variable
59+
60+
During deployment the following commands must be executed:
61+
- `./manage.py collectstatic --noinput`
62+
- `./manage.py collectstatic --noinput`
63+

backend/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# SECURITY WARNING: don't run with debug turned on in production!
1414
DEBUG = os.environ.get('DJANGO_DEBUG') == "True"
1515

16+
ALLOWED_HOSTS = os.environ.get('DOMAIN')
1617
if DEBUG:
1718
ALLOWED_HOSTS = "*"
1819

0 commit comments

Comments
 (0)