Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Updates to move to s2i build image. #335

Merged
merged 1 commit into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .s2i/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_MODULE=oim_cms.wsgi
5 changes: 4 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import os
import sys

confy.read_environment_file()
# These lines are required for interoperability between local and container environments.
dot_env = os.path.join(os.getcwd(), '.env')
if os.path.exists(dot_env):
confy.read_environment_file()

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oim_cms.settings")
Expand Down
3 changes: 2 additions & 1 deletion oim_cms/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
from confy import env, database, cache
from unipath import Path

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = Path(__file__).ancestor(2)

# Settings defined in environment variables.
SECRET_KEY = env('SECRET_KEY')
Expand Down
12 changes: 9 additions & 3 deletions oim_cms/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
It exposes the WSGI callable as a module-level variable named ``application``.
"""
import confy
from django.core.wsgi import get_wsgi_application
import os
from unipath import Path

# These lines are required for interoperability between local and container environments.
dot_env = os.path.join(Path(__file__).ancestor(2), '.env')
if os.path.exists(dot_env):
confy.read_environment_file(dot_env) # Must precede dj_static imports.

confy.read_environment_file(".env")
from django.core.wsgi import get_wsgi_application
from dj_static import Cling, MediaCling

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oim_cms.settings")
application = get_wsgi_application()
application = Cling(MediaCling(get_wsgi_application()))
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ psycopg2-binary==2.7.4
Django==2.0.4
django-confy==1.0.4
django-extensions==2.0.6
uWSGI==2.0.17
gevent==1.2.2
wagtail==2.0.1
gunicorn==19.8.1
Unipath==1.1
dj-static==0.0.6
wagtail==2.1
django-taggit==0.22.2
django-modelcluster==4.1
Pillow==5.0.0