Static templates.
parent
1e1c0d40be
commit
4f43f294e4
15
settings.py
15
settings.py
|
@ -44,7 +44,6 @@ ADMINS = (('Nick Sergeant', 'nick@snipt.net'),)
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
|
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
|
||||||
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
|
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
BASE_PATH = os.path.dirname(__file__)
|
BASE_PATH = os.path.dirname(__file__)
|
||||||
CSRF_COOKIE_DOMAIN = '.snipt.net'
|
CSRF_COOKIE_DOMAIN = '.snipt.net'
|
||||||
CSRF_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
|
CSRF_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
|
||||||
|
@ -73,6 +72,10 @@ SERVER_EMAIL = 'support@snipt.net'
|
||||||
SESSION_COOKIE_AGE = 15801100
|
SESSION_COOKIE_AGE = 15801100
|
||||||
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
|
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
STATICFILES_DIRS = (os.path.join(BASE_PATH, 'media'),)
|
||||||
|
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder',)
|
||||||
|
STATIC_ROOT = os.path.join(BASE_PATH, 'static')
|
||||||
|
STATIC_URL = 'https://snipt.s3.amazonaws.com/'
|
||||||
TASTYPIE_CANNED_ERROR = "There was an error with your request. The site developers have a record of this error, please email api@snipt.net and we'll help you out."
|
TASTYPIE_CANNED_ERROR = "There was an error with your request. The site developers have a record of this error, please email api@snipt.net and we'll help you out."
|
||||||
TEMPLATE_DIRS = (os.path.join(PROJECT_PATH, 'templates'),)
|
TEMPLATE_DIRS = (os.path.join(PROJECT_PATH, 'templates'),)
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
|
@ -82,14 +85,10 @@ USE_I18N = True
|
||||||
USE_L10N = True
|
USE_L10N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
if DEBUG:
|
if 'USE_SSL' in os.environ:
|
||||||
STATICFILES_DIRS = (os.path.join(BASE_PATH, 'media'),)
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder',)
|
|
||||||
STATIC_ROOT = os.path.join(BASE_PATH, 'static')
|
|
||||||
STATIC_URL = '/static/'
|
|
||||||
else:
|
|
||||||
STATIC_URL = 'https://snipt.s3.amazonaws.com/'
|
|
||||||
STATIC_ROOT = 'staticfiles'
|
STATIC_ROOT = 'staticfiles'
|
||||||
|
STATIC_URL = '/static/'
|
||||||
STATICFILES_DIRS = (
|
STATICFILES_DIRS = (
|
||||||
os.path.join(BASE_DIR, 'static'),
|
os.path.join(BASE_DIR, 'static'),
|
||||||
)
|
)
|
||||||
|
|
2
urls.py
2
urls.py
|
@ -68,7 +68,7 @@ urlpatterns = patterns('',
|
||||||
url(r'^', include('snipts.urls')),
|
url(r'^', include('snipts.urls')),
|
||||||
)
|
)
|
||||||
|
|
||||||
if settings.DEBUG:
|
if 'USE_SSL' not in os.environ:
|
||||||
urlpatterns += patterns('',
|
urlpatterns += patterns('',
|
||||||
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
|
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue