-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:audaciouscode/PassiveDataKit-Django
- Loading branch information
Showing
9 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,7 @@ docs/_build/ | |
|
||
# PyBuilder | ||
target/ | ||
|
||
Dockerfile | ||
Procfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Dockerfile | ||
FROM quay.io/aptible/ubuntu:14.04 | ||
|
||
ADD .aptible.env /app/ | ||
RUN cat /app/.aptible.env | ||
|
||
RUN apt-install software-properties-common wget | ||
RUN add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | ||
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | ||
|
||
# Basic dependencies | ||
RUN apt-install build-essential python-dev python-setuptools | ||
RUN apt-install libxml2-dev libxslt1-dev python-dev | ||
|
||
# PostgreSQL dev headers and client (uncomment if you use PostgreSQL) | ||
RUN apt-install libpq-dev postgresql-client-9.5 | ||
|
||
RUN easy_install pip | ||
|
||
# Add requirements.txt ONLY, then run pip install, so that Docker cache won't | ||
# bust when changes are made to other repo files | ||
ADD requirements.txt /app/ | ||
WORKDIR /app | ||
RUN pip install -r requirements.txt | ||
|
||
RUN django-admin startproject pdk | ||
ADD . pdk/passive_data_kit | ||
ADD aptible_settings.py pdk/pdk/settings.py | ||
ADD aptible_wsgi.py pdk/pdk/wsgi.py | ||
|
||
# WORKDIR /app/pdk | ||
# RUN set -a && . /app/.aptible.env && python manage.py migrate | ||
# RUN set -a && . /app/.aptible.env && python manage.py collectstatic | ||
|
||
ENV PORT 3000 | ||
EXPOSE 3000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Procfile | ||
web: gunicorn --pythonpath /app/pdk/ pdk.wsgi --log-file - --bind="0.0.0.0:$PORT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
""" | ||
Settings.py for deploying standalone site on Aptible. | ||
""" | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
import os | ||
import sys | ||
|
||
import dj_database_url | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
SECRET_KEY = 'foobar' | ||
|
||
DEBUG = True | ||
ADMINS = [] | ||
|
||
ALLOWED_HOSTS = ['*'] | ||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
'django.contrib.gis', | ||
'passive_data_kit' | ||
) | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
'django.middleware.security.SecurityMiddleware', | ||
'whitenoise.middleware.WhiteNoiseMiddleware', | ||
) | ||
|
||
ROOT_URLCONF = 'passive_data_kit.travis_urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
WSGI_APPLICATION = 'pdk.wsgi.application' | ||
|
||
DATABASES = {'default': dj_database_url.config()} | ||
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis' | ||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/1.8/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/1.8/howto/static-files/ | ||
|
||
STATIC_ROOT = 'staticfiles' | ||
STATIC_URL = '/static/' | ||
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
WSGI config for Passive Data Kit project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
from whitenoise.django import DjangoWhiteNoise | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pdk.settings") | ||
application = DjangoWhiteNoise(get_wsgi_application()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ pytz==2016.4 | |
six==1.10.0 | ||
wsgiref==0.1.2 | ||
xkcdpass==1.6.4 | ||
gunicorn==19.6.0 | ||
dj-database-url==0.4.1 | ||
whitenoise==3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters