Skip to content

Instantly share code, notes, and snippets.

@manelclos
Last active September 22, 2015 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manelclos/a6706e121acdb5413181 to your computer and use it in GitHub Desktop.
Save manelclos/a6706e121acdb5413181 to your computer and use it in GitHub Desktop.
APPNAME = 'foobar'
# Overwrite settings depending on environment
# include at end of settings.py to overwrite settings in a per environment way
ENVIRONMENT_NAME = os.environ.get('ENVIRONMENT_NAME', 'production')
extra_settings = 'settings-%s.py' % ENVIRONMENT_NAME
extra_settings_path = os.path.join(BASE_DIR, APPNAME, extra_settings)
if os.path.exists(extra_settings_path):
print 'Try to load extra settings: %s' % extra_settings
execfile(extra_settings_path, globals())
# urls.py for Django 1.8
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
admin.site.site_header = 'Admin title'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment