differentreality / supplies_tracker

Django project for tracking home and office supplies
GNU General Public License v3.0
5 stars 10 forks source link

Separate Settings Files for Dev and Production #84

Open jshcrm opened 6 years ago

jshcrm commented 6 years ago

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.