mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-06-03 21:23:17 +03:00
Add more pre-commit hooks (#4266)
* Add more hooks from pre-commit-hooks repo * Add pre-commit hook for prettier * Format with prettier * Remove check-docstring-first hook * Run prettier in the template * Tweak formatting of dependabot file * Fix formatting of GitHub files for prettier * More format fixes of ci.yml
This commit is contained in:
parent
1783257ed3
commit
0dcc4c4b4c
4
.github/CONTRIBUTORS-template.md
vendored
4
.github/CONTRIBUTORS-template.md
vendored
|
@ -22,8 +22,8 @@ accept and merge pull requests.
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
*Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
|
_Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
|
||||||
the Cookiecutter core team.*
|
the Cookiecutter core team._
|
||||||
|
|
||||||
## Other Contributors
|
## Other Contributors
|
||||||
|
|
||||||
|
|
28
.github/ISSUE_TEMPLATE/bug.md
vendored
28
.github/ISSUE_TEMPLATE/bug.md
vendored
|
@ -12,41 +12,47 @@ labels: bug
|
||||||
|
|
||||||
<!-- To assist you best, please include commands that you've run, options you've selected and any relevant logs -->
|
<!-- To assist you best, please include commands that you've run, options you've selected and any relevant logs -->
|
||||||
|
|
||||||
* Host system configuration:
|
- Host system configuration:
|
||||||
* Version of cookiecutter CLI (get it with `cookiecutter --version`):
|
|
||||||
* OS name and version:
|
- Version of cookiecutter CLI (get it with `cookiecutter --version`):
|
||||||
|
- OS name and version:
|
||||||
|
|
||||||
On Linux, run
|
On Linux, run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
lsb_release -a 2> /dev/null || cat /etc/redhat-release 2> /dev/null || cat /etc/*-release 2> /dev/null || cat /etc/issue 2> /dev/null
|
lsb_release -a 2> /dev/null || cat /etc/redhat-release 2> /dev/null || cat /etc/*-release 2> /dev/null || cat /etc/issue 2> /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
On MacOs, run
|
On MacOs, run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sw_vers
|
sw_vers
|
||||||
```
|
```
|
||||||
|
|
||||||
On Windows, via CMD, run
|
On Windows, via CMD, run
|
||||||
|
|
||||||
```
|
```
|
||||||
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
|
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Insert here the OS name and version
|
# Insert here the OS name and version
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Python version, run `python3 -V`:
|
- Python version, run `python3 -V`:
|
||||||
* Docker version (if using Docker), run `docker --version`:
|
- Docker version (if using Docker), run `docker --version`:
|
||||||
* docker-compose version (if using Docker), run `docker-compose --version`:
|
- docker-compose version (if using Docker), run `docker-compose --version`:
|
||||||
* ...
|
- ...
|
||||||
* Options selected and/or [replay file](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html):
|
|
||||||
On Linux and MacOS: `cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json`
|
- Options selected and/or [replay file](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html):
|
||||||
|
On Linux and macOS: `cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json`
|
||||||
(Please, take care to remove sensitive information)
|
(Please, take care to remove sensitive information)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
# Insert here the replay file content
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<summary>
|
<summary>
|
||||||
Logs:
|
Logs:
|
||||||
<details>
|
<details>
|
||||||
|
|
6
.github/ISSUE_TEMPLATE/paid-support.md
vendored
6
.github/ISSUE_TEMPLATE/paid-support.md
vendored
|
@ -5,8 +5,8 @@ about: Ask Core Team members to help you out
|
||||||
|
|
||||||
Provided your question goes beyond [regular support](https://github.com/cookiecutter/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly.
|
Provided your question goes beyond [regular support](https://github.com/cookiecutter/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly.
|
||||||
|
|
||||||
* Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB.
|
- Bruno Alla, Core Developer ([GitHub](https://github.com/sponsors/browniebroke)).
|
||||||
|
|
||||||
* Nikita Shupeyko, Core Developer ([GitHub](https://github.com/webyneter)): expertise in Python/Django, hands-on DevOps and frontend experience.
|
- Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB.
|
||||||
|
|
||||||
* Bruno Alla, Core Developer ([GitHub](https://github.com/sponsors/browniebroke)).
|
- Nikita Shupeyko, Core Developer ([GitHub](https://github.com/webyneter)): expertise in Python/Django, hands-on DevOps and frontend experience.
|
||||||
|
|
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -1,6 +1,5 @@
|
||||||
<!-- Thank you for helping us out: your efforts mean a great deal to the project and the community as a whole! -->
|
<!-- Thank you for helping us out: your efforts mean a great deal to the project and the community as a whole! -->
|
||||||
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
<!-- What's it you're proposing? -->
|
<!-- What's it you're proposing? -->
|
||||||
|
|
3
.github/changelog-template.md
vendored
3
.github/changelog-template.md
vendored
|
@ -1,7 +1,10 @@
|
||||||
{%- for change_type, pulls in grouped_pulls.items() %}
|
{%- for change_type, pulls in grouped_pulls.items() %}
|
||||||
{%- if pulls %}
|
{%- if pulls %}
|
||||||
|
|
||||||
### {{ change_type }}
|
### {{ change_type }}
|
||||||
|
|
||||||
{%- for pull_request in pulls %}
|
{%- for pull_request in pulls %}
|
||||||
|
|
||||||
- {{ pull_request.title }} ([#{{ pull_request.number }}]({{ pull_request.html_url }}))
|
- {{ pull_request.title }} ([#{{ pull_request.number }}]({{ pull_request.html_url }}))
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
|
@ -29,7 +29,9 @@ updates:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- "version-update:semver-major"
|
||||||
|
- "version-update:semver-minor"
|
||||||
labels:
|
labels:
|
||||||
- "update"
|
- "update"
|
||||||
|
|
||||||
|
@ -39,7 +41,9 @@ updates:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- "version-update:semver-major"
|
||||||
|
- "version-update:semver-minor"
|
||||||
labels:
|
labels:
|
||||||
- "update"
|
- "update"
|
||||||
|
|
||||||
|
@ -63,7 +67,9 @@ updates:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- "version-update:semver-major"
|
||||||
|
- "version-update:semver-minor"
|
||||||
labels:
|
labels:
|
||||||
- "update"
|
- "update"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
exclude: "{{cookiecutter.project_slug}}"
|
exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md"
|
||||||
default_stages: [commit]
|
default_stages: [commit]
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
|
@ -6,7 +6,21 @@ repos:
|
||||||
rev: v4.4.0
|
rev: v4.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-json
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-xml
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
|
- id: debug-statements
|
||||||
|
- id: check-builtin-literals
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: detect-private-key
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
rev: "v3.0.0-alpha.6"
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
args: ["--tab-width", "2"]
|
||||||
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.3.1
|
rev: v3.3.1
|
||||||
|
|
|
@ -76,8 +76,8 @@ accept and merge pull requests.
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
*Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
|
_Audrey is also the creator of Cookiecutter. Audrey and Daniel are on
|
||||||
the Cookiecutter core team.*
|
the Cookiecutter core team._
|
||||||
|
|
||||||
## Other Contributors
|
## Other Contributors
|
||||||
|
|
||||||
|
|
13
README.md
13
README.md
|
@ -41,7 +41,7 @@ production-ready Django projects quickly.
|
||||||
|
|
||||||
## Optional Integrations
|
## Optional Integrations
|
||||||
|
|
||||||
*These features can be enabled during initial project setup.*
|
_These features can be enabled during initial project setup._
|
||||||
|
|
||||||
- Serve static files from Amazon S3, Google Cloud Storage, Azure Storage or [Whitenoise](https://whitenoise.readthedocs.io/)
|
- Serve static files from Amazon S3, Google Cloud Storage, Azure Storage or [Whitenoise](https://whitenoise.readthedocs.io/)
|
||||||
- Configuration for [Celery](https://docs.celeryq.dev) and [Flower](https://github.com/mher/flower) (the latter in Docker setup only)
|
- Configuration for [Celery](https://docs.celeryq.dev) and [Flower](https://github.com/mher/flower) (the latter in Docker setup only)
|
||||||
|
@ -63,7 +63,7 @@ This project is run by volunteers. Please support them in their efforts to maint
|
||||||
|
|
||||||
Projects that provide financial support to the maintainers:
|
Projects that provide financial support to the maintainers:
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
---
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://www.feldroy.com/products//two-scoops-of-django-3-x"><img src="https://cdn.shopify.com/s/files/1/0304/6901/products/Two-Scoops-of-Django-3-Alpha-Cover_540x_26507b15-e489-470b-8a97-02773dd498d1_1080x.jpg"></a>
|
<a href="https://www.feldroy.com/products//two-scoops-of-django-3-x"><img src="https://cdn.shopify.com/s/files/1/0304/6901/products/Two-Scoops-of-Django-3-Alpha-Cover_540x_26507b15-e489-470b-8a97-02773dd498d1_1080x.jpg"></a>
|
||||||
|
@ -193,7 +193,7 @@ For local development, see the following:
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
||||||
- Have questions? **Before you ask questions anywhere else**, please post your question on [Stack Overflow](http://stackoverflow.com/questions/tagged/cookiecutter-django) under the *cookiecutter-django* tag. We check there periodically for questions.
|
- Have questions? **Before you ask questions anywhere else**, please post your question on [Stack Overflow](http://stackoverflow.com/questions/tagged/cookiecutter-django) under the _cookiecutter-django_ tag. We check there periodically for questions.
|
||||||
- If you think you found a bug or want to request a feature, please open an [issue](https://github.com/cookiecutter/cookiecutter-django/issues).
|
- If you think you found a bug or want to request a feature, please open an [issue](https://github.com/cookiecutter/cookiecutter-django/issues).
|
||||||
- For anything else, you can chat with us on [Discord](https://discord.gg/uFXweDQc5a).
|
- For anything else, you can chat with us on [Discord](https://discord.gg/uFXweDQc5a).
|
||||||
|
|
||||||
|
@ -203,13 +203,14 @@ You may notice that some elements of this project do not exactly match what we d
|
||||||
|
|
||||||
## For PyUp Users
|
## For PyUp Users
|
||||||
|
|
||||||
If you are using [PyUp](https://pyup.io) to keep your dependencies updated and secure, use the code *cookiecutter* during checkout to get 15% off every month.
|
If you are using [PyUp](https://pyup.io) to keep your dependencies updated and secure, use the code _cookiecutter_ during checkout to get 15% off every month.
|
||||||
|
|
||||||
## "Your Stuff"
|
## "Your Stuff"
|
||||||
|
|
||||||
Scattered throughout the Python and HTML of this project are places marked with "your stuff". This is where third-party libraries are to be integrated with your project.
|
Scattered throughout the Python and HTML of this project are places marked with "your stuff". This is where third-party libraries are to be integrated with your project.
|
||||||
|
|
||||||
## For MySQL users
|
## For MySQL users
|
||||||
|
|
||||||
To get full MySQL support in addition to the default Postgresql, you can use this fork of the cookiecutter-django:
|
To get full MySQL support in addition to the default Postgresql, you can use this fork of the cookiecutter-django:
|
||||||
https://github.com/mabdullahadeel/cookiecutter-django-mysql
|
https://github.com/mabdullahadeel/cookiecutter-django-mysql
|
||||||
|
|
||||||
|
@ -219,12 +220,12 @@ Need a stable release? You can find them at <https://github.com/cookiecutter/coo
|
||||||
|
|
||||||
## Not Exactly What You Want?
|
## Not Exactly What You Want?
|
||||||
|
|
||||||
This is what I want. *It might not be what you want.* Don't worry, you have options:
|
This is what I want. _It might not be what you want._ Don't worry, you have options:
|
||||||
|
|
||||||
### Fork This
|
### Fork This
|
||||||
|
|
||||||
If you have differences in your preferred setup, I encourage you to fork this to create your own version.
|
If you have differences in your preferred setup, I encourage you to fork this to create your own version.
|
||||||
Once you have your fork working, let me know and I'll add it to a '*Similar Cookiecutter Templates*' list here.
|
Once you have your fork working, let me know and I'll add it to a '_Similar Cookiecutter Templates_' list here.
|
||||||
It's up to you whether to rename your fork.
|
It's up to you whether to rename your fork.
|
||||||
|
|
||||||
If you do rename your fork, I encourage you to submit it to the following places:
|
If you do rename your fork, I encourage you to submit it to the following places:
|
||||||
|
|
|
@ -18,19 +18,8 @@
|
||||||
"windows": "n",
|
"windows": "n",
|
||||||
"use_pycharm": "n",
|
"use_pycharm": "n",
|
||||||
"use_docker": "n",
|
"use_docker": "n",
|
||||||
"postgresql_version": [
|
"postgresql_version": ["14", "13", "12", "11", "10"],
|
||||||
"14",
|
"cloud_provider": ["AWS", "GCP", "Azure", "None"],
|
||||||
"13",
|
|
||||||
"12",
|
|
||||||
"11",
|
|
||||||
"10"
|
|
||||||
],
|
|
||||||
"cloud_provider": [
|
|
||||||
"AWS",
|
|
||||||
"GCP",
|
|
||||||
"Azure",
|
|
||||||
"None"
|
|
||||||
],
|
|
||||||
"mail_service": [
|
"mail_service": [
|
||||||
"Mailgun",
|
"Mailgun",
|
||||||
"Amazon SES",
|
"Amazon SES",
|
||||||
|
@ -44,23 +33,13 @@
|
||||||
],
|
],
|
||||||
"use_async": "n",
|
"use_async": "n",
|
||||||
"use_drf": "n",
|
"use_drf": "n",
|
||||||
"frontend_pipeline": [
|
"frontend_pipeline": ["None", "Django Compressor", "Gulp", "Webpack"],
|
||||||
"None",
|
|
||||||
"Django Compressor",
|
|
||||||
"Gulp",
|
|
||||||
"Webpack"
|
|
||||||
],
|
|
||||||
"use_celery": "n",
|
"use_celery": "n",
|
||||||
"use_mailhog": "n",
|
"use_mailhog": "n",
|
||||||
"use_sentry": "n",
|
"use_sentry": "n",
|
||||||
"use_whitenoise": "n",
|
"use_whitenoise": "n",
|
||||||
"use_heroku": "n",
|
"use_heroku": "n",
|
||||||
"ci_tool": [
|
"ci_tool": ["None", "Travis", "Gitlab", "Github"],
|
||||||
"None",
|
|
||||||
"Travis",
|
|
||||||
"Gitlab",
|
|
||||||
"Github"
|
|
||||||
],
|
|
||||||
"keep_local_envs_in_vcs": "y",
|
"keep_local_envs_in_vcs": "y",
|
||||||
"debug": "n"
|
"debug": "n"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,3 @@ Generate a new cookiecutter-django project: ::
|
||||||
|
|
||||||
For more information refer to
|
For more information refer to
|
||||||
:ref:`Project Generation Options <template-options>`.
|
:ref:`Project Generation Options <template-options>`.
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
# Update GitHub actions in workflows
|
# Update GitHub actions in workflows
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: 'github-actions'
|
||||||
directory: "/"
|
directory: '/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
{%- if cookiecutter.use_docker == 'y' %}
|
{%- if cookiecutter.use_docker == 'y' %}
|
||||||
|
|
||||||
|
@ -16,86 +16,92 @@ updates:
|
||||||
# We need to specify each Dockerfile in a separate entry because Dependabot doesn't
|
# We need to specify each Dockerfile in a separate entry because Dependabot doesn't
|
||||||
# support wildcards or recursively checking subdirectories. Check this issue for updates:
|
# support wildcards or recursively checking subdirectories. Check this issue for updates:
|
||||||
# https://github.com/dependabot/dependabot-core/issues/2178
|
# https://github.com/dependabot/dependabot-core/issues/2178
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/local/django` directory
|
# Look for a `Dockerfile` in the `compose/local/django` directory
|
||||||
directory: "compose/local/django/"
|
directory: 'compose/local/django/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: '*'
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- 'version-update:semver-major'
|
||||||
|
- 'version-update:semver-minor'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/local/docs` directory
|
# Look for a `Dockerfile` in the `compose/local/docs` directory
|
||||||
directory: "compose/local/docs/"
|
directory: 'compose/local/docs/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: '*'
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- 'version-update:semver-major'
|
||||||
|
- 'version-update:semver-minor'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/local/node` directory
|
# Look for a `Dockerfile` in the `compose/local/node` directory
|
||||||
directory: "compose/local/node/"
|
directory: 'compose/local/node/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/production/aws` directory
|
# Look for a `Dockerfile` in the `compose/production/aws` directory
|
||||||
directory: "compose/production/aws/"
|
directory: 'compose/production/aws/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/production/django` directory
|
# Look for a `Dockerfile` in the `compose/production/django` directory
|
||||||
directory: "compose/production/django/"
|
directory: 'compose/production/django/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: '*'
|
||||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
update-types:
|
||||||
|
- 'version-update:semver-major'
|
||||||
|
- 'version-update:semver-minor'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/production/postgres` directory
|
# Look for a `Dockerfile` in the `compose/production/postgres` directory
|
||||||
directory: "compose/production/postgres/"
|
directory: 'compose/production/postgres/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: 'docker'
|
||||||
# Look for a `Dockerfile` in the `compose/production/traefik` directory
|
# Look for a `Dockerfile` in the `compose/production/traefik` directory
|
||||||
directory: "compose/production/traefik/"
|
directory: 'compose/production/traefik/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# Enable version updates for Python/Pip - Production
|
# Enable version updates for Python/Pip - Production
|
||||||
- package-ecosystem: "pip"
|
- package-ecosystem: 'pip'
|
||||||
# Look for a `requirements.txt` in the `root` directory
|
# Look for a `requirements.txt` in the `root` directory
|
||||||
# also 'setup.cfg', 'runtime.txt' and 'requirements/*.txt'
|
# also 'setup.cfg', 'runtime.txt' and 'requirements/*.txt'
|
||||||
directory: "/"
|
directory: '/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
||||||
|
|
||||||
# Enable version updates for javascript/npm
|
# Enable version updates for javascript/npm
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: 'npm'
|
||||||
# Look for a `packages.json` in the `root` directory
|
# Look for a `packages.json` in the `root` directory
|
||||||
directory: "/"
|
directory: '/'
|
||||||
# Every weekday
|
# Every weekday
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: 'daily'
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -7,12 +7,12 @@ env:
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master", "main" ]
|
branches: ['master', 'main']
|
||||||
paths-ignore: [ "docs/**" ]
|
paths-ignore: ['docs/**']
|
||||||
|
|
||||||
push:
|
push:
|
||||||
branches: [ "master", "main" ]
|
branches: ['master', 'main']
|
||||||
paths-ignore: [ "docs/**" ]
|
paths-ignore: ['docs/**']
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: {% raw %}${{ github.head_ref || github.run_id }}{% endraw %}
|
group: {% raw %}${{ github.head_ref || github.run_id }}{% endraw %}
|
||||||
|
@ -22,14 +22,13 @@ jobs:
|
||||||
linter:
|
linter:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout Code Repository
|
- name: Checkout Code Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: '3.11'
|
||||||
|
|
||||||
{%- if cookiecutter.open_source_license != 'Not open source' %}
|
{%- if cookiecutter.open_source_license != 'Not open source' %}
|
||||||
# Consider using pre-commit.ci for open source project
|
# Consider using pre-commit.ci for open source project
|
||||||
|
@ -58,14 +57,13 @@ jobs:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
CELERY_BROKER_URL: "redis://localhost:6379/0"
|
CELERY_BROKER_URL: 'redis://localhost:6379/0'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
# postgres://user:password@host:port/database
|
# postgres://user:password@host:port/database
|
||||||
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
|
DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/postgres'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout Code Repository
|
- name: Checkout Code Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
{%- if cookiecutter.use_docker == 'y' %}
|
{%- if cookiecutter.use_docker == 'y' %}
|
||||||
|
@ -86,7 +84,7 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: '3.11'
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
requirements/base.txt
|
requirements/base.txt
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
exclude: "^docs/|/migrations/"
|
exclude: '^docs/|/migrations/'
|
||||||
default_stages: [commit]
|
default_stages: [commit]
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
|
@ -7,7 +7,22 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
- id: check-json
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-xml
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
|
- id: debug-statements
|
||||||
|
- id: check-builtin-literals
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-docstring-first
|
||||||
|
- id: detect-private-key
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
rev: v3.0.0-alpha.6
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
args: ['--tab-width', '2', '--single-quote']
|
||||||
|
exclude: {{cookiecutter.project_slug}}/templates/
|
||||||
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.3.1
|
rev: v3.3.1
|
||||||
|
@ -29,7 +44,7 @@ repos:
|
||||||
rev: 6.0.0
|
rev: 6.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
args: ["--config=setup.cfg"]
|
args: ['--config=setup.cfg']
|
||||||
additional_dependencies: [flake8-isort]
|
additional_dependencies: [flake8-isort]
|
||||||
|
|
||||||
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
|
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
|
||||||
|
|
|
@ -8,7 +8,7 @@ version: 2
|
||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.11"
|
python: '3.11'
|
||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
|
|
|
@ -61,7 +61,7 @@ cd {{cookiecutter.project_slug}}
|
||||||
celery -A config.celery_app worker -l info
|
celery -A config.celery_app worker -l info
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right.
|
Please note: For Celery's import magic to work, it is important _where_ the celery commands are run. If you are in the same folder with _manage.py_, you should be right.
|
||||||
|
|
||||||
To run [periodic tasks](https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html), you'll need to start the celery beat scheduler service. You can start it as a standalone process:
|
To run [periodic tasks](https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html), you'll need to start the celery beat scheduler service. You can start it as a standalone process:
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ log:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
web:
|
web:
|
||||||
# http
|
# http
|
||||||
address: ":80"
|
address: ':80'
|
||||||
http:
|
http:
|
||||||
# https://docs.traefik.io/routing/entrypoints/#entrypoint
|
# https://docs.traefik.io/routing/entrypoints/#entrypoint
|
||||||
redirections:
|
redirections:
|
||||||
|
@ -13,18 +13,18 @@ entryPoints:
|
||||||
|
|
||||||
web-secure:
|
web-secure:
|
||||||
# https
|
# https
|
||||||
address: ":443"
|
address: ':443'
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
flower:
|
flower:
|
||||||
address: ":5555"
|
address: ':5555'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
certificatesResolvers:
|
certificatesResolvers:
|
||||||
letsencrypt:
|
letsencrypt:
|
||||||
# https://docs.traefik.io/master/https/acme/#lets-encrypt
|
# https://docs.traefik.io/master/https/acme/#lets-encrypt
|
||||||
acme:
|
acme:
|
||||||
email: "{{ cookiecutter.email }}"
|
email: '{{ cookiecutter.email }}'
|
||||||
storage: /etc/traefik/acme/acme.json
|
storage: /etc/traefik/acme/acme.json
|
||||||
# https://docs.traefik.io/master/https/acme/#httpchallenge
|
# https://docs.traefik.io/master/https/acme/#httpchallenge
|
||||||
httpChallenge:
|
httpChallenge:
|
||||||
|
@ -34,9 +34,9 @@ http:
|
||||||
routers:
|
routers:
|
||||||
web-secure-router:
|
web-secure-router:
|
||||||
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
||||||
rule: "Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)"
|
rule: 'Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)'
|
||||||
{%- else %}
|
{%- else %}
|
||||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
rule: 'Host(`{{ cookiecutter.domain_name }}`)'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- web-secure
|
- web-secure
|
||||||
|
@ -49,7 +49,7 @@ http:
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
flower-secure-router:
|
flower-secure-router:
|
||||||
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
rule: 'Host(`{{ cookiecutter.domain_name }}`)'
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- flower
|
- flower
|
||||||
service: flower
|
service: flower
|
||||||
|
@ -61,9 +61,9 @@ http:
|
||||||
|
|
||||||
web-media-router:
|
web-media-router:
|
||||||
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
{%- if cookiecutter.domain_name.count('.') == 1 %}
|
||||||
rule: "(Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)) && PathPrefix(`/media/`)"
|
rule: '(Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)) && PathPrefix(`/media/`)'
|
||||||
{%- else %}
|
{%- else %}
|
||||||
rule: "Host(`{{ cookiecutter.domain_name }}`) && PathPrefix(`/media/`)"
|
rule: 'Host(`{{ cookiecutter.domain_name }}`) && PathPrefix(`/media/`)'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- web-secure
|
- web-secure
|
||||||
|
@ -79,7 +79,7 @@ http:
|
||||||
# https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
|
# https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
|
||||||
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
|
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
|
||||||
headers:
|
headers:
|
||||||
hostsProxyHeaders: ["X-CSRFToken"]
|
hostsProxyHeaders: ['X-CSRFToken']
|
||||||
|
|
||||||
services:
|
services:
|
||||||
django:
|
django:
|
||||||
|
|
|
@ -3,29 +3,29 @@
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
|
|
||||||
// Gulp and package
|
// Gulp and package
|
||||||
const { src, dest, parallel, series, watch } = require('gulp')
|
const { src, dest, parallel, series, watch } = require('gulp');
|
||||||
const pjson = require('./package.json')
|
const pjson = require('./package.json');
|
||||||
|
|
||||||
// Plugins
|
// Plugins
|
||||||
const autoprefixer = require('autoprefixer')
|
const autoprefixer = require('autoprefixer');
|
||||||
const browserSync = require('browser-sync').create()
|
const browserSync = require('browser-sync').create();
|
||||||
const concat = require('gulp-concat')
|
const concat = require('gulp-concat');
|
||||||
const tildeImporter = require('node-sass-tilde-importer');
|
const tildeImporter = require('node-sass-tilde-importer');
|
||||||
const cssnano = require ('cssnano')
|
const cssnano = require('cssnano');
|
||||||
const imagemin = require('gulp-imagemin')
|
const imagemin = require('gulp-imagemin');
|
||||||
const pixrem = require('pixrem')
|
const pixrem = require('pixrem');
|
||||||
const plumber = require('gulp-plumber')
|
const plumber = require('gulp-plumber');
|
||||||
const postcss = require('gulp-postcss')
|
const postcss = require('gulp-postcss');
|
||||||
const reload = browserSync.reload
|
const reload = browserSync.reload;
|
||||||
const rename = require('gulp-rename')
|
const rename = require('gulp-rename');
|
||||||
const sass = require('gulp-sass')(require('sass'))
|
const sass = require('gulp-sass')(require('sass'));
|
||||||
const spawn = require('child_process').spawn
|
const spawn = require('child_process').spawn;
|
||||||
const uglify = require('gulp-uglify-es').default
|
const uglify = require('gulp-uglify-es').default;
|
||||||
|
|
||||||
// Relative paths function
|
// Relative paths function
|
||||||
function pathsConfig(appName) {
|
function pathsConfig(appName) {
|
||||||
this.app = `./${pjson.name}`
|
this.app = `./${pjson.name}`;
|
||||||
const vendorsRoot = 'node_modules'
|
const vendorsRoot = 'node_modules';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
vendorsJs: [
|
vendorsJs: [
|
||||||
|
@ -39,10 +39,10 @@ function pathsConfig(appName) {
|
||||||
fonts: `${this.app}/static/fonts`,
|
fonts: `${this.app}/static/fonts`,
|
||||||
images: `${this.app}/static/images`,
|
images: `${this.app}/static/images`,
|
||||||
js: `${this.app}/static/js`,
|
js: `${this.app}/static/js`,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const paths = pathsConfig()
|
const paths = pathsConfig();
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
// Tasks
|
// Tasks
|
||||||
|
@ -53,25 +53,25 @@ function styles() {
|
||||||
const processCss = [
|
const processCss = [
|
||||||
autoprefixer(), // adds vendor prefixes
|
autoprefixer(), // adds vendor prefixes
|
||||||
pixrem(), // add fallbacks for rem units
|
pixrem(), // add fallbacks for rem units
|
||||||
]
|
];
|
||||||
|
|
||||||
const minifyCss = [
|
const minifyCss = [
|
||||||
cssnano({ preset: 'default' }) // minify result
|
cssnano({ preset: 'default' }), // minify result
|
||||||
]
|
];
|
||||||
|
|
||||||
return src(`${paths.sass}/project.scss`)
|
return src(`${paths.sass}/project.scss`)
|
||||||
.pipe(sass({
|
.pipe(
|
||||||
|
sass({
|
||||||
importer: tildeImporter,
|
importer: tildeImporter,
|
||||||
includePaths: [
|
includePaths: [paths.sass],
|
||||||
paths.sass
|
}).on('error', sass.logError),
|
||||||
]
|
)
|
||||||
}).on('error', sass.logError))
|
|
||||||
.pipe(plumber()) // Checks for errors
|
.pipe(plumber()) // Checks for errors
|
||||||
.pipe(postcss(processCss))
|
.pipe(postcss(processCss))
|
||||||
.pipe(dest(paths.css))
|
.pipe(dest(paths.css))
|
||||||
.pipe(rename({ suffix: '.min' }))
|
.pipe(rename({ suffix: '.min' }))
|
||||||
.pipe(postcss(minifyCss)) // Minifies the result
|
.pipe(postcss(minifyCss)) // Minifies the result
|
||||||
.pipe(dest(paths.css))
|
.pipe(dest(paths.css));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Javascript minification
|
// Javascript minification
|
||||||
|
@ -80,7 +80,7 @@ function scripts() {
|
||||||
.pipe(plumber()) // Checks for errors
|
.pipe(plumber()) // Checks for errors
|
||||||
.pipe(uglify()) // Minifies the js
|
.pipe(uglify()) // Minifies the js
|
||||||
.pipe(rename({ suffix: '.min' }))
|
.pipe(rename({ suffix: '.min' }))
|
||||||
.pipe(dest(paths.js))
|
.pipe(dest(paths.js));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vendor Javascript minification
|
// Vendor Javascript minification
|
||||||
|
@ -91,46 +91,44 @@ function vendorScripts() {
|
||||||
.pipe(plumber()) // Checks for errors
|
.pipe(plumber()) // Checks for errors
|
||||||
.pipe(uglify()) // Minifies the js
|
.pipe(uglify()) // Minifies the js
|
||||||
.pipe(rename({ suffix: '.min' }))
|
.pipe(rename({ suffix: '.min' }))
|
||||||
.pipe(dest(paths.js, { sourcemaps: '.' }))
|
.pipe(dest(paths.js, { sourcemaps: '.' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image compression
|
// Image compression
|
||||||
function imgCompression() {
|
function imgCompression() {
|
||||||
return src(`${paths.images}/*`)
|
return src(`${paths.images}/*`)
|
||||||
.pipe(imagemin()) // Compresses PNG, JPEG, GIF and SVG images
|
.pipe(imagemin()) // Compresses PNG, JPEG, GIF and SVG images
|
||||||
.pipe(dest(paths.images))
|
.pipe(dest(paths.images));
|
||||||
}
|
}
|
||||||
|
|
||||||
{%- if cookiecutter.use_async == 'y' -%}
|
{%- if cookiecutter.use_async == 'y' -%}
|
||||||
// Run django server
|
// Run django server
|
||||||
function asyncRunServer() {
|
function asyncRunServer() {
|
||||||
const cmd = spawn('gunicorn', [
|
const cmd = spawn(
|
||||||
'config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'
|
'gunicorn',
|
||||||
], {stdio: 'inherit'}
|
['config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'],
|
||||||
)
|
{stdio: 'inherit'},
|
||||||
|
);
|
||||||
cmd.on('close', function (code) {
|
cmd.on('close', function (code) {
|
||||||
console.log('gunicorn exited with code ' + code)
|
console.log('gunicorn exited with code ' + code);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
// Run django server
|
// Run django server
|
||||||
function runServer(cb) {
|
function runServer(cb) {
|
||||||
const cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'})
|
const cmd = spawn('python', ['manage.py', 'runserver'], { stdio: 'inherit' });
|
||||||
cmd.on('close', function (code) {
|
cmd.on('close', function (code) {
|
||||||
console.log('runServer exited with code ' + code)
|
console.log('runServer exited with code ' + code);
|
||||||
cb(code)
|
cb(code);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
// Browser sync server for live reload
|
// Browser sync server for live reload
|
||||||
function initBrowserSync() {
|
function initBrowserSync() {
|
||||||
browserSync.init(
|
browserSync.init(
|
||||||
[
|
[`${paths.css}/*.css`, `${paths.js}/*.js`, `${paths.templates}/*.html`],
|
||||||
`${paths.css}/*.css`,
|
{
|
||||||
`${paths.js}/*.js`,
|
|
||||||
`${paths.templates}/*.html`
|
|
||||||
], {
|
|
||||||
{%- if cookiecutter.use_docker == 'y' %}
|
{%- if cookiecutter.use_docker == 'y' %}
|
||||||
// https://www.browsersync.io/docs/options/#option-open
|
// https://www.browsersync.io/docs/options/#option-open
|
||||||
// Disable as it doesn't work from inside a container
|
// Disable as it doesn't work from inside a container
|
||||||
|
@ -145,43 +143,39 @@ function initBrowserSync() {
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
proxyReq: [
|
proxyReq: [
|
||||||
function (proxyReq, req) {
|
function (proxyReq, req) {
|
||||||
// Assign proxy "host" header same as current request at Browsersync server
|
// Assign proxy 'host' header same as current request at Browsersync server
|
||||||
proxyReq.setHeader('Host', req.headers.host)
|
proxyReq.setHeader('Host', req.headers.host);
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
function watchPaths() {
|
function watchPaths() {
|
||||||
watch(`${paths.sass}/*.scss`{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}, styles)
|
watch(`${paths.sass}/*.scss`{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}, styles);
|
||||||
watch(`${paths.templates}/**/*.html`{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}).on("change", reload)
|
watch(`${paths.templates}/**/*.html`{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}).on('change', reload);
|
||||||
watch([`${paths.js}/*.js`, `!${paths.js}/*.min.js`]{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}, scripts).on("change", reload)
|
watch([`${paths.js}/*.js`, `!${paths.js}/*.min.js`]{% if cookiecutter.windows == 'y' %}, { usePolling: true }{% endif %}, scripts).on(
|
||||||
|
'change',
|
||||||
|
reload,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate all assets
|
// Generate all assets
|
||||||
const generateAssets = parallel(
|
const generateAssets = parallel(styles, scripts, vendorScripts, imgCompression);
|
||||||
styles,
|
|
||||||
scripts,
|
|
||||||
vendorScripts,
|
|
||||||
imgCompression
|
|
||||||
)
|
|
||||||
|
|
||||||
// Set up dev environment
|
// Set up dev environment
|
||||||
const dev = parallel(
|
|
||||||
{%- if cookiecutter.use_docker == 'n' %}
|
{%- if cookiecutter.use_docker == 'n' %}
|
||||||
{%- if cookiecutter.use_async == 'y' %}
|
{%- if cookiecutter.use_async == 'y' %}
|
||||||
asyncRunServer,
|
const dev = parallel(asyncRunServer, initBrowserSync, watchPaths);
|
||||||
{%- else %}
|
{%- else %}
|
||||||
runServer,
|
const dev = parallel(runServer, initBrowserSync, watchPaths);
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- else %}
|
||||||
|
const dev = parallel(initBrowserSync, watchPaths);
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
initBrowserSync,
|
|
||||||
watchPaths
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.default = series(generateAssets, dev)
|
exports.default = series(generateAssets, dev);
|
||||||
exports["generate-assets"] = generateAssets
|
exports['generate-assets'] = generateAssets;
|
||||||
exports["dev"] = dev
|
exports['dev'] = dev;
|
||||||
|
|
|
@ -25,7 +25,7 @@ services:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- '8000:8000'
|
||||||
command: /start
|
command: /start
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
|
@ -53,7 +53,7 @@ services:
|
||||||
- ./config:/app/config:z
|
- ./config:/app/config:z
|
||||||
- ./{{ cookiecutter.project_slug }}:/app/{{ cookiecutter.project_slug }}:z
|
- ./{{ cookiecutter.project_slug }}:/app/{{ cookiecutter.project_slug }}:z
|
||||||
ports:
|
ports:
|
||||||
- "9000:9000"
|
- '9000:9000'
|
||||||
command: /start-docs
|
command: /start-docs
|
||||||
{%- if cookiecutter.use_mailhog == 'y' %}
|
{%- if cookiecutter.use_mailhog == 'y' %}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ services:
|
||||||
image: {{ cookiecutter.project_slug }}_local_flower
|
image: {{ cookiecutter.project_slug }}_local_flower
|
||||||
container_name: {{ cookiecutter.project_slug }}_local_flower
|
container_name: {{ cookiecutter.project_slug }}_local_flower
|
||||||
ports:
|
ports:
|
||||||
- "5555:5555"
|
- '5555:5555'
|
||||||
command: /start-flower
|
command: /start-flower
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -121,10 +121,10 @@ services:
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
command: npm run dev
|
command: npm run dev
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- '3000:3000'
|
||||||
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
||||||
# Expose browsersync UI: https://www.browsersync.io/docs/options/#option-ui
|
# Expose browsersync UI: https://www.browsersync.io/docs/options/#option-ui
|
||||||
- "3001:3001"
|
- '3001:3001'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -60,10 +60,10 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- production_traefik:/etc/traefik/acme
|
- production_traefik:/etc/traefik/acme
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:80:80"
|
- '0.0.0.0:80:80'
|
||||||
- "0.0.0.0:443:443"
|
- '0.0.0.0:443:443'
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
- "0.0.0.0:5555:5555"
|
- '0.0.0.0:5555:5555'
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|
|
@ -3,20 +3,25 @@ const BundleTracker = require('webpack-bundle-tracker');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
target: "web",
|
target: 'web',
|
||||||
context: path.join(__dirname, '../'),
|
context: path.join(__dirname, '../'),
|
||||||
entry: {
|
entry: {
|
||||||
'project': path.resolve(__dirname, '../{{cookiecutter.project_slug}}/static/js/project'),
|
project: path.resolve(__dirname, '../{{cookiecutter.project_slug}}/static/js/project'),
|
||||||
'vendors': path.resolve(__dirname, '../{{cookiecutter.project_slug}}/static/js/vendors'),
|
vendors: path.resolve(__dirname, '../{{cookiecutter.project_slug}}/static/js/vendors'),
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, '../{{cookiecutter.project_slug}}/static/webpack_bundles/'),
|
path: path.resolve(
|
||||||
|
__dirname,
|
||||||
|
'../{{cookiecutter.project_slug}}/static/webpack_bundles/',
|
||||||
|
),
|
||||||
publicPath: '/static/webpack_bundles/',
|
publicPath: '/static/webpack_bundles/',
|
||||||
filename: 'js/[name]-[fullhash].js',
|
filename: 'js/[name]-[fullhash].js',
|
||||||
chunkFilename: 'js/[name]-[hash].js',
|
chunkFilename: 'js/[name]-[hash].js',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new BundleTracker({filename: path.resolve(__dirname, '../webpack-stats.json')}),
|
new BundleTracker({
|
||||||
|
filename: path.resolve(__dirname, '../webpack-stats.json'),
|
||||||
|
}),
|
||||||
new MiniCssExtractPlugin({ filename: 'css/[name].[contenthash].css' }),
|
new MiniCssExtractPlugin({ filename: 'css/[name].[contenthash].css' }),
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
|
@ -35,11 +40,7 @@ module.exports = {
|
||||||
loader: 'postcss-loader',
|
loader: 'postcss-loader',
|
||||||
options: {
|
options: {
|
||||||
postcssOptions: {
|
postcssOptions: {
|
||||||
plugins: [
|
plugins: ['postcss-preset-env', 'autoprefixer', 'pixrem'],
|
||||||
'postcss-preset-env',
|
|
||||||
'autoprefixer',
|
|
||||||
'pixrem',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,8 +5,8 @@ const commonConfig = require('./common.config');
|
||||||
{%- if cookiecutter.use_whitenoise == 'n' %}
|
{%- if cookiecutter.use_whitenoise == 'n' %}
|
||||||
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
||||||
const s3BucketName = process.env.DJANGO_AWS_STORAGE_BUCKET_NAME;
|
const s3BucketName = process.env.DJANGO_AWS_STORAGE_BUCKET_NAME;
|
||||||
const awsS3Domain = process.env.DJANGO_AWS_S3_CUSTOM_DOMAIN ?
|
const awsS3Domain = process.env.DJANGO_AWS_S3_CUSTOM_DOMAIN
|
||||||
process.env.DJANGO_AWS_S3_CUSTOM_DOMAIN
|
? process.env.DJANGO_AWS_S3_CUSTOM_DOMAIN
|
||||||
: `${s3BucketName}.s3.amazonaws.com`;
|
: `${s3BucketName}.s3.amazonaws.com`;
|
||||||
const staticUrl = `https://${awsS3Domain}/static/`;
|
const staticUrl = `https://${awsS3Domain}/static/`;
|
||||||
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
{%- if cookiecutter.frontend_pipeline == 'Webpack' -%}
|
||||||
import '../sass/project.scss';
|
import '../sass/project.scss';
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
|
{% endif -%}
|
||||||
/* Project specific Javascript goes here. */
|
/* Project specific Javascript goes here. */
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
@import "custom_bootstrap_vars";
|
@import 'custom_bootstrap_vars';
|
||||||
@import "~bootstrap/scss/bootstrap";
|
@import '~bootstrap/scss/bootstrap';
|
||||||
|
|
||||||
|
|
||||||
// project specific CSS goes here
|
// project specific CSS goes here
|
||||||
|
|
||||||
////////////////////////////////
|
///////////////
|
||||||
// Variables //
|
// Variables //
|
||||||
////////////////////////////////
|
///////////////
|
||||||
|
|
||||||
// Alert colors
|
// Alert colors
|
||||||
|
|
||||||
|
@ -17,9 +16,9 @@ $pink: #f2dede;
|
||||||
$dark-pink: #eed3d7;
|
$dark-pink: #eed3d7;
|
||||||
$red: #b94a48;
|
$red: #b94a48;
|
||||||
|
|
||||||
////////////////////////////////
|
////////////
|
||||||
// Alerts //
|
// Alerts //
|
||||||
////////////////////////////////
|
////////////
|
||||||
|
|
||||||
// bootstrap alert CSS, translated to the django-standard levels of
|
// bootstrap alert CSS, translated to the django-standard levels of
|
||||||
// debug, info, success, warning, error
|
// debug, info, success, warning, error
|
||||||
|
|
Loading…
Reference in New Issue
Block a user