Skip to content

Commit

Permalink
Merge 6f32c38 into 0780d84
Browse files Browse the repository at this point in the history
  • Loading branch information
georgreen committed Jul 20, 2017
2 parents 0780d84 + 6f32c38 commit 851b2f9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 20 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: python manage.py runserver 0.0.0.0:$PORT
76 changes: 56 additions & 20 deletions wger/settings_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import os
import re
import sys


import dj_database_url
'''
This file contains the global settings that don't usually need to be changed.
For a full list of options, visit:
Expand Down Expand Up @@ -106,6 +105,7 @@
)



MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -135,6 +135,7 @@
'wger.utils.helpers.EmailAuthBackend'
)


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand Down Expand Up @@ -162,6 +163,7 @@
# Django mobile
'django_mobile.loader.Loader',


'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
Expand All @@ -185,6 +187,7 @@
'djangobower.finders.BowerFinder',

# Django compressor

'compressor.finders.CompressorFinder',
)

Expand All @@ -202,7 +205,6 @@
LOGIN_URL = '/user/login'
LOGIN_REDIRECT_URL = '/'


#
# Internationalization
#
Expand All @@ -220,6 +222,7 @@
TIME_ZONE = None

# Restrict the available languages

LANGUAGES = (
('en', 'English'),
('de', 'German'),
Expand All @@ -235,10 +238,12 @@
('fr', 'French'),
)


# Default language code for this installation.
LANGUAGE_CODE = 'en'

# All translation files are in one place

LOCALE_PATHS = (
os.path.join(SITE_ROOT, 'locale'),
)
Expand Down Expand Up @@ -297,20 +302,43 @@
#
THUMBNAIL_ALIASES = {
'': {
'micro': {'size': (30, 30)},
'micro_cropped': {'size': (30, 30), 'crop': 'smart'},

'thumbnail': {'size': (80, 80)},
'thumbnail_cropped': {'size': (80, 80), 'crop': 'smart'},

'small': {'size': (200, 200)},
'small_cropped': {'size': (200, 200), 'crop': 'smart'},

'medium': {'size': (400, 400)},
'medium_cropped': {'size': (400, 400), 'crop': 'smart'},

'large': {'size': (800, 800), 'quality': 90},
'large_cropped': {'size': (800, 800), 'crop': 'smart', 'quality': 90},
'micro': {
'size': (30, 30)
},
'micro_cropped': {
'size': (30, 30),
'crop': 'smart'
},
'thumbnail': {
'size': (80, 80)
},
'thumbnail_cropped': {
'size': (80, 80),
'crop': 'smart'
},
'small': {
'size': (200, 200)
},
'small_cropped': {
'size': (200, 200),
'crop': 'smart'
},
'medium': {
'size': (400, 400)
},
'medium_cropped': {
'size': (400, 400),
'crop': 'smart'
},
'large': {
'size': (800, 800),
'quality': 90
},
'large_cropped': {
'size': (800, 800),
'crop': 'smart',
'quality': 90
},
},
}

Expand All @@ -323,6 +351,7 @@

# The default is not DEBUG, override if needed
# COMPRESS_ENABLED = True

COMPRESS_CSS_FILTERS = (
'compressor.filters.css_default.CssAbsoluteFilter',
'compressor.filters.cssmin.rCSSMinFilter'
Expand All @@ -331,6 +360,7 @@

# BOWER binary
if sys.platform.startswith('win32'):

BOWER_PATH = os.path.abspath(os.path.join(BASE_DIR, '..', 'node_modules', '.bin', 'bower.cmd'))
else:
BOWER_PATH = os.path.abspath(os.path.join(BASE_DIR, '..', 'node_modules', '.bin', 'bower'))
Expand All @@ -339,6 +369,7 @@
# Django Rest Framework
#
REST_FRAMEWORK = {

'DEFAULT_PERMISSION_CLASSES': ('wger.utils.permissions.WgerPermission',),
'PAGINATE_BY': 20,
'PAGINATE_BY_PARAM': 'limit', # Allow client to override, using `?limit=xxx`.
Expand All @@ -361,15 +392,15 @@
#
# Ignore these URLs if they cause 404
#
IGNORABLE_404_URLS = (
re.compile(r'^/favicon\.ico$'),
)
IGNORABLE_404_URLS = (re.compile(r'^/favicon\.ico$'), )


#
# Password rules
#
AUTH_PASSWORD_VALIDATORS = [
{

'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
Expand All @@ -396,3 +427,8 @@
'EMAIL_FROM': 'wger Workout Manager <wger@example.com>',
'TWITTER': False
}

DATABASES = {
'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
}

0 comments on commit 851b2f9

Please sign in to comment.