Skip to content

Commit

Permalink
merge branch 'heroku_adventure'
Browse files Browse the repository at this point in the history
  • Loading branch information
zackmdavis committed Nov 1, 2014
2 parents 35d8662 + ff8feee commit 24642d7
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 26 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ lib/
lib64
pyvenv.cfg

# collected static files for production-like environments
collectstatic/

# local copies of JavaScript libraries
static/libs/jquery-2.1.1.min.js
static/libs/underscore-min.js
Expand All @@ -30,5 +33,12 @@ logs/finetooth.log*
.coverage
htmlcov/

# the database
# the SQLite database
db.sqlite3



# sentinel file whose existence is used to decide whether it is the
# case that we're in a dev environment (and should use the
# corresponding Django settings)
.development
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn wsgi --log-file -
7 changes: 7 additions & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bleach==1.4
Django==1.7
django-bootstrap3==4.11.0
django-debug-toolbar==1.2.1
Markdown==2.4.1
jasmine==2.0.1
factory_boy==2.4.1
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
bleach==1.4
Django==1.7
django-bootstrap3==4.11.0
django-debug-toolbar==1.2.1
Markdown==2.4.1
jasmine==2.0.1
factory_boy==2.4.1
dj-database-url==0.3.0
dj-static==0.0.6
gunicorn==19.1.1
psycopg2==2.5.1
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.4.1
47 changes: 27 additions & 20 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# TODO: review
# https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
IS_DEVELOPMENT = os.path.exists('.development')

# SECURITY WARNING: keep the secret key used in production secret!
# XXX TODO FIXME DANGER: the security warning on the previous line is
# big deal; if/when deploying this somewhere, change this and DO NOT
# keep the real value in a publicly-visible Git repo
SECRET_KEY = "fake_development_unsecret_key"
DEBUG = os.environ.get('DEBUG') or IS_DEVELOPMENT

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
if IS_DEVELOPMENT:
SECRET_KEY = os.environ.get('SECRET_KEY') or "fake_development_unsecret_key"
else:
SECRET_KEY = os.environ.get('SECRET_KEY')

TEMPLATE_DEBUG = True
TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']

INSTALLED_APPS = (
'django.contrib.admin',
Expand All @@ -29,10 +26,12 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap3',
'debug_toolbar',
'core',
)

if DEBUG and IS_DEVELOPMENT:
INSTALLED_APPS += ('debug_toolbar',)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
Expand All @@ -46,14 +45,18 @@

WSGI_APPLICATION = 'wsgi.application'

DATABASES = {
'default': {
# I <3 SQLite but maybe consider Postgres if/when deploying this
# somewhere
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join('db.sqlite3'),
if IS_DEVELOPMENT:
DATABASES = {
'default': {
# I <3 SQLite but maybe consider Postgres if/when deploying this
# somewhere
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join('db.sqlite3'),
}
}
}
else:
import dj_database_url
DATABASES = {'default': dj_database_url.config()}

AUTH_USER_MODEL = "core.FinetoothUser"

Expand Down Expand Up @@ -85,8 +88,12 @@
'core.context_processors.contextual_static_serving_context_processor'
)

STATIC_ROOT = 'staticfiles'

STATICFILES_DIRS = ('static',)
SERVE_STATIC_LIBS_LOCALLY = True

SERVE_STATIC_LIBS_LOCALLY = (os.environ.get('SERVE_STATIC_LIBS_LOCALLY')
or IS_DEVELOPMENT)

STATIC_URL = '/static/'

Expand Down
6 changes: 4 additions & 2 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"""

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Finetooth.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
from dj_static import Cling

application = Cling(get_wsgi_application())

0 comments on commit 24642d7

Please sign in to comment.