#342 Add settings to common.py and add tags to base template

This commit is contained in:
andresgz 2016-06-02 16:23:06 -04:00
parent 03c0b90c9c
commit 2a8be0b06f
3 changed files with 18 additions and 20 deletions

View File

@ -185,6 +185,8 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
# 'compressor.finders.CompressorFinder',
# MEDIA CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
@ -233,6 +235,16 @@ BROKER_URL = env('CELERY_BROKER_URL', default='django://')
########## END CELERY
{% endif %}
# django-compressor
# ------------------------------------------------------------------------------
{% if cookiecutter.use_compressor == 'y'-%}
INSTALLED_APPS += ("compressor", )
STATICFILES_FINDERS += ("compressor.finders.CompressorFinder", )
{%- endif %}
# Location of root django.contrib.admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %}
ADMIN_URL = r'^admin/'

View File

@ -171,12 +171,6 @@ NEW_RELIC_LICENSE_KEY = env('NEW_RELIC_LICENSE_KEY')
NEW_RELIC_APP_NAME = env('NEW_RELIC_APP_NAME')
{%- endif %}
# django-compressor
# ------------------------------------------------------------------------------
{% if cookiecutter.use_compressor == 'y'-%}
INSTALLED_APPS += ("compressor", )
{%- endif %}
# TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------
# See:

View File

@ -1,4 +1,4 @@
{% raw %}{% load staticfiles i18n {% endraw %}{% if cookiecutter.use_compressor == "y" %}compressor{% endif %}{% raw %}%}<!DOCTYPE html>
{% raw %}{% load staticfiles i18n {% endraw %}{% if cookiecutter.use_compressor == "y" %}compress{% endif %}{% raw %}%}<!DOCTYPE html>
<html lang="en" {% endraw %}{% if cookiecutter.use_angular == "y" %}ng-app{% endif %}{% raw %}>
<head>
<meta charset="utf-8">
@ -18,15 +18,10 @@
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
<!-- Your stuff: Third-party css libraries go here -->
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
{% compress css %}
{% endif %}{% raw %}
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %}
<!-- This file store project specific CSS -->
<link href="{% static 'css/project.css' %}" rel="stylesheet">
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
{% endcompress %}
{% endif %}{% raw %}
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
{% endblock %}
{% endraw %}{% if cookiecutter.use_angular == "y" %}{% raw %}{% block angular %}
@ -110,13 +105,10 @@
<!-- Your stuff: Third-party javascript libraries go here -->
<!-- place project specific Javascript in this file -->
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
{% compress js %}
{% endif %}{% raw %}
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %}
<script src="{% static 'js/project.js' %}"></script>
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
{% endcompress %}
{% endif %}{% raw %}
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
{% endblock javascript %}
</body>
</html>