Unverified Commit 80d4149e authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Only set up templatecheck if installed

parent 8511044b
...@@ -4,7 +4,6 @@ Pillow>=5.0,<5.1 ...@@ -4,7 +4,6 @@ Pillow>=5.0,<5.1
django-compressor>=2.1,<3 django-compressor>=2.1,<3
django-sendfile<=0.4 django-sendfile<=0.4
freezegun>=0.3.9,<0.4.0 freezegun>=0.3.9,<0.4.0
django-template-check>=0.3.0 # This should be in dev-requirements somehow
bleach>=2.1.0,<2.2 bleach>=2.1.0,<2.2
django-tinymce4-lite>=1.7,<1.8 django-tinymce4-lite>=1.7,<1.8
rcssmin>=1.0.6 rcssmin>=1.0.6
......
...@@ -10,7 +10,7 @@ commands = ...@@ -10,7 +10,7 @@ commands =
; specified below ; specified below
cp {toxinidir}/requirements.txt {envbindir}/reqtemp.txt cp {toxinidir}/requirements.txt {envbindir}/reqtemp.txt
sed -i /Django>=.*/d {envbindir}/reqtemp.txt sed -i /Django>=.*/d {envbindir}/reqtemp.txt
pip install -r{envbindir}/reqtemp.txt pip install -r{envbindir}/reqtemp.txt -r{toxinidir}/dev-requirements.txt
pipconflictchecker # if this fails, use pipdeptree to debug pipconflictchecker # if this fails, use pipdeptree to debug
python manage.py check python manage.py check
python manage.py templatecheck --project-only python manage.py templatecheck --project-only
......
...@@ -17,7 +17,8 @@ from django.utils.log import DEFAULT_LOGGING ...@@ -17,7 +17,8 @@ from django.utils.log import DEFAULT_LOGGING
from . import settings from . import settings
INSTALLED_APPS = settings.INSTALLED_APPS INSTALLED_APPS = settings.INSTALLED_APPS
INSTALLED_APPS.remove('django_template_check') if 'django_template_check' in INSTALLED_APPS:
INSTALLED_APPS.remove('django_template_check')
INSTALLED_APPS.append('django_slack') INSTALLED_APPS.append('django_slack')
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
......
...@@ -50,7 +50,6 @@ INSTALLED_APPS = [ ...@@ -50,7 +50,6 @@ INSTALLED_APPS = [
'django.contrib.sitemaps', 'django.contrib.sitemaps',
# Dependencies # Dependencies
'tinymce', 'tinymce',
'django_template_check', # This is only necessary in development
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'compressor', 'compressor',
...@@ -78,6 +77,15 @@ INSTALLED_APPS = [ ...@@ -78,6 +77,15 @@ INSTALLED_APPS = [
'payments.apps.PaymentsConfig', 'payments.apps.PaymentsConfig',
] ]
# enable template check if it's installed
# this allows us to not have it enabled in production
try:
import django_template_check
del django_template_check
INSTALLED_APPS.append('django_template_check')
except ImportError:
pass
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment