Skip to content

Commit

Permalink
Merge branch 'master' into parse_upcoming_matches_#86
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4kE committed Nov 21, 2016
2 parents 919e50f + 084ed4c commit a8aa101
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ services:
- pgdata:/var/lib/postgresql/data/
restart: unless-stopped

#redis:
# restart: always
# image: redis
# ports:
# - "6379:6379"
# volumes:
# - redisdata:/data
redis:
restart: unless-stopped
image: redis
ports:
- "6379:6379"
volumes:
- redisdata:/data

phantomjs:
image: wernight/phantomjs
Expand All @@ -39,4 +39,4 @@ services:

volumes:
pgdata:
#redisdata:
redisdata:
3 changes: 3 additions & 0 deletions docker_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ gunicorn

# postgres requirement
psycopg2

# redis backend
django-redis
20 changes: 6 additions & 14 deletions ofm_helper/common_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/

Expand Down Expand Up @@ -76,21 +74,13 @@

WSGI_APPLICATION = 'ofm_helper.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, "database", 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
Expand All @@ -106,10 +96,6 @@
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'de-de'

TIME_ZONE = 'Europe/Berlin'
Expand Down Expand Up @@ -159,6 +145,12 @@

AUTH_USER_MODEL = 'users.OFMUser'

LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'

LOGOUT_URL = '/logout'
LOGOUT_REDIRECT_URL = '/'

USE_DISPLAY_FOR_AWS = False

PHANTOMJS_REMOTE = False
18 changes: 18 additions & 0 deletions ofm_helper/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

ALLOWED_HOSTS = ['*']

# DB
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
Expand All @@ -14,6 +15,22 @@
}
}

# CACHING
CACHE_HOST = 'redis'
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://redis:6379/1',
'OPTIONS': {
"CLIENT_CLASS": "django_redis.client.DefaultClient"
},
}
}

# Now we can use our super fast redis as session store
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

# LOGGING
LOGGING['handlers']['file'] = {
'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler',
Expand All @@ -26,5 +43,6 @@
LOGGING['loggers']['django']['handlers'] = ['file', 'console']
LOGGING['loggers']['django.request']['handlers'] = ['file', 'console']

# PHANTOMJS
PHANTOMJS_REMOTE = True
PHANTOMJS_HOST = 'phantomjs'

0 comments on commit a8aa101

Please sign in to comment.