settings.py:
import os PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'test', # Or path to database file if using sqlite3. 'USER': 'ddd', # Not used with sqlite3. 'PASSWORD': '123qwe', # Not used with sqlite3. 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '5432', # Set to empty string for default. Not used with sqlite3. } } TIME_ZONE = 'Asia/Omsk' LANGUAGE_CODE = 'Ru' SITE_ID = 1 USE_I18N = True USE_L10N = True STATIC_ROOT = os.path.join(PROJECT_PATH, "static") STATIC_URL = STATICFILES_URL = '/static/' ADMIN_MEDIA_PREFIX = "/static/admin/" MEDIA_ROOT = os.path.join(PROJECT_PATH, "media") MEDIA_URL = "/media/" TINYMCE_JS_URL = r'/static/tiny_mce/tiny_mce_src.js', TINYMCE_DEFAULT_CONFIG = { 'plugins': "table,spellchecker,paste,searchreplace", 'theme': "advanced", } TINYMCE_SPELLCHECKER = True TINYMCE_COMPRESSOR = True STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. SECRET_KEY = 't24u_x-)j=c_1$ex6e9r1$t5tn!!6un@14le%aw)wyaf9i)@00' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) '''STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', )''' # Make this unique, and don't share it with anybody. SECRET_KEY = ')7hfy20=n4#m4#k&zc^@&^0qmdv)5p78wjeh5*jlz9c54$&3#^' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ROOT_URLCONF = 'zzz.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'zzz.blog', )
app.wsgi:
import os import sys path = '/srv/www' if path not in sys.path: sys.path.insert(0, '/srv/www') os.environ['DJANGO_SETTINGS_MODULE'] = 'zzz.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
Заранее спасибо.