sys.path.append(os.path.dirname(__file__))
import django
if django.VERSION < (1, 4):
from django.core.management import setup_environ
settings = __import__(os.environ["DJANGO_SETTINGS_MODULE"])
# import source code dir
import os
import sys
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
SITE_ID = 303
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {"default": {
"ENGINE": "django.db.backends.sqlite3",
"USER": '',
"PASSWORD": '',
"PORT": '',
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'YOUR_APP_HERE', # This is where you put your app
)
Comments
mydjangoproj/
mydjangoproj/settings.py
mydjangoproj/myapp/
mydjangoproj/docs/conf.py
mydjangoproj/docs/settings.py
i.e. a separate settings.py just for your docs/ dir that points up at the main django root?
I guess you still need to go through and add ..automodule directives to the rst index for all your INSTALLED_APPS ?
Sorry for dumb questions, first time I've used Sphinx...
Yes, you've got it right.
Usually a project has lots of settings anyway. Local dev settings, staging, production, different settings for celery workers, etc. Docs is just one more context you need some settings for.
Alex