After #78 is merged, create a settings/ folder in config/ and create 3 settings files: base.py, dev.py and prod.py.
dev.py:
`
from .base import *
DEBUG = True
SECRET_KEY = 'SECRET'
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
`
prod.py:
`
from .base import *
DEBUG = False
SECRET_KEY = os.environ.get('SECRET_KEY')
ALLOWED_HOSTS = ['suppliestracker.pythonanywhere.com']
`
The rest of the current settings.py can be moved to base.py. An article for reference, although he says multiple settings files should only be used for larger projects, I disagree. There should always be at least prod and dev for dev-only apps and the settings above. This is also the suggested approach in Two Scoops of Django.
After #78 is merged, create a settings/ folder in config/ and create 3 settings files: base.py, dev.py and prod.py.
dev.py:
`
from .base import *
DEBUG = True
SECRET_KEY = 'SECRET'
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
`
prod.py:
`
from .base import *
DEBUG = False
SECRET_KEY = os.environ.get('SECRET_KEY')
ALLOWED_HOSTS = ['suppliestracker.pythonanywhere.com']
`
The rest of the current settings.py can be moved to base.py. An article for reference, although he says multiple settings files should only be used for larger projects, I disagree. There should always be at least prod and dev for dev-only apps and the settings above. This is also the suggested approach in Two Scoops of Django.