mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-01 18:50:18 +03:00
#342 Add settings to common.py and add tags to base template
This commit is contained in:
parent
03c0b90c9c
commit
2a8be0b06f
|
@ -185,6 +185,8 @@ STATICFILES_FINDERS = (
|
||||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 'compressor.finders.CompressorFinder',
|
||||||
|
|
||||||
# MEDIA CONFIGURATION
|
# MEDIA CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
|
# 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
|
########## END CELERY
|
||||||
{% endif %}
|
{% 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 %}
|
# Location of root django.contrib.admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %}
|
||||||
ADMIN_URL = r'^admin/'
|
ADMIN_URL = r'^admin/'
|
||||||
|
|
||||||
|
|
|
@ -171,12 +171,6 @@ NEW_RELIC_LICENSE_KEY = env('NEW_RELIC_LICENSE_KEY')
|
||||||
NEW_RELIC_APP_NAME = env('NEW_RELIC_APP_NAME')
|
NEW_RELIC_APP_NAME = env('NEW_RELIC_APP_NAME')
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# django-compressor
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
{% if cookiecutter.use_compressor == 'y'-%}
|
|
||||||
INSTALLED_APPS += ("compressor", )
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
# TEMPLATE CONFIGURATION
|
# TEMPLATE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# See:
|
# See:
|
||||||
|
|
|
@ -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 %}>
|
<html lang="en" {% endraw %}{% if cookiecutter.use_angular == "y" %}ng-app{% endif %}{% raw %}>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
@ -18,15 +18,10 @@
|
||||||
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
|
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
|
||||||
|
|
||||||
<!-- Your stuff: Third-party css libraries go here -->
|
<!-- Your stuff: Third-party css libraries go here -->
|
||||||
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
|
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %}
|
||||||
{% compress css %}
|
|
||||||
{% endif %}{% raw %}
|
|
||||||
<!-- This file store project specific CSS -->
|
<!-- This file store project specific CSS -->
|
||||||
<link href="{% static 'css/project.css' %}" rel="stylesheet">
|
<link href="{% static 'css/project.css' %}" rel="stylesheet">
|
||||||
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
|
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
|
||||||
{% endcompress %}
|
|
||||||
{% endif %}{% raw %}
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% endraw %}{% if cookiecutter.use_angular == "y" %}{% raw %}{% block angular %}
|
{% endraw %}{% if cookiecutter.use_angular == "y" %}{% raw %}{% block angular %}
|
||||||
|
@ -110,13 +105,10 @@
|
||||||
<!-- Your stuff: Third-party javascript libraries go here -->
|
<!-- Your stuff: Third-party javascript libraries go here -->
|
||||||
|
|
||||||
<!-- place project specific Javascript in this file -->
|
<!-- place project specific Javascript in this file -->
|
||||||
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
|
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %}
|
||||||
{% compress js %}
|
|
||||||
{% endif %}{% raw %}
|
|
||||||
<script src="{% static 'js/project.js' %}"></script>
|
<script src="{% static 'js/project.js' %}"></script>
|
||||||
{% endraw%}{% if cookiecutter.use_compressor == "y" %}
|
{% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
|
||||||
{% endcompress %}
|
|
||||||
{% endif %}{% raw %}
|
|
||||||
{% endblock javascript %}
|
{% endblock javascript %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user