Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>given the following app setup:</p> <pre><code>/Project/ /app1/ /app2/ /project/ (the project app that gets auto created in Django 1.4+) /settings/ __init__.py &lt;- general site inspecific settings sitea.py &lt;- site A's specific settings siteb.py &lt;- site B's specific settings </code></pre> <p>inside <code>sitea.py</code> put Site specific settings (you can still use the <code>os.environ.get()</code> calls to use heroku stored settings).</p> <pre><code># Default Django settings for project. from project.settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS ALLOWED_HOSTS = [] MEDIA_ROOT = '' STATIC_ROOT = '' </code></pre> <p>then in your heroku run/startup script do the equivalent of (I assume you'll be using gunicorn or some other production django server)</p> <pre><code>python manage.py runserver --settings=project.settings.sitea </code></pre> <h2>Update - an example <code>Project/project/settings/production.py</code> file, note: all sensitive info reads from environment not from file.</h2> <pre><code>from project.settings import * DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Francis', 'francis@teamcolab.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': os.environ.get('MYSQL_DATABASE'), # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': os.environ.get('MYSQL_USER'), 'PASSWORD': os.environ.get('MYSQL_PASSWORD'), 'HOST': os.environ.get('MYSQL_HOST'), # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': os.environ.get('MYSQL_PORT'), # Set to empty string for default. } } REDIS = { 'HOST' : os.environ.get('REDIS_HOST'), 'PASSWORD' : os.environ.get('REDIS_PASSWORD', None), 'PORT' : int(os.environ.get('REDIS_PORT', 6379)), 'DB' : int(os.environ.get('REDIS_DB', 0)), } WEBSOCKET_URL = os.environ.get('WEBSOCKET_URL') # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = ['XX.com','production.XX.com','www.XX.com',] SESSION_COOKIE_DOMAIN = '.XX.com' # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/var/www/example.com/media/" MEDIA_ROOT = os.environ.get('MEDIA_ROOT') # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/var/www/example.com/static/" STATIC_ROOT = os.environ.get('STATIC_ROOT') </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload