Skip to content

Commit

Permalink
split windows and docker environment + desable debug in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4kE committed Oct 31, 2016
1 parent 9e4b68b commit 6814286
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: python
python:
- '3.5'
env:
- DJANGO_SETTINGS_MODULE=ofm_helper.settings.test
- DJANGO_SETTINGS_MODULE=ofm_helper.settings.windows
install:
- pip install -r requirements.txt
- pip install -r travis_requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion ofm_helper/settings/prod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ofm_helper.common_settings import *

DEBUG = True
DEBUG = False

ALLOWED_HOSTS = ['*']

Expand Down
17 changes: 17 additions & 0 deletions ofm_helper/settings/windows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ofm_helper.common_settings import *

DEBUG = True

ALLOWED_HOSTS = ['*']

LOGGING['handlers']['file'] = {
'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler',
'filename': 'logs/error.log',
'backupCount': 3,
'maxBytes': 1024 * 1024 * 5, # 5MB
'formatter': 'standard'
}

LOGGING['loggers']['django']['handlers'] = ['file', 'console']
LOGGING['loggers']['django.request']['handlers'] = ['file', 'console']
10 changes: 4 additions & 6 deletions ofm_helper/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import django
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
Expand All @@ -7,9 +8,6 @@
url(r'^', include('core.urls'), name='core'),
]

if settings.DEBUG is False: # if DEBUG is True it will be served automatically
from django.conf.urls import patterns
urlpatterns += patterns('',
url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
)
if not settings.DEBUG:
urlpatterns += [url(r'^static/(?P<path>.*)$', django.views.static.serve,
{'document_root': settings.STATIC_ROOT, 'show_indexes': settings.DEBUG})]

0 comments on commit 6814286

Please sign in to comment.