Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Deploy Superlists on Cloud Foundry.
- Loading branch information
Showing
with
27 additions
and
8 deletions.
-
+7
−0
manifest.yml
-
+3
−0
requirements.txt
-
+1
−0
runtime.txt
-
+16
−8
superlists/settings.py
|
|
@@ -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 |
|
|
@@ -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 |
|
|
@@ -0,0 +1 @@ |
|
|
python-3.6.2 |
|
@@ -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__))) |
|
@@ -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 |
|
@@ -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', |
|
@@ -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 |
|
|