Skip to content
lutoma edited this page Jun 13, 2012 · 2 revisions

To deploy Opensoup in an production (or online testing) environment, you should do the following:

Modify settings

You should change the following in your settings (opensoup/settings.py):

Disable debug mode

Simply change DEBUG (fifth line) to False:

DEBUG = False
TEMPLATE_DEBUG = DEBUG

Change the admin information

Change the ADMINS array to the correct value for your installation:

ADMINS = (
	('Herp Derp', '[email protected]'),
	('Derpina Herpendorfer', '[email protected]'),
)

Configure the database backend

You should change the database backend from sqlite to something more reasonable for production (like PostgreSQL or MySQL etc.):

DATABASES = {
	'default': {
		'ENGINE': 'django.db.backends.postgresql_psycopg2', # One of 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
		'NAME': 'opensoup',
		'USER': 'opensoup',
		'PASSWORD': 'lepassword',
		'HOST': 'database.example.org',
		'PORT': '', # Can be left empty for the default port
	}
}

Change the media and staticfile paths

Remember, Opensoup won't deliver your staticfiles and assets anymore if DEBUG is turned off, as that is only some hack to make local testing easier, but is way too slow to actually use it anywhere. Therefore, you should set MEDIA_ROOT and STATIC_ROOT to some directories to which your opensoup user can write. Then, you should configure a web server of your choice (lighttpd, nginx, apache, …) to serve those files from there to some URLs and then set these in the MEDIA_URL and STATIC_URL settings.

MEDIA_ROOT = '/srv/http/opensoup-media/'
MEDIA_URL = '//media.example.org/'
STATIC_ROOT = '/srv/http/opensoup-static/'
STATIC_URL = '//static.example.org/'

Change the secret key

This one is really important! Make sure you change the SECRET_KEY variable to some random letters of your choice.:

SECRET_KEY = 'Seriously, change me!'

Set the site URL

Change SITE_URL to the URL of your site (i.e. soup.io).