.
Simplified installation: instead of modifying the setting file (possibility that is always available) just add import service_urls.patch in your manage.py/wsgi.py files.
Add import service_urls.patch to manage.py and wsgi.py
manage.py:
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
import service_urls.patch
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_name.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
wsgi.py:
import os
import service_urls.patch
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_name.settings')
application = get_wsgi_application()
Usage
Configure your setting (see docs for better example).
DATABASES = {
'default': os.environ.get('DATABASE_DEFAULT', 'postgres://myuser:mypasswd@localhost:5432/mydb'),
}
CACHES = {
'default': os.environ.get('CACHE_DEFAULT', ''memcached://127.0.0.1:11211'),
}
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'smtp://localhost:25')