-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ikks/heroku
files are served from Heroku and collectstatic runs flawlessly
- Loading branch information
Showing
624 changed files
with
360 additions
and
94,734 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
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 |
---|---|---|
|
@@ -10,3 +10,5 @@ backup_process.md | |
canairioSnapshot/ | ||
node_modules/ | ||
__pycache__ | ||
test-results/ | ||
canairio/staticfiles/ |
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
FROM python:3.6 | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y libpq-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl influxdb-client | ||
RUN apt-get install -y libpq-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl influxdb-client binutils libproj-dev gdal-bin | ||
|
||
RUN pip install --upgrade pip | ||
ENV app /canairio | ||
|
||
RUN mkdir $app | ||
WORKDIR $app | ||
|
||
ADD . $app | ||
RUN pip install -r requirements.txt | ||
RUN python manage.py migrate | ||
|
||
COPY start $app/start |
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,4 @@ | ||
FROM timescale/timescaledb-postgis:latest-pg11 | ||
ARG db_name | ||
ENV POSTGRES_DB $db_name | ||
COPY create-dbs.sh /docker-entrypoint-initdb.d/ |
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 |
---|---|---|
@@ -1 +1 @@ | ||
web: gunicorn canairio.wsgi | ||
web: python manage.py collectstatic --noinput --settings=canairio.settings.production; gunicorn canairio.wsgi --log-file - |
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
Empty file.
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,3 @@ | ||
from .base import * | ||
|
||
ENVIRONMENT = 'development' |
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,67 @@ | ||
from .base import * | ||
|
||
import django_heroku | ||
|
||
ENVIRONMENT = 'production' | ||
|
||
DEBUG = False | ||
|
||
ALLOWED_HOSTS = ['gblabs.co'] | ||
|
||
CORS_ORIGIN_WHITELIST = ['canairiofront.herokuapp.com'] | ||
|
||
FB_API_KEY = getenvvar('FB_API_KEY') | ||
FB_AUTH_DOMAIN = getenvvar('FB_AUTH_DOMAIN') | ||
FB_DATABASE_URL = getenvvar('FB_DATABASE_URL') | ||
FB_STORAGE_BUCKET = getenvvar('FB_STORAGE_BUCKET') | ||
|
||
SECRET_KEY = getenvvar('SECRET_KEY') | ||
|
||
STATICFILES_DIRS = ( | ||
os.path.join(BASE_DIR, 'static'), | ||
) | ||
|
||
MIDDLEWARE.insert(1, 'whitenoise.middleware.WhiteNoiseMiddleware') | ||
|
||
django_heroku.settings(locals()) | ||
|
||
## This is used during development phase when testing production | ||
# with heroku, look at | ||
# https://github.com/kennethreitz/dj-database-url/issues/107 | ||
# Uncomment when necessary | ||
# del DATABASES['default']['OPTIONS']['sslmode'] | ||
|
||
LOGGING = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
'formatters': { | ||
'verbose': { | ||
'format': ('%(asctime)s [%(process)d] [%(levelname)s] ' + | ||
'pathname=%(pathname)s lineno=%(lineno)s ' + | ||
'funcname=%(funcName)s %(message)s'), | ||
'datefmt': '%Y-%m-%d %H:%M:%S' | ||
}, | ||
'simple': { | ||
'format': '%(levelname)s %(message)s' | ||
} | ||
}, | ||
'handlers': { | ||
'null': { | ||
'level': 'DEBUG', | ||
'class': 'logging.NullHandler', | ||
}, | ||
'console': { | ||
'level': 'DEBUG', | ||
'class': 'logging.StreamHandler', | ||
'formatter': 'verbose' | ||
} | ||
}, | ||
'loggers': { | ||
'testlogger': { | ||
'handlers': ['console'], | ||
'level': 'INFO', | ||
} | ||
} | ||
} | ||
|
||
DEBUG_PROPAGATE_EXCEPTIONS = True |
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,11 @@ | ||
from .base import * | ||
|
||
ENVIRONMENT = 'test' | ||
|
||
# Please make sure that you configure in the testing environment the | ||
# name without the _test suffix | ||
DATABASES['default']['NAME'] = '{}_test'.format(getenvvar('DATABASE_NAME')) | ||
|
||
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner' | ||
TEST_OUTPUT_VERBOSE = 2 | ||
TEST_OUTPUT_DIR = 'test-results' |
Empty file.
Empty file.
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,12 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
POSTGRES="psql --username ${POSTGRES_USER}" | ||
|
||
echo "Creating database: ${POSTGRES_DB}" | ||
echo "Creating database: ${POSTGRES_TEST_DB}" | ||
|
||
$POSTGRES <<EOSQL | ||
CREATE DATABASE "${POSTGRES_DB}" OWNER "${POSTGRES_USER}"; | ||
CREATE DATABASE "${POSTGRES_TEST_DB}" OWNER "${POSTGRES_USER}"; | ||
EOSQL |
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
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 @@ | ||
python-3.7.3 |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.