diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2243dd89b..28d6b4337 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -50,11 +50,11 @@ jobs:
- name: Basic - Postgres
args: "database_engine=postgresql database_version='postgresql@14.1'"
- name: Extended - Postgres
- args: "use_celery=y use_drf=y js_task_runner=Gulp database_engine=postgresql database_version='postgresql@14.1'"
+ args: "use_celery=y use_drf=y frontend_pipeline=Gulp database_engine=postgresql database_version='postgresql@14.1'"
- name: Basic - MySQL
args: "database_engine=mysql database_version='mysql@8.0.28'"
- name: Extended - MySQL
- args: "use_celery=y use_drf=y js_task_runner=Gulp database_engine=mysql database_version='mysql@8.0.28'"
+ args: "use_celery=y use_drf=y frontend_pipeline=Gulp database_engine=mysql database_version='mysql@8.0.28'"
name: "${{ matrix.script.name }} Docker"
runs-on: ubuntu-latest
@@ -79,11 +79,11 @@ jobs:
matrix:
script:
- name: With Celery
- args: "use_celery=y use_compressor=y database_engine=postgresql database_version=postgresql@14.1"
+ args: "use_celery=y frontend_pipeline='Django Compressor' database_engine=postgresql database_version=postgresql@14.1"
# postgres://user:password@host:port/database
database_url: "postgres://postgres:postgres@localhost:5432/postgres"
- name: With Gulp
- args: "js_task_runner=Gulp custom_bootstrap_compilation=y database_engine=postgresql database_version=postgresql@14.1"
+ args: "frontend_pipeline='Gulp' custom_bootstrap_compilation=y database_engine=postgresql database_version=postgresql@14.1"
database_url: "postgres://postgres:postgres@localhost:5432/postgres"
name: "${{ matrix.script.name }} Bare metal"
diff --git a/.github/workflows/pre-commit-autoupdate.yml b/.github/workflows/pre-commit-autoupdate.yml
index b5c91ca5c..df4ea1f9a 100644
--- a/.github/workflows/pre-commit-autoupdate.yml
+++ b/.github/workflows/pre-commit-autoupdate.yml
@@ -31,7 +31,7 @@ jobs:
run: pre-commit autoupdate
- name: Create Pull Request
- uses: peter-evans/create-pull-request@v3.14.0
+ uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84e61e6c6..95dc9f73b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,16 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
+## 2022.03.23
+
+### Updated
+- Bump peter-evans/create-pull-request from 3.14.0 to 4 ([#3645](https://github.com/cookiecutter/cookiecutter-django/pull/3645))
+
+## 2022.03.20
+
+### Changed
+- Unify compressor, gulp and custom bootstrap options ([#3535](https://github.com/cookiecutter/cookiecutter-django/pull/3535))
+
## 2022.03.14
### Fixed
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..8a5fc4158
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,3 @@
+## Code of Conduct
+
+Everyone who interacts in the Cookiecutter project's codebase, issue trackers, chat rooms, and mailing lists is expected to follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/).
diff --git a/README.md b/README.md
index d925cfbb4..3a1fd4d23 100644
--- a/README.md
+++ b/README.md
@@ -129,10 +129,6 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re
4 - postgresql@11.14
5 - postgresql@10.19
Choose from 1, 2, 3, 4, 5 [1]: 1
- Select js_task_runner:
- 1 - None
- 2 - Gulp
- Choose from 1, 2 [1]: 1
Select cloud_provider:
1 - AWS
2 - GCP
@@ -151,8 +147,11 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re
Choose from 1, 2, 3, 4, 5, 6, 7, 8, 9 [1]: 1
use_async [n]: n
use_drf [n]: y
- custom_bootstrap_compilation [n]: n
- use_compressor [n]: n
+ Select frontend_pipeline:
+ 1 - None
+ 2 - Django Compressor
+ 3 - Gulp
+ Choose from 1, 2, 3, 4 [1]: 1
use_celery [n]: y
use_mailhog [n]: n
use_sentry [n]: y
@@ -248,8 +247,3 @@ experience better.
- [How to create a Django Application using Cookiecutter and Django 1.8](https://www.swapps.io/blog/how-to-create-a-django-application-using-cookiecutter-and-django-1-8/) - Sept. 12, 2015
Have a blog or online publication? Write about your cookiecutter-django tips and tricks, then send us a pull request with the link.
-
-## Code of Conduct
-
-Everyone interacting in the Cookiecutter project's codebases, issue trackers, chat
-rooms, and mailing lists is expected to follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/).
diff --git a/cookiecutter.json b/cookiecutter.json
index 2a3c168db..50e2529e3 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -30,7 +30,6 @@
],
"__processed_database_engine": "{{ cookiecutter.database_version.lower()|split('@')[0] }}",
"__processed_database_version": "{{ cookiecutter.database_version.lower()|split('@')[1] }}",
- "js_task_runner": ["None", "Gulp"],
"cloud_provider": ["AWS", "GCP", "None"],
"mail_service": [
"Mailgun",
@@ -45,8 +44,7 @@
],
"use_async": "n",
"use_drf": "n",
- "custom_bootstrap_compilation": "n",
- "use_compressor": "n",
+ "frontend_pipeline": ["None", "Django Compressor", "Gulp"],
"use_celery": "n",
"use_mailhog": "n",
"use_sentry": "n",
diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst
index 158e25874..3317542db 100644
--- a/docs/deployment-on-heroku.rst
+++ b/docs/deployment-on-heroku.rst
@@ -158,7 +158,7 @@ Or add the DSN for your account, if you already have one:
Gulp & Bootstrap compilation
++++++++++++++++++++++++++++
-If you've opted for a custom bootstrap build, you'll most likely need to setup
+If you've opted for Gulp, you'll most likely need to setup
your app to use `multiple buildpacks`_: one for Python & one for Node.js:
.. code-block:: bash
diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst
index f70363dc9..bde272247 100644
--- a/docs/developing-locally-docker.rst
+++ b/docs/developing-locally-docker.rst
@@ -18,7 +18,7 @@ Prerequisites
* Docker; if you don't have it yet, follow the `installation instructions`_;
* Docker Compose; refer to the official documentation for the `installation guide`_.
-* Pre-commit; refer to the official documentation for the [pre-commit](https://pre-commit.com/#install).
+* Pre-commit; refer to the official documentation for the `pre-commit`_.
.. _`installation instructions`: https://docs.docker.com/install/#supported-platforms
.. _`installation guide`: https://docs.docker.com/compose/install/
@@ -214,7 +214,7 @@ Celery tasks in local development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When not using docker Celery tasks are set to run in Eager mode, so that a full stack is not needed. When using docker the task scheduler will be used by default.
-If you need tasks to be executed on the main thread during development set CELERY_TASK_ALWAYS_EAGER = True in config/settings/local.py.
+If you need tasks to be executed on the main thread during development set ``CELERY_TASK_ALWAYS_EAGER = True`` in ``config/settings/local.py``.
Possible uses could be for testing, or ease of profiling with DJDT.
@@ -239,7 +239,7 @@ Developing locally with HTTPS
Increasingly it is becoming necessary to develop software in a secure environment in order that there are very few changes when deploying to production. Recently Facebook changed their policies for apps/sites that use Facebook login which requires the use of an HTTPS URL for the OAuth redirect URL. So if you want to use the ``users`` application with a OAuth provider such as Facebook, securing your communication to the local development environment will be necessary.
-In order to create a secure environment, we need to have a trusted SSL certficate installed in our Docker application.
+In order to create a secure environment, we need to have a trusted SSL certificate installed in our Docker application.
#. **Let's Encrypt**
diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst
index a10aea7c6..521754e4d 100644
--- a/docs/developing-locally.rst
+++ b/docs/developing-locally.rst
@@ -183,7 +183,7 @@ To run Celery locally, make sure redis-server is installed (instructions are ava
Sass Compilation & Live Reloading
---------------------------------
-If you've opted for Gulp as JS task runner, the project comes configured with `Sass`_ compilation and `live reloading`_. As you change you Sass/JS source files, the task runner will automatically rebuild the corresponding CSS and JS assets and reload them in your browser without refreshing the page.
+If you've opted for Gulp as front-end pipeline, the project comes configured with `Sass`_ compilation and `live reloading`_. As you change you Sass/JS source files, the task runner will automatically rebuild the corresponding CSS and JS assets and reload them in your browser without refreshing the page.
#. Make sure that `Node.js`_ v16 is installed on your machine.
#. In the project root, install the JS dependencies with::
@@ -196,7 +196,7 @@ If you've opted for Gulp as JS task runner, the project comes configured with `S
The app will now run with live reloading enabled, applying front-end changes dynamically.
-.. note:: The task will start 2 processes in parallel: the static assets build loop on one side, and the Django server on the other. You don NOT need to run Django as your would normally with ``manage.py runserver``.
+.. note:: The task will start 2 processes in parallel: the static assets build loop on one side, and the Django server on the other. You do NOT need to run Django as your would normally with ``manage.py runserver``.
.. _Node.js: http://nodejs.org/download/
.. _Sass: https://sass-lang.com/
diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst
index d18458d83..b7aaa97b5 100644
--- a/docs/project-generation-options.rst
+++ b/docs/project-generation-options.rst
@@ -80,12 +80,6 @@ database_version:
1. 5.7
-js_task_runner:
- Select a JavaScript task runner. The choices are:
-
- 1. None
- 2. Gulp_
-
cloud_provider:
Select a cloud provider for static & media files. The choices are:
@@ -114,13 +108,12 @@ use_async:
use_drf:
Indicates whether the project should be configured to use `Django Rest Framework`_.
-custom_bootstrap_compilation:
- Indicates whether the project should support Bootstrap recompilation
- via the selected JavaScript task runner's task. This can be useful
- for real-time Bootstrap variable alteration.
+frontend_pipeline:
+ Select a pipeline to compile and optimise frontend assets (JS, CSS, ...):
-use_compressor:
- Indicates whether the project should be configured to use `Django Compressor`_.
+ 1. None
+ 2. `Django Compressor`_
+ 3. `Gulp`_: support Bootstrap recompilation with real-time variables alteration.
use_celery:
Indicates whether the project should be configured to use Celery_.
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py
index 5c01cb621..277b9e98d 100644
--- a/hooks/post_gen_project.py
+++ b/hooks/post_gen_project.py
@@ -10,7 +10,6 @@ TODO: restrict Cookiecutter Django project initialization to
"""
from __future__ import print_function
-import json
import os
import random
import shutil
@@ -92,6 +91,11 @@ def remove_gulp_files():
file_names = ["gulpfile.js"]
for file_name in file_names:
os.remove(file_name)
+ remove_sass_files()
+
+
+def remove_sass_files():
+ shutil.rmtree(os.path.join("{{cookiecutter.project_slug}}", "static", "sass"))
def remove_packagejson_file():
@@ -100,16 +104,6 @@ def remove_packagejson_file():
os.remove(file_name)
-def remove_bootstrap_packages():
- with open("package.json", mode="r") as fd:
- content = json.load(fd)
- for package_name in ["bootstrap", "gulp-concat", "@popperjs/core"]:
- content["devDependencies"].pop(package_name)
- with open("package.json", mode="w") as fd:
- json.dump(content, fd, ensure_ascii=False, indent=2)
- fd.write("\n")
-
-
def remove_celery_files():
file_names = [
os.path.join("config", "celery_app.py"),
@@ -456,13 +450,13 @@ def main():
if (
"{{ cookiecutter.use_docker }}".lower() == "y"
- and "{{ cookiecutter.cloud_provider}}".lower() != "aws"
+ and "{{ cookiecutter.cloud_provider}}" != "AWS"
):
remove_aws_dockerfile()
if "{{ cookiecutter.use_heroku }}".lower() == "n":
remove_heroku_files()
- elif "{{ cookiecutter.use_compressor }}".lower() == "n":
+ elif "{{ cookiecutter.frontend_pipeline }}" != "Django Compressor":
remove_heroku_build_hooks()
if "{{ cookiecutter.database_engine }}".lower() == "postgresql":
@@ -487,15 +481,13 @@ def main():
if "{{ cookiecutter.keep_local_envs_in_vcs }}".lower() == "y":
append_to_gitignore_file("!.envs/.local/")
- if "{{ cookiecutter.js_task_runner}}".lower() == "none":
+ if "{{ cookiecutter.frontend_pipeline }}" != "Gulp":
remove_gulp_files()
remove_packagejson_file()
if "{{ cookiecutter.use_docker }}".lower() == "y":
remove_node_dockerfile()
- elif "{{ cookiecutter.custom_bootstrap_compilation }}" == "n":
- remove_bootstrap_packages()
- if "{{ cookiecutter.cloud_provider}}".lower() == "none":
+ if "{{ cookiecutter.cloud_provider}}" == "None":
print(
WARNING + "You chose not to use a cloud provider, "
"media files won't be served in production." + TERMINATOR
@@ -507,13 +499,13 @@ def main():
if "{{ cookiecutter.use_docker }}".lower() == "y":
remove_celery_compose_dirs()
- if "{{ cookiecutter.ci_tool }}".lower() != "travis":
+ if "{{ cookiecutter.ci_tool }}" != "Travis":
remove_dottravisyml_file()
- if "{{ cookiecutter.ci_tool }}".lower() != "gitlab":
+ if "{{ cookiecutter.ci_tool }}" != "Gitlab":
remove_dotgitlabciyml_file()
- if "{{ cookiecutter.ci_tool }}".lower() != "github":
+ if "{{ cookiecutter.ci_tool }}" != "Github":
remove_dotgithub_folder()
if "{{ cookiecutter.use_drf }}".lower() == "n":
diff --git a/setup.py b/setup.py
index 99e054595..ed2418189 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ except ImportError:
from distutils.core import setup
# We use calendar versioning
-version = "2022.03.14"
+version = "2022.03.23"
with open("README.rst") as readme_file:
long_description = readme_file.read()
diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py
index dd3375d50..8ef8d11bd 100755
--- a/tests/test_cookiecutter_generation.py
+++ b/tests/test_cookiecutter_generation.py
@@ -90,12 +90,9 @@ SUPPORTED_COMBINATIONS = [
{"use_async": "n"},
{"use_drf": "y"},
{"use_drf": "n"},
- {"js_task_runner": "None"},
- {"js_task_runner": "Gulp"},
- {"custom_bootstrap_compilation": "y"},
- {"custom_bootstrap_compilation": "n"},
- {"use_compressor": "y"},
- {"use_compressor": "n"},
+ {"frontend_pipeline": "None"},
+ {"frontend_pipeline": "django-compressor"},
+ {"frontend_pipeline": "Gulp"},
{"use_celery": "y"},
{"use_celery": "n"},
{"use_mailhog": "y"},
diff --git a/{{cookiecutter.project_slug}}/.github/dependabot.yml b/{{cookiecutter.project_slug}}/.github/dependabot.yml
index 0b792f748..fef1b75fc 100644
--- a/{{cookiecutter.project_slug}}/.github/dependabot.yml
+++ b/{{cookiecutter.project_slug}}/.github/dependabot.yml
@@ -88,7 +88,7 @@ updates:
schedule:
interval: "daily"
-{%- if cookiecutter.js_task_runner != "None" %}
+{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
# Enable version updates for javascript/npm
- package-ecosystem: "npm"
diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore
index d48356fa1..ede26ef72 100644
--- a/{{cookiecutter.project_slug}}/.gitignore
+++ b/{{cookiecutter.project_slug}}/.gitignore
@@ -338,7 +338,7 @@ MailHog
.ipython/
{%- endif %}
-{%- if cookiecutter.js_task_runner == 'Gulp' %}
+{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
project.css
project.min.css
vendors.js
diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml
index 67f369a3c..ad3b6a35a 100644
--- a/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml
+++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/docker_compose_up_django.xml
@@ -10,7 +10,7 @@
{%- endif %}
- {%- if cookiecutter.js_task_runner == 'Gulp' %}
+ {%- if cookiecutter.frontend_pipeline == 'Gulp' %}
{%- endif %}
diff --git a/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml b/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml
index 289d9716a..98759fa1b 100644
--- a/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml
+++ b/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml
@@ -13,7 +13,7 @@
- {% if cookiecutter.js_task_runner != 'None' %}
+ {% if cookiecutter.frontend_pipeline == 'Gulp' %}
diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md
index 557194877..f7c29fb22 100644
--- a/{{cookiecutter.project_slug}}/README.md
+++ b/{{cookiecutter.project_slug}}/README.md
@@ -128,7 +128,7 @@ See detailed [cookiecutter-django Heroku documentation](http://cookiecutter-djan
See detailed [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html).
{%- endif %}
-{%- if cookiecutter.custom_bootstrap_compilation == "y" %}
+{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
### Custom Bootstrap Compilation
The generated CSS is set up with automatic Bootstrap recompilation with variables of your choice.
@@ -136,8 +136,5 @@ Bootstrap v5 is installed using npm and customised by tweaking your variables in
You can find a list of available variables [in the bootstrap source](https://github.com/twbs/bootstrap/blob/main/scss/_variables.scss), or get explanations on them in the [Bootstrap docs](https://getbootstrap.com/docs/5.1/customize/sass/).
-{%- if cookiecutter.js_task_runner == "Gulp" %}
Bootstrap's javascript as well as its dependencies is concatenated into a single file: `static/js/vendors.js`.
{%- endif %}
-
-{%- endif %}
diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile
index 84464a725..08bbf1f3c 100644
--- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile
+++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile
@@ -1,6 +1,6 @@
ARG PYTHON_VERSION=3.9-slim-bullseye
-{% if cookiecutter.js_task_runner == 'Gulp' -%}
+{% if cookiecutter.frontend_pipeline == 'Gulp' -%}
FROM node:16-bullseye-slim as client-builder
ARG APP_HOME=/app
@@ -109,7 +109,7 @@ RUN chmod +x /start-flower
# copy application code to WORKDIR
-{%- if cookiecutter.js_task_runner == 'Gulp' %}
+{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
COPY --from=client-builder --chown=django:django ${APP_HOME} ${APP_HOME}
{% else %}
COPY --chown=django:django . ${APP_HOME}
diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start
index 8e324afe0..2ba79501c 100644
--- a/{{cookiecutter.project_slug}}/compose/production/django/start
+++ b/{{cookiecutter.project_slug}}/compose/production/django/start
@@ -6,7 +6,7 @@ set -o nounset
python /app/manage.py collectstatic --noinput
-{% if cookiecutter.use_whitenoise == 'y' and cookiecutter.use_compressor == 'y' %}
+{% if cookiecutter.use_whitenoise == 'y' and cookiecutter.frontend_pipeline == 'Django Compressor' %}
compress_enabled() {
python << END
import sys
diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py
index 1618800d7..21c129459 100644
--- a/{{cookiecutter.project_slug}}/config/settings/base.py
+++ b/{{cookiecutter.project_slug}}/config/settings/base.py
@@ -322,7 +322,7 @@ ACCOUNT_FORMS = {"signup": "{{cookiecutter.project_slug}}.users.forms.UserSignup
SOCIALACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter"
# https://django-allauth.readthedocs.io/en/latest/forms.html
SOCIALACCOUNT_FORMS = {"signup": "{{cookiecutter.project_slug}}.users.forms.UserSocialSignupForm"}
-{% if cookiecutter.use_compressor == 'y' -%}
+{% if cookiecutter.frontend_pipeline == 'Django Compressor' -%}
# django-compressor
# ------------------------------------------------------------------------------
# https://django-compressor.readthedocs.io/en/latest/quickstart/#installation
diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py
index 3ce150e1c..1eafd9fae 100644
--- a/{{cookiecutter.project_slug}}/config/settings/local.py
+++ b/{{cookiecutter.project_slug}}/config/settings/local.py
@@ -69,7 +69,7 @@ if env("USE_DOCKER") == "yes":
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
- {%- if cookiecutter.js_task_runner == 'Gulp' %}
+ {%- if cookiecutter.frontend_pipeline == 'Gulp' %}
try:
_, _, ips = socket.gethostbyname_ex("node")
INTERNAL_IPS.extend(ips)
diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py
index 06eb8d492..b792e5448 100644
--- a/{{cookiecutter.project_slug}}/config/settings/production.py
+++ b/{{cookiecutter.project_slug}}/config/settings/production.py
@@ -218,7 +218,7 @@ EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
ANYMAIL = {}
{%- endif %}
-{% if cookiecutter.use_compressor == 'y' -%}
+{% if cookiecutter.frontend_pipeline == 'Django Compressor' -%}
# django-compressor
# ------------------------------------------------------------------------------
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED
diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js
index 0f90be220..628b838ba 100644
--- a/{{cookiecutter.project_slug}}/gulpfile.js
+++ b/{{cookiecutter.project_slug}}/gulpfile.js
@@ -9,9 +9,7 @@ const pjson = require('./package.json')
// Plugins
const autoprefixer = require('autoprefixer')
const browserSync = require('browser-sync').create()
-{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
const concat = require('gulp-concat')
-{% endif %}
const cssnano = require ('cssnano')
const imagemin = require('gulp-imagemin')
const pixrem = require('pixrem')
@@ -29,13 +27,11 @@ function pathsConfig(appName) {
const vendorsRoot = 'node_modules'
return {
- {%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
bootstrapSass: `${vendorsRoot}/bootstrap/scss`,
vendorsJs: [
`${vendorsRoot}/@popperjs/core/dist/umd/popper.js`,
`${vendorsRoot}/bootstrap/dist/js/bootstrap.js`,
],
- {%- endif %}
app: this.app,
templates: `${this.app}/templates`,
css: `${this.app}/static/css`,
@@ -66,9 +62,7 @@ function styles() {
return src(`${paths.sass}/project.scss`)
.pipe(sass({
includePaths: [
- {%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
paths.bootstrapSass,
- {%- endif %}
paths.sass
]
}).on('error', sass.logError))
@@ -89,7 +83,6 @@ function scripts() {
.pipe(dest(paths.js))
}
-{%- if cookiecutter.custom_bootstrap_compilation == 'y' %}
// Vendor Javascript minification
function vendorScripts() {
return src(paths.vendorsJs)
@@ -100,7 +93,6 @@ function vendorScripts() {
.pipe(rename({ suffix: '.min' }))
.pipe(dest(paths.js))
}
-{%- endif %}
// Image compression
function imgCompression() {
@@ -173,7 +165,7 @@ function watchPaths() {
const generateAssets = parallel(
styles,
scripts,
- {%- if cookiecutter.custom_bootstrap_compilation == 'y' %}vendorScripts,{% endif %}
+ vendorScripts,
imgCompression
)
diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml
index e602ecbd4..246bc6035 100644
--- a/{{cookiecutter.project_slug}}/local.yml
+++ b/{{cookiecutter.project_slug}}/local.yml
@@ -148,7 +148,7 @@ services:
command: /start-flower
{%- endif %}
- {%- if cookiecutter.js_task_runner == 'Gulp' %}
+ {%- if cookiecutter.frontend_pipeline == 'Gulp' %}
node:
build:
diff --git a/{{cookiecutter.project_slug}}/pytest.ini b/{{cookiecutter.project_slug}}/pytest.ini
index e3b2248d9..969c7921e 100644
--- a/{{cookiecutter.project_slug}}/pytest.ini
+++ b/{{cookiecutter.project_slug}}/pytest.ini
@@ -1,6 +1,6 @@
[pytest]
addopts = --ds=config.settings.test --reuse-db
python_files = tests.py test_*.py
-{%- if cookiecutter.js_task_runner != 'None' %}
+{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
norecursedirs = node_modules
{%- endif %}
diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt
index 695a86e1c..d3a6f46f0 100644
--- a/{{cookiecutter.project_slug}}/requirements/base.txt
+++ b/{{cookiecutter.project_slug}}/requirements/base.txt
@@ -1,7 +1,7 @@
pytz==2021.3 # https://github.com/stub42/pytz
python-slugify==6.1.1 # https://github.com/un33k/python-slugify
Pillow==9.0.1 # https://github.com/python-pillow/Pillow
-{%- if cookiecutter.use_compressor == "y" %}
+{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}
rcssmin==1.1.0 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
{%- else %}
@@ -35,11 +35,11 @@ django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.49.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.14.0 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==0.6 # https://github.com/django-crispy-forms/crispy-bootstrap5
-{%- if cookiecutter.use_compressor == "y" %}
+{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
django-compressor==3.1 # https://github.com/django-compressor/django-compressor
{%- endif %}
django-redis==5.2.0 # https://github.com/jazzband/django-redis
-{%- if cookiecutter.use_drf == "y" %}
+{%- if cookiecutter.use_drf == 'y' %}
# Django REST Framework
djangorestframework==3.13.1 # https://github.com/encode/django-rest-framework
django-cors-headers==3.11.0 # https://github.com/adamchainz/django-cors-headers
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss
index 9fbf1b746..370096bb3 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss
@@ -1,8 +1,5 @@
-{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
@import "custom_bootstrap_vars";
@import "bootstrap";
-{% endif %}
-
// project specific CSS goes here
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html
index e5087534d..58aca7208 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html
@@ -1,4 +1,4 @@
-{% raw %}{% load static i18n {% endraw %}{% if cookiecutter.use_compressor == "y" %}compress{% endif %}{% raw %}%}
+{% raw %}{% load static i18n {% endraw %}{% if cookiecutter.frontend_pipeline == 'Django Compressor' %}compress{% endif %}{% raw %}%}
{% get_current_language as LANGUAGE_CODE %}
@@ -12,30 +12,34 @@
{% block css %}
- {%- endraw %}{% if cookiecutter.custom_bootstrap_compilation == "n" %}{% raw %}
+ {%- endraw %}
+ {%- if cookiecutter.frontend_pipeline != 'Gulp' %}
+ {%- raw %}
- {%- endraw %}{% endif %}{% raw %}
-
+ {%- endraw %}
+ {%- endif %}
+ {%- raw %}
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %}
+
- {%- endraw %}{% if cookiecutter.js_task_runner == "Gulp" and cookiecutter.use_compressor == "n" %}{% raw %}
-
- {%- endraw %}{% else %}{% raw %}
+ {%- endraw %}{% if cookiecutter.frontend_pipeline == 'None' %}{% raw %}
+ {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Django Compressor' %}{% raw %}
+ {% compress css %}
+
+ {% endcompress %}
+ {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %}
+
{%- endraw %}{% endif %}{% raw %}
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
{% endblock %}
{# Placed at the top of the document so pages load faster with defer #}
{% block javascript %}
- {%- endraw %}{% if cookiecutter.custom_bootstrap_compilation == "y" and cookiecutter.js_task_runner == "Gulp" %}{% raw %}
+ {%- endraw %}{% if cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %}
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %}
-
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
+
{%- endraw %}{% else %}{% raw %}
@@ -43,9 +47,15 @@
{%- endraw %}{% endif %}{% raw %}
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %}
+ {%- endraw %}{% if cookiecutter.frontend_pipeline == 'None' %}{% raw %}
- {%- endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %}
+ {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Django Compressor' %}{% raw %}
+ {% compress js %}
+
+ {% endcompress %}
+ {%- endraw %}{% elif cookiecutter.frontend_pipeline == 'Gulp' %}{% raw %}
+
+ {%- endraw %}{% endif %}{% raw %}
{% endblock javascript %}