Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deploy Superlists on Cloud Foundry.
  • Loading branch information
ihuston committed Oct 8, 2017
1 parent fffede2 commit 5bee0b5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
7 changes: 7 additions & 0 deletions manifest.yml
@@ -0,0 +1,7 @@
---
applications:
- name: ih-superlists
memory: 512M
instances: 1
buildpack: python_buildpack
command: python manage.py collectstatic --noinput && gunicorn superlists.wsgi:application
3 changes: 3 additions & 0 deletions requirements.txt
@@ -1,2 +1,5 @@
django==1.11
gunicorn==19.7.1
whitenoise==3.3.1
dj-database-url==0.4.2
psycopg2==2.7.3.1
1 change: 1 addition & 0 deletions runtime.txt
@@ -0,0 +1 @@
python-3.6.2
24 changes: 16 additions & 8 deletions superlists/settings.py
Expand Up @@ -11,6 +11,7 @@
"""

import os
import dj_database_url

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -23,9 +24,10 @@
SECRET_KEY = 's&fct_9our6wa6!kk70lsfs#sqp=%225kz5%0)u7x4$@**y+l)'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
DEBUG = False

ALLOWED_HOSTS = ['ih-superlists.cfapps.io']


# Application definition
Expand All @@ -42,6 +44,7 @@

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
Expand Down Expand Up @@ -74,12 +77,17 @@
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

#DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, '../database/db.sqlite3'),
# }
#}
print("DATABASE_URL=" + os.environ.get('DATABASE_URL', 'NOT_SPECIFIED'))
LOCAL_SQLITE='sqlite:///' + os.path.abspath(os.path.join(BASE_DIR, '../database/db.sqlite3'))
DATABASES = {}
DATABASES['default'] = dj_database_url.config(default=LOCAL_SQLITE)


# Password validation
Expand Down

0 comments on commit 5bee0b5

Please sign in to comment.