Skip to content

Instantly share code, notes, and snippets.

@hcwiley
Created January 12, 2013 17:02
Show Gist options
  • Save hcwiley/4519284 to your computer and use it in GitHub Desktop.
Save hcwiley/4519284 to your computer and use it in GitHub Desktop.
my typical local_settings.py file
MEDIA_ROOT = '/Users/hcwiley/github/heartbucket/heartbucket.com/static'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'heartbucket', # Or path to database file if using sqlite3.
'USER': 'django', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
@dwnoble
Copy link

dwnoble commented Jan 12, 2013

Alternate way to define MEDIA_ROOT:

import os

SITE_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
MEDIA_ROOT = os.path.join(SITE_ROOT, 'static')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment