Static templates.

master
Nick Sergeant 2014-10-20 22:16:13 -04:00
parent c65339c541
commit 1e1c0d40be
4 changed files with 22 additions and 20 deletions

View File

@ -23,16 +23,15 @@ This is the codebase for the website, [Snipt.net](https://snipt.net/).
6. `heroku config:add AWS_SECRET_ACCESS_KEY=`
7. `heroku config:add AWS_STORAGE_BUCKET_NAME=`
8. `heroku config:add DEBUG=False`
9. `heroku config:set DISABLE_COLLECTSTATIC=1`
10. `heroku config:add INTERCOM_SECRET_KEY=`
11. `heroku config:add POSTMARK_API_KEY=`
12. `heroku config:add RAVEN_CONFIG_DSN=`
13. `heroku config:add SECRET_KEY=`
14. `heroku config:add STRIPE_SECRET_KEY=`
15. `heroku config:add USE_SSL=False`
16. `git push heroku`
17. `heroku run pip install --index-url https://code.stripe.com --upgrade stripe`
18. `heroku run python manage.py syncdb`
19. `heroku run python manage.py migrate`
9. `heroku config:add INTERCOM_SECRET_KEY=`
9. `heroku config:add POSTMARK_API_KEY=`
11. `heroku config:add RAVEN_CONFIG_DSN=`
12. `heroku config:add SECRET_KEY=`
13. `heroku config:add STRIPE_SECRET_KEY=`
14. `heroku config:add USE_SSL=False`
15. `git push heroku`
16. `heroku run pip install --index-url https://code.stripe.com --upgrade stripe`
17. `heroku run python manage.py syncdb`
18. `heroku run python manage.py migrate`
Any problems / questions / bugs, [create an issue](https://github.com/nicksergeant/snipt/issues). Thanks! :)

View File

@ -73,10 +73,6 @@ SERVER_EMAIL = 'support@snipt.net'
SESSION_COOKIE_AGE = 15801100
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
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."
TEMPLATE_DIRS = (os.path.join(PROJECT_PATH, 'templates'),)
TEMPLATE_DEBUG = DEBUG
@ -86,6 +82,18 @@ USE_I18N = True
USE_L10N = True
USE_TZ = True
if DEBUG:
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 = '/static/'
else:
STATIC_URL = 'https://snipt.s3.amazonaws.com/'
STATIC_ROOT = 'staticfiles'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
INSTALLED_APPS = (
'gunicorn',
'raven.contrib.django.raven_compat',

View File

@ -4,5 +4,4 @@ AWS_STORAGE_BUCKET_NAME = ''
DEBUG=True
S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATIC_URL = '/static/'
SSLIFY_DISABLE = True

View File

@ -72,7 +72,3 @@ if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
)
else:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), 'static')}),
)