├── .gitignore ├── {{ cookiecutter.__project_name_kebab }} ├── .nvmrc ├── .stylelintignore ├── {{ cookiecutter.__project_name_snake }} │ ├── models.py │ ├── migrations │ │ └── __init__.py │ ├── static_src │ │ ├── main.tsx │ │ └── custom.d.ts │ ├── test │ │ ├── tests │ │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── apps.py │ │ ├── urls.py │ │ └── settings.py │ ├── static │ │ └── {{ cookiecutter.__project_name_snake }} │ │ │ └── js │ │ │ └── .gitignore │ ├── __init__.py │ ├── apps.py │ └── wagtail_hooks.py ├── CONTRIBUTING.md ├── .eslintignore ├── .stylelintrc.js ├── tests │ ├── conftest.py │ └── test_placeholder.py ├── .prettierignore ├── .gitignore ├── testmanage.py ├── .editorconfig ├── tsconfig.json ├── prettier.config.js ├── SECURITY.md ├── .coveragerc ├── CHANGELOG.md ├── .eslintrc.js ├── .github │ ├── scripts │ │ └── report_nightly_build_failure.py │ └── workflows │ │ ├── nightly.yml │ │ ├── publish.yml │ │ └── test.yml ├── package.json ├── ruff.toml ├── webpack.config.js ├── tox.ini ├── .pre-commit-config.yaml ├── pyproject.toml ├── README.md └── LICENSE ├── hooks └── post_gen_project.py ├── LICENSE ├── README.md ├── .github └── workflows │ └── test.yml └── cookiecutter.json /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | .venv 3 | .vscode 4 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.stylelintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | venv 3 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/static_src/main.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/test/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to {{ cookiecutter.project_name }} 2 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.min.js 3 | **/lib/ 4 | public/ 5 | coverage/ 6 | **/vendor/ 7 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '@wagtail/stylelint-config-wagtail', 3 | }; 4 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/static/{{ cookiecutter.__project_name_snake }}/js/.gitignore: -------------------------------------------------------------------------------- 1 | /{{ cookiecutter.__project_name_kebab }}.js 2 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/test/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = "{{ cookiecutter.__project_name_snake }}.test.apps.{{ cookiecutter.__project_name_camel }}TestAppConfig" 2 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture(autouse=True) 5 | def temporary_media_dir(settings, tmp_path: pytest.TempdirFactory): 6 | settings.MEDIA_ROOT = tmp_path / "media" 7 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = "{{ cookiecutter.__project_name_snake }}.apps.{{ cookiecutter.__project_name_camel }}AppConfig" 2 | 3 | 4 | VERSION = (0, 1, 0) 5 | __version__ = ".".join(map(str, VERSION)) 6 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.prettierignore: -------------------------------------------------------------------------------- 1 | # Irrelevant files ignored for performance reasons. 2 | node_modules 3 | *.min.js 4 | **/lib/ 5 | public/ 6 | coverage/ 7 | **/vendor/ 8 | # File types which Prettier supports but we don’t want auto-formatting. 9 | *.md 10 | # Files which contain incompatible syntax. 11 | *.html 12 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.py[co] 3 | /build 4 | /dist 5 | /{{ cookiecutter.__project_name_snake }}.egg-info 6 | /.coverage 7 | /htmlcov 8 | /.tox 9 | /.venv 10 | /venv 11 | /.vscode 12 | /site 13 | /test_{{ cookiecutter.__project_name_snake }}.db 14 | /node_modules 15 | /test-static 16 | /test-media 17 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class {{ cookiecutter.__project_name_camel }}AppConfig(AppConfig): 5 | label = "{{ cookiecutter.__project_name_snake }}" 6 | name = "{{ cookiecutter.__project_name_snake }}" 7 | verbose_name = "Wagtail {{ cookiecutter.project_name }}" 8 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/test/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class {{ cookiecutter.__project_name_camel }}TestAppConfig(AppConfig): 5 | label = "{{ cookiecutter.__project_name_snake }}_test" 6 | name = "{{ cookiecutter.__project_name_snake }}.test" 7 | verbose_name = "Wagtail {{ cookiecutter.project_name }} tests" 8 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/testmanage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | from django.core.management import execute_from_command_line 7 | 8 | 9 | def main(): 10 | os.environ["DJANGO_SETTINGS_MODULE"] = "{{ cookiecutter.__project_name_snake }}.test.settings" 11 | execute_from_command_line(sys.argv) 12 | 13 | 14 | if __name__ == "__main__": 15 | main() 16 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/tests/test_placeholder.py: -------------------------------------------------------------------------------- 1 | """ 2 | Placeholder test, so that pytest doesn't fail with an empty testsuite. Feel free to 3 | remove this when you start writing tests. 4 | https://github.com/pytest-dev/pytest/issues/2393 5 | """ 6 | 7 | import pytest 8 | 9 | 10 | pytestmark = pytest.mark.django_db 11 | 12 | 13 | def test_homepage(client): 14 | assert client.get("/").status_code == 200 15 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | end_of_line = lf 10 | 11 | [Makefile] 12 | indent_style = tab 13 | 14 | [*.py] 15 | max_line_length = 88 16 | 17 | [*.{html,rst,md}] 18 | indent_size = 4 19 | 20 | [*.{js,ts,tsx,json,yml,yaml,css,scss}] 21 | indent_size = 2 22 | 23 | [*.md] 24 | trim_trailing_whitespace = false 25 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react", 4 | "lib": ["es2015", "dom"], 5 | "noImplicitAny": true, 6 | "noUnusedLocals": true, 7 | "noUnusedParameters": true, 8 | "strictNullChecks": true, 9 | "esModuleInterop": true 10 | }, 11 | "files": [ 12 | "{{ cookiecutter.__project_name_snake }}/static_src/main.tsx", 13 | "{{ cookiecutter.__project_name_snake }}/static_src/custom.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/prettier.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * See https://prettier.io/docs/en/options.html. 3 | */ 4 | module.exports = { 5 | arrowParens: 'always', 6 | bracketSameLine: false, 7 | bracketSpacing: true, 8 | embeddedLanguageFormatting: 'auto', 9 | endOfLine: 'lf', 10 | htmlWhitespaceSensitivity: 'css', 11 | jsxSingleQuote: false, 12 | printWidth: 80, 13 | proseWrap: 'preserve', 14 | quoteProps: 'consistent', 15 | semi: true, 16 | singleQuote: true, 17 | trailingComma: 'all', 18 | }; 19 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/test/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import include, path 3 | from wagtail import urls as wagtail_urls 4 | from wagtail.admin import urls as wagtailadmin_urls 5 | from wagtail.documents import urls as wagtaildocs_urls 6 | 7 | 8 | urlpatterns = [ 9 | path("django-admin/", admin.site.urls), 10 | path("admin/", include(wagtailadmin_urls)), 11 | path("documents/", include(wagtaildocs_urls)), 12 | path("", include(wagtail_urls)), 13 | ] 14 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | We take the security of Wagtail, and related packages we maintain, seriously. If you have found a security issue with any of our projects please email us at security@wagtail.org so we can work together to find and patch the issue. We appreciate responsible disclosure with any security related issues, so please contact us first before creating a Github issue. 4 | 5 | If you want to send an encrypted email (optional), the public key ID for security@wagtail.org is 0xbed227b4daf93ff9, and this public key is available from most commonly-used keyservers. 6 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | include = {{ cookiecutter.__project_name_snake }}/* 4 | omit = */migrations/*,*/tests/* 5 | 6 | [report] 7 | # Regexes for lines to exclude from consideration 8 | exclude_lines = 9 | # Have to re-enable the standard pragma 10 | pragma: no cover 11 | 12 | # Don't complain about missing debug-only code: 13 | def __repr__ 14 | if self\.debug 15 | 16 | # Don't complain if tests don't hit defensive assertion code: 17 | raise AssertionError 18 | raise NotImplementedError 19 | 20 | # Don't complain if non-runnable code isn't run: 21 | if 0: 22 | if __name__ == .__main__.: 23 | 24 | ignore_errors = True 25 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # {{ cookiecutter.project_name }} Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | ## [0.1.0] - {% now 'local', '%Y-%m-%d' %} 11 | 12 | ### Added 13 | 14 | - ... 15 | 16 | ### Changed 17 | 18 | - ... 19 | 20 | ### Removed 21 | 22 | - ... 23 | 24 | 25 | 43 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | extends: '@wagtail/eslint-config-wagtail', 4 | parserOptions: { 5 | ecmaVersion: 2018, 6 | sourceType: 'module', 7 | }, 8 | rules: { 9 | '@typescript-eslint/explicit-member-accessibility': 'off', 10 | '@typescript-eslint/explicit-function-return-type': 'off', 11 | '@typescript-eslint/no-explicit-any': 'off', 12 | 'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }], 13 | }, 14 | settings: { 15 | 'import/resolver': { 16 | node: { 17 | extensions: ['.js', '.jsx', '.ts', '.tsx'], 18 | }, 19 | }, 20 | }, 21 | // ESlint default behaviour ignores file/folders starting with "." 22 | // https://github.com/eslint/eslint/issues/10341 23 | ignorePatterns: ['!.*', 'node_modules', 'dist'], 24 | }; 25 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.github/scripts/report_nightly_build_failure.py: -------------------------------------------------------------------------------- 1 | """ 2 | Called by GH Actions when the nightly build fails. 3 | 4 | This reports an error to the #nightly-build-failures Slack channel. 5 | """ 6 | 7 | import os 8 | 9 | import requests 10 | 11 | 12 | if "SLACK_WEBHOOK_URL" in os.environ: 13 | print("Reporting to #nightly-build-failures slack channel") 14 | response = requests.post( 15 | os.environ["SLACK_WEBHOOK_URL"], 16 | json={ 17 | "text": "A Nightly build failed. See https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/actions/runs/" 18 | + os.environ["GITHUB_RUN_ID"], 19 | }, 20 | timeout=30, 21 | ) 22 | 23 | print("Slack responded with:", response) 24 | 25 | else: 26 | print( 27 | "Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set" 28 | ) 29 | -------------------------------------------------------------------------------- /hooks/post_gen_project.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | import shutil 3 | 4 | 5 | def remove_frontend_files(): 6 | files_to_remove = [ 7 | ".eslintignore", 8 | ".eslintrc.js", 9 | ".nvmrc", 10 | ".prettierignore", 11 | ".stylelintignore", 12 | ".stylelintrc.js", 13 | "package.json", 14 | "prettier.config.js", 15 | "tsconfig.json", 16 | "webpack.config.js", 17 | ] 18 | dirs_to_remove = [ 19 | Path("{{ cookiecutter.__project_name_snake }}", "static_src"), 20 | Path("{{ cookiecutter.__project_name_snake }}", "static") 21 | ] 22 | for filename in files_to_remove: 23 | Path.unlink(Path(filename)) 24 | for directory in dirs_to_remove: 25 | shutil.rmtree(directory) 26 | 27 | 28 | def main(): 29 | if "{{ cookiecutter.use_frontend }}".lower() not in ["y", "yes"]: 30 | remove_frontend_files() 31 | 32 | 33 | if __name__ == "__main__": 34 | main() 35 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/wagtail_hooks.py: -------------------------------------------------------------------------------- 1 | from django.urls import include, path 2 | from django.views.i18n import JavaScriptCatalog 3 | from wagtail import hooks 4 | 5 | 6 | @hooks.register("register_admin_urls") 7 | def register_admin_urls(): 8 | urls = [ 9 | path( 10 | "jsi18n/", 11 | JavaScriptCatalog.as_view(packages=["{{ cookiecutter.__project_name_snake }}"]), 12 | name="javascript_catalog", 13 | ), 14 | # Add your other URLs here, and they will appear under `/admin/{{ cookiecutter.__project_name_snake_without_prefix }}/` 15 | # Note: you do not need to check for authentication in views added here, Wagtail does this for you! 16 | ] 17 | 18 | return [ 19 | path( 20 | "{{ cookiecutter.__project_name_snake_without_prefix }}/", 21 | include( 22 | (urls, "{{ cookiecutter.__project_name_snake }}"), 23 | namespace="{{ cookiecutter.__project_name_snake }}", 24 | ), 25 | ) 26 | ] 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Karl Hobley 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | {% raw -%} 2 | name: Nightly Wagtail Test 3 | 4 | on: 5 | schedule: 6 | - cron: '0 1 * * *' 7 | # At 01:00, daily 8 | workflow_dispatch: 9 | 10 | jobs: 11 | nightly-wagtail-test: 12 | runs-on: ubuntu-latest 13 | env: 14 | WEBHOOK_EXISTS: ${{ secrets.SLACK_WEBHOOK_URL != '' }} 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: actions/setup-python@v5 19 | with: 20 | python-version: '3.11' 21 | 22 | - run: git clone https://github.com/wagtail/wagtail.git 23 | 24 | - run: python -m pip install flit 25 | - run: flit install --deps production --extras testing 26 | - run: python -m pip install ./wagtail 27 | 28 | - run: python testmanage.py test 29 | 30 | - name: Report failure 31 | run: | 32 | python -m pip install requests 33 | python ./.github/scripts/report_nightly_build_failure.py 34 | if: ${{ failure() && env.WEBHOOK_EXISTS == 'true' }} 35 | env: 36 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 37 | {%- endraw %} 38 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{ cookiecutter.__project_name_kebab }}", 3 | "version": "0.1.0", 4 | "description": "{{ cookiecutter.project_short_description }}", 5 | "main": "{{ cookiecutter.__project_name_snake }}/static_src/main.tsx", 6 | "scripts": { 7 | "start": "webpack --config ./webpack.config.js --mode development --progress --watch", 8 | "build": "webpack --config ./webpack.config.js --mode production" 9 | }, 10 | "author": "{{ cookiecutter.full_name }}", 11 | "license": "{{ cookiecutter.__license_options_npm[cookiecutter.open_source_license] }}", 12 | "devDependencies": { 13 | "@svgr/webpack": "^8.1.0", 14 | "@types/react": "^16.14.21", 15 | "@types/react-dom": "^16.0", 16 | "file-loader": "^6.2.0", 17 | "postcss-loader": "^6.2.1", 18 | "postcss": "^8.4.7", 19 | "sass-loader": "^12.4.0", 20 | "sass": "^1.45.3", 21 | "ts-loader": "^9.2.6", 22 | "typescript": "^4.5.5", 23 | "webpack": "^5.76.0", 24 | "webpack-cli": "^4.9.1" 25 | }, 26 | "dependencies": { 27 | "react": "^16.14.0", 28 | "react-dom": "^16.14.0", 29 | "styled-components": "^6.0.8" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/ruff.toml: -------------------------------------------------------------------------------- 1 | extend-exclude = [ 2 | "LC_MESSAGES", 3 | "locale", 4 | ] 5 | line-length = 88 6 | 7 | 8 | [lint] 9 | select = [ 10 | "B", # flake8-bugbear 11 | "C4", # flake8-comprehensions 12 | "DJ", # flake8-django 13 | "E", # pycodestyle errors 14 | "F", # pyflakes 15 | "I", # isort 16 | "RUF100", # unused noqa 17 | "S", # flake8-bandit 18 | "UP", # pyupgrade 19 | "W", # warning 20 | ] 21 | fixable = ["C4", "E", "F", "I", "UP"] 22 | 23 | # E501: Line too long 24 | ignore = ["E501"] 25 | 26 | 27 | [lint.isort] 28 | known-first-party = ["{{ cookiecutter.__project_name_snake }}"] 29 | lines-after-imports = 2 30 | lines-between-types = 1 31 | 32 | 33 | [lint.per-file-ignores] 34 | "tests/**/*.py" = [ 35 | "S101", # asserts allowed in tests 36 | "ARG", # unused function args (pytest fixtures) 37 | "FBT", # booleans as positional arguments (@pytest.mark.parametrize) 38 | "PLR2004", # magic value used in comparison 39 | "S311", # standard pseudo-random generators are not suitable for cryptographic purposes 40 | ] 41 | 42 | 43 | [format] 44 | docstring-code-format = true 45 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: './{{ cookiecutter.__project_name_snake }}/static_src/main.tsx', 5 | module: { 6 | rules: [ 7 | { 8 | test: /\.tsx?$/, 9 | use: 'ts-loader', 10 | exclude: /node_modules/, 11 | }, 12 | { 13 | test: /\.scss$/, 14 | use: ['style-loader', 'css-loader', 'sass-loader'], 15 | }, 16 | { 17 | test: /\.css$/, 18 | use: ['style-loader', 'css-loader'], 19 | }, 20 | { 21 | test: /\.svg$/, 22 | use: ['@svgr/webpack'], 23 | }, 24 | { 25 | test: /\.(png|jpg|gif)$/, 26 | use: ['file-loader'], 27 | }, 28 | ], 29 | }, 30 | resolve: { 31 | extensions: ['.tsx', '.ts', '.js'], 32 | }, 33 | externals: { 34 | /* These are provided by Wagtail */ 35 | 'react': 'React', 36 | 'react-dom': 'ReactDOM', 37 | 'gettext': 'gettext', 38 | }, 39 | output: { 40 | path: path.resolve( 41 | __dirname, 42 | '{{ cookiecutter.__project_name_snake }}/static/{{ cookiecutter.__project_name_snake }}/js', 43 | ), 44 | filename: '{{ cookiecutter.__project_name_kebab }}.js', 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | {% raw -%} 2 | # See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ 3 | # for a detailed guide 4 | name: Publish to PyPI 5 | 6 | on: 7 | release: 8 | types: [published] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | contents: read # to fetch code (actions/checkout) 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Set up Python 3.11 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: '3.11' 24 | 25 | - name: Install dependencies 26 | run: | 27 | python -m pip install --upgrade pip 28 | python -m pip install flit 29 | python -m flit install --symlink 30 | 31 | - name: Build 32 | run: python -m flit build 33 | 34 | - uses: actions/upload-artifact@v4 35 | with: 36 | path: ./dist 37 | 38 | publish: 39 | needs: build 40 | runs-on: ubuntu-latest 41 | permissions: 42 | contents: none 43 | id-token: write # required for trusted publishing 44 | environment: publish 45 | steps: 46 | - uses: actions/download-artifact@v4 47 | 48 | - name: Publish to PyPI 49 | uses: pypa/gh-action-pypi-publish@release/v1 50 | with: 51 | packages-dir: artifact/ 52 | print-hash: true 53 | {%- endraw %} 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cookiecutter-wagtail-package 2 | 3 | A cookiecutter template for building Wagtail add-on packages. 4 | 5 | ## What's included 6 | 7 | This creates a simple Python/Django app with a nested "test" app. 8 | 9 | ### CI 10 | 11 | This creates Github Workflows for: 12 | 13 | - Running tests and linters on pushes and pull requests 14 | - Running tests nightly against latest Wagtail version 15 | - Pushing packages to PyPI when GitHub releases are created. This requires two additional setup steps before it can be used: 16 | - Create a pending publisher in PyPI: https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/ 17 | - Create an environment called "publish" in GitHub: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#creating-an-environment 18 | 19 | ### Frontend tooling 20 | 21 | This includes a simple webpack setup with TypeScript, React, styled-components, and SVG support. 22 | 23 | Note that React is pinned to 16.x because on production it uses the same React library as Wagtail to reduce bundle size. 24 | 25 | This can be excluded by answering "no" to the `use_frontend` question. 26 | 27 | ## How to use 28 | 29 | Firstly install cookiecutter: 30 | 31 | python -m pip install "cookiecutter>=2" 32 | 33 | Then run it like so: 34 | 35 | cookiecutter git@github.com:wagtail/cookiecutter-wagtail-package.git 36 | 37 | It'll ask for some details about you (name and email) and your project. 38 | 39 | When it asks for your project name, exclude the "Wagtail" prefix. 40 | For example, if your project is called "Wagtail Llamas", set your project name to "Llamas" and accept all the default project name variants it generates (unless you used a special character in the project name). 41 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | skipsdist = True 3 | usedevelop = True 4 | 5 | envlist = 6 | python{3.8,3.9,3.10,3.11,3.12}-django{4.2}-wagtail{5.2,6.0}-{sqlite,postgres} 7 | python{3.10,3.11,3.12}-django{5.0}-wagtail{5.2,6.0}-{sqlite,postgres} 8 | 9 | [gh-actions] 10 | python = 11 | 3.8: python3.8 12 | 3.9: python3.9 13 | 3.10: python3.10 14 | 3.11: python3.11 15 | 3.12: python3.12 16 | 17 | [gh-actions:env] 18 | DB = 19 | sqlite: sqlite 20 | postgres: postgres 21 | 22 | [testenv] 23 | install_command = pip install -e ".[testing]" -U {opts} {packages} 24 | commands = pytest --cov {posargs: -vv} 25 | 26 | basepython = 27 | python3.8: python3.8 28 | python3.9: python3.9 29 | python3.10: python3.10 30 | python3.11: python3.11 31 | python3.12: python3.12 32 | 33 | deps = 34 | coverage 35 | 36 | django4.2: Django>=4.2,<4.3 37 | django5.0: Django>=5.0,<5.1 38 | 39 | wagtail5.2: wagtail>=5.2,<5.3 40 | wagtail6.0: wagtail>=5.2,<5.3 41 | 42 | postgres: psycopg2>=2.6 43 | 44 | setenv = 45 | postgres: DATABASE_URL={env:DATABASE_URL:postgres:///{{ cookiecutter.__project_name_snake }}} 46 | 47 | [testenv:interactive] 48 | basepython = python3.10 49 | 50 | commands_pre = 51 | python {toxinidir}/testmanage.py makemigrations 52 | python {toxinidir}/testmanage.py migrate 53 | python {toxinidir}/testmanage.py shell -c "from django.contrib.auth.models import User;(not User.objects.filter(username='admin').exists()) and User.objects.create_superuser('admin', 'super@example.com', 'changeme')" 54 | python {toxinidir}/testmanage.py createcachetable 55 | 56 | commands = 57 | {posargs:python testmanage.py runserver 0.0.0.0:8020} 58 | 59 | setenv = 60 | INTERACTIVE = 1 61 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autofix_prs: false 3 | 4 | default_language_version: 5 | python: python3 6 | 7 | repos: 8 | - repo: https://github.com/pre-commit/pre-commit-hooks 9 | rev: v4.4.0 10 | hooks: 11 | - id: check-added-large-files 12 | - id: check-case-conflict 13 | - id: check-json 14 | - id: check-merge-conflict 15 | - id: check-symlinks 16 | - id: check-toml 17 | - id: check-yaml 18 | args: ['--unsafe'] 19 | - id: end-of-file-fixer 20 | - id: trailing-whitespace 21 | - repo: https://github.com/astral-sh/ruff-pre-commit 22 | # ruff config is in ruff.toml 23 | rev: v0.3.0 24 | hooks: 25 | - id: ruff 26 | args: [--fix] 27 | - id: ruff-format 28 | {%- if cookiecutter.use_frontend in ['y', 'yes'] %} 29 | - repo: https://github.com/pre-commit/mirrors-prettier 30 | # prettier config is in prettier.config.js 31 | rev: 'v2.7.1' 32 | hooks: 33 | - id: prettier 34 | types_or: [css, scss, javascript, ts, tsx, json, yaml] 35 | - repo: https://github.com/pre-commit/mirrors-eslint 36 | # eslint config is in .eslintrc.js 37 | rev: v8.32.0 38 | hooks: 39 | - id: eslint 40 | additional_dependencies: 41 | - 'eslint@8.49.0' 42 | - 'eslint-config-airbnb@19.0.4' 43 | - 'eslint-plugin-import@2.28.1' 44 | - 'eslint-plugin-jsx-a11y@6.7.1' 45 | - 'eslint-plugin-react@7.33.2' 46 | - 'eslint-plugin-react-hooks@4.6.0' 47 | - '@typescript-eslint/eslint-plugin@6.7.2' 48 | - '@typescript-eslint/parser@6.7.2' 49 | - '@wagtail/eslint-config-wagtail@0.4.0' 50 | files: \.(js|jsx|ts|tsx)$ 51 | types: [file] 52 | - repo: https://github.com/awebdeveloper/pre-commit-stylelint 53 | # stylelint config is in .stylelintrc.js 54 | rev: 8f63da497580898a7e0ceef6bf9e72cc0af07828 55 | hooks: 56 | - id: stylelint 57 | files: \.(scss)$ 58 | additional_dependencies: 59 | - 'stylelint@14.16.1' 60 | - '@wagtail/stylelint-config-wagtail@0.6.0' 61 | {%- endif %} 62 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["flit_core >=3.2,<4"] 3 | build-backend = "flit_core.buildapi" 4 | 5 | [project] 6 | name = "{{ cookiecutter.__project_name_kebab }}" 7 | authors = [{name = "{{ cookiecutter.full_name }}", email = "{{ cookiecutter.email }}"}] 8 | description = "{{ cookiecutter.project_short_description }}" 9 | readme = "README.md" 10 | license = {file = "LICENSE"} 11 | classifiers = [ 12 | "Development Status :: 3 - Alpha", 13 | "Intended Audience :: Developers", 14 | "{{ cookiecutter.__license_options_pypi[cookiecutter.open_source_license] }}", 15 | "Operating System :: OS Independent", 16 | "Programming Language :: Python", 17 | "Programming Language :: Python :: 3", 18 | "Programming Language :: Python :: 3.8", 19 | "Programming Language :: Python :: 3.9", 20 | "Programming Language :: Python :: 3.10", 21 | "Programming Language :: Python :: 3.11", 22 | "Programming Language :: Python :: 3.12", 23 | "Framework :: Django", 24 | "Framework :: Django :: 4.2", 25 | "Framework :: Django :: 5.0", 26 | "Framework :: Wagtail", 27 | "Framework :: Wagtail :: 5", 28 | "Framework :: Wagtail :: 6", 29 | ] 30 | requires-python = ">=3.8" 31 | dynamic = ["version"] 32 | dependencies = [ 33 | "Django>=4.2", 34 | "Wagtail>=5.2" 35 | ] 36 | [project.optional-dependencies] 37 | testing = [ 38 | "dj-database-url==2.1.0", 39 | "pre-commit==3.4.0", 40 | "pytest==8.1.1", 41 | "pytest-cov==5.0.0", 42 | "pytest-django==4.8.0", 43 | ] 44 | ci = [ 45 | "tox==4.11.3", 46 | "tox-gh-actions==3.1.3", 47 | ] 48 | 49 | [project.urls] 50 | Home = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}" 51 | 52 | [tool.flit.module] 53 | name = "{{ cookiecutter.__project_name_snake }}" 54 | 55 | [tool.flit.sdist] 56 | exclude = [ 57 | "{{ cookiecutter.__project_name_snake }}/static_src", 58 | "{{ cookiecutter.__project_name_snake }}/test", 59 | "{{ cookiecutter.__project_name_snake }}/static/{{ cookiecutter.__project_name_snake }}/js/.gitignore", 60 | "testmanage.py", 61 | ".*", 62 | "*.js", 63 | "*.json", 64 | "*.ini", 65 | "*.yml" 66 | ] 67 | 68 | [tool.pytest.ini_options] 69 | DJANGO_SETTINGS_MODULE = "{{ cookiecutter.__project_name_snake }}.test.settings" 70 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: {{ cookiecutter.project_name }}{% raw %} CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - 'stable/**' 8 | 9 | pull_request: 10 | 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.ref }} 13 | cancel-in-progress: true 14 | 15 | permissions: 16 | contents: read # to fetch code (actions/checkout) 17 | 18 | jobs: 19 | lint: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v4 23 | with: 24 | fetch-depth: 0 25 | - name: Set up Python 3.8 26 | uses: actions/setup-python@v5 27 | with: 28 | python-version: '3.8' 29 | - uses: pre-commit/action@v3.0.1 30 | 31 | test-sqlite: 32 | runs-on: ubuntu-latest 33 | needs: lint 34 | strategy: 35 | matrix: 36 | python: ['3.8', '3.9', '3.10', '3.11', '3.12'] 37 | 38 | steps: 39 | - uses: actions/checkout@v4 40 | - name: Set up Python ${{ matrix.python }} 41 | uses: actions/setup-python@v5 42 | with: 43 | python-version: ${{ matrix.python }} 44 | - name: Install 45 | run: | 46 | python -m pip install --upgrade pip setuptools wheel 47 | python -m pip install .[ci] 48 | - name: Test 49 | run: tox 50 | env: 51 | DB: sqlite 52 | 53 | test-postgres: 54 | runs-on: ubuntu-latest 55 | needs: lint 56 | strategy: 57 | matrix: 58 | python: ['3.8', '3.9', '3.10', '3.11', '3.12'] 59 | 60 | services: 61 | postgres: 62 | image: ${{ matrix.postgres || 'postgres:12' }} 63 | env: 64 | POSTGRES_PASSWORD: postgres 65 | ports: 66 | - 5432:5432 67 | options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 68 | 69 | steps: 70 | - uses: actions/checkout@v4 71 | - name: Set up Python ${{ matrix.python }} 72 | uses: actions/setup-python@v5 73 | with: 74 | python-version: ${{ matrix.python }} 75 | - name: Install 76 | run: | 77 | python -m pip install --upgrade pip setuptools wheel 78 | python -m pip install .[ci] 79 | - name: Test 80 | run: tox 81 | env: 82 | DATABASE_URL: postgres://postgres:postgres@localhost:5432/{% endraw %}{{ cookiecutter.__project_name_snake }} 83 | DB: postgres 84 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/static_src/custom.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | export {}; 3 | 4 | // Allows SVG files to be imported and used in TypeScript 5 | declare module '*.svg' { 6 | const content: any; 7 | export default content; 8 | } 9 | 10 | // Declare globals provided by Django's JavaScript Catalog 11 | // For more information, see: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#module-django.views.i18n 12 | declare global { 13 | // Wagtail globals 14 | 15 | interface WagtailConfig { 16 | ADMIN_API: { 17 | PAGES: string; 18 | DOCUMENTS: string; 19 | IMAGES: string; 20 | EXTRA_CHILDREN_PARAMETERS: string; 21 | }; 22 | 23 | I18N_ENABLED: boolean; 24 | LOCALES: { 25 | code: string; 26 | /* eslint-disable-next-line camelcase */ 27 | display_name: string; 28 | }[]; 29 | } 30 | 31 | const wagtailConfig: WagtailConfig; 32 | 33 | // Django i18n utilities 34 | 35 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#gettext 36 | function gettext(text: string): string; 37 | 38 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#ngettext 39 | function ngettext(singular: string, plural: string, count: number): string; 40 | 41 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#interpolate 42 | // FIXME export default function interpolate(...): string; 43 | 44 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#get-format 45 | type FormatType = 46 | | 'DATE_FORMAT' 47 | | 'DATE_INPUT_FORMATS' 48 | | 'DATETIME_FORMAT' 49 | | 'DATETIME_INPUT_FORMATS' 50 | | 'DECIMAL_SEPARATOR' 51 | | 'FIRST_DAY_OF_WEEK' 52 | | 'MONTH_DAY_FORMAT' 53 | | 'NUMBER_GROUPING' 54 | | 'SHORT_DATE_FORMAT' 55 | | 'SHORT_DATETIME_FORMAT' 56 | | 'THOUSAND_SEPARATOR' 57 | | 'TIME_FORMAT' 58 | | 'TIME_INPUT_FORMATS' 59 | | 'YEAR_MONTH_FORMAT'; 60 | 61 | function get_format(formatType: FormatType): string; 62 | 63 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#gettext_noop 64 | function gettext_noop(text: string): string; 65 | 66 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#pgettext 67 | function pgettext(context: string, text: string): string; 68 | 69 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#npgettext 70 | function pgettext(context: string, text: string, count: number): string; 71 | 72 | // https://docs.djangoproject.com/en/stable/topics/i18n/translation/#pluralidx 73 | function pluralidx(count: number): boolean; 74 | } 75 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | render: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - uses: actions/setup-python@v5 11 | with: 12 | python-version: '3.11' 13 | 14 | - run: python -m pip install cookiecutter 15 | - run: python -m cookiecutter . --no-input 16 | 17 | - uses: actions/upload-artifact@v4 18 | with: 19 | name: rendered-project 20 | path: wagtail-llama-save 21 | 22 | lint: 23 | needs: render 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v4 27 | - uses: actions/setup-python@v5 28 | with: 29 | python-version: '3.11' 30 | 31 | - uses: actions/download-artifact@v4 32 | # Restore the rendered artifact to a directory outside the repo checkout. 33 | # Even if we invoke pre-commit from in a subdirectory 34 | # it tries to lint the whole repo including the raw templates. 35 | with: 36 | name: rendered-project 37 | path: /tmp/wagtail-llama-save 38 | 39 | - name: Run Lint Checks 40 | working-directory: /tmp/wagtail-llama-save 41 | # In order to get pre-commit to see any files, 42 | # we have to initialize a git repo 43 | # and at least stage the files we want to check. 44 | # Otherwise pre-commit will stash everything and 45 | # tell us there are no files to check. 46 | # refs 47 | # https://github.com/wagtail/cookiecutter-wagtail-package/pull/45#discussion_r1064195179 48 | # https://github.com/pre-commit/pre-commit/issues/848 49 | run: | 50 | git init 51 | git add . 52 | python -m pip install pre-commit 53 | pre-commit run --all-files --show-diff-on-failure --color=always 54 | 55 | install-package: 56 | needs: render 57 | runs-on: ubuntu-latest 58 | steps: 59 | - uses: actions/checkout@v4 60 | - uses: actions/setup-python@v5 61 | with: 62 | python-version: '3.11' 63 | 64 | - uses: actions/download-artifact@v4 65 | with: 66 | name: rendered-project 67 | path: wagtail-llama-save 68 | 69 | - name: Ensure package can be installed 70 | working-directory: wagtail-llama-save 71 | run: python -m pip install -e . 72 | 73 | build-js: 74 | needs: render 75 | runs-on: ubuntu-latest 76 | steps: 77 | - uses: actions/checkout@v4 78 | - uses: actions/setup-node@v4 79 | with: 80 | node-version: 16 81 | 82 | - uses: actions/download-artifact@v4 83 | with: 84 | name: rendered-project 85 | path: wagtail-llama-save 86 | 87 | - name: Build JS 88 | working-directory: wagtail-llama-save 89 | run: | 90 | npm install --omit=optional --no-audit --progress=false 91 | npm run build 92 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | " ": "]\nCookiecutter Wagtail Package\nUse a project name without `Wagtail` as the prefix, this will be added for you.\n[Please press enter to continue", 3 | "project_name": "Llama Save", 4 | "__project_name_snake_without_prefix": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}", 5 | "__project_name_kebab_without_prefix": "{{ cookiecutter.__project_name_snake_without_prefix.replace('_', '-') }}", 6 | "__project_name_camel_without_prefix": "{{ cookiecutter.__project_name_snake_without_prefix.replace('_', ' ').title().replace(' ', '') }}", 7 | "__project_name_snake": "wagtail_{{ cookiecutter.__project_name_snake_without_prefix }}", 8 | "__project_name_kebab": "wagtail-{{ cookiecutter.__project_name_kebab_without_prefix }}", 9 | "__project_name_camel": "Wagtail{{ cookiecutter.__project_name_camel_without_prefix }}", 10 | "project_short_description": "A one line description of your package.", 11 | "full_name": "Fred Bloggs", 12 | "email": "fred@example.com", 13 | "github_username": "wagtail", 14 | "open_source_license": [ 15 | "BSD 3-Clause license", 16 | "MIT license", 17 | "ISC license", 18 | "Apache Software License 2.0", 19 | "GNU General Public License v3", 20 | "Not open source" 21 | ], 22 | "__license_options_pypi": { 23 | "BSD 3-Clause license": "License :: OSI Approved :: BSD License", 24 | "MIT license": "License :: OSI Approved :: MIT License", 25 | "ISC license": "License :: OSI Approved :: ISC License (ISCL)", 26 | "Apache Software License 2.0": "License :: OSI Approved :: Apache Software License", 27 | "GNU General Public License v3": "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", 28 | "Not open source": "License :: Other/Proprietary License" 29 | }, 30 | "__license_options_npm": { 31 | "BSD 3-Clause license": "BSD-3-Clause", 32 | "MIT license": "MIT", 33 | "ISC license": "ISC", 34 | "Apache Software License 2.0": "Apache-2.0", 35 | "GNU General Public License v3": "GPL-3.0-only", 36 | "Not open source": "UNLICENSED" 37 | }, 38 | "__license_options_readme_badges": { 39 | "BSD 3-Clause license": "[![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD--3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)", 40 | "MIT license": "[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)", 41 | "ISC license": "[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)", 42 | "Apache Software License 2.0": "[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)", 43 | "GNU General Public License v3": "[![License: GPL-3.0-only](https://img.shields.io/badge/License-GPL--3.0--only-blue.svg)](https://opensource.org/licenses/GPL-3.0)", 44 | "Not open source": "" 45 | }, 46 | "use_frontend": "y" 47 | } 48 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/README.md: -------------------------------------------------------------------------------- 1 | # Wagtail {{ cookiecutter.project_name }} 2 | 3 | {{ cookiecutter.project_short_description }} 4 | 5 | {{ cookiecutter.__license_options_readme_badges[cookiecutter.open_source_license] }} 6 | [![PyPI version](https://badge.fury.io/py/{{ cookiecutter.__project_name_kebab }}.svg)](https://badge.fury.io/py/{{ cookiecutter.__project_name_kebab }}) 7 | [![{{ cookiecutter.project_name }} CI](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/actions/workflows/test.yml/badge.svg)](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/actions/workflows/test.yml) 8 | 9 | ## Links 10 | 11 | - [Documentation](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/blob/main/README.md) 12 | - [Changelog](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/blob/main/CHANGELOG.md) 13 | - [Contributing](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/blob/main/CONTRIBUTING.md) 14 | - [Discussions](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/discussions) 15 | - [Security](https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}/security) 16 | 17 | ## Supported versions 18 | 19 | - Python ... 20 | - Django ... 21 | - Wagtail ... 22 | 23 | ## Installation 24 | 25 | - `python -m pip install {{ cookiecutter.__project_name_kebab }}` 26 | - ... 27 | 28 | ## Contributing 29 | 30 | ### Install 31 | 32 | To make changes to this project, first clone this repository: 33 | 34 | ```sh 35 | git clone https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.__project_name_kebab }}.git 36 | cd {{ cookiecutter.__project_name_kebab }} 37 | ``` 38 | 39 | With your preferred virtualenv activated, install testing dependencies: 40 | 41 | #### Using pip 42 | 43 | ```sh 44 | python -m pip install --upgrade pip>=21.3 45 | python -m pip install -e '.[testing]' -U 46 | ``` 47 | 48 | #### Using flit 49 | 50 | ```sh 51 | python -m pip install flit 52 | flit install 53 | ``` 54 | 55 | ### pre-commit 56 | 57 | Note that this project uses [pre-commit](https://github.com/pre-commit/pre-commit). 58 | It is included in the project testing requirements. To set up locally: 59 | 60 | ```shell 61 | # go to the project directory 62 | $ cd {{ cookiecutter.__project_name_kebab }} 63 | # initialize pre-commit 64 | $ pre-commit install 65 | 66 | # Optional, run all checks once for this, then the checks will run only on the changed files 67 | $ git ls-files --others --cached --exclude-standard | xargs pre-commit run --files 68 | ``` 69 | 70 | ### How to run tests 71 | 72 | Now you can run tests as shown below: 73 | 74 | ```sh 75 | tox 76 | ``` 77 | 78 | or, you can run them for a specific environment `tox -e python3.11-django4.2-wagtail5.1` or specific test 79 | `tox -e python3.11-django4.2-wagtail5.1-sqlite {{ cookiecutter.__project_name_kebab }}.tests.test_file.TestClass.test_method` 80 | 81 | To run the test app interactively, use `tox -e interactive`, visit `http://127.0.0.1:8020/admin/` and log in with `admin`/`changeme`. 82 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/{{ cookiecutter.__project_name_snake }}/test/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for temp project. 3 | 4 | For more information on this file, see 5 | https://docs.djangoproject.com/en/stable/topics/settings/ 6 | 7 | For the full list of settings and their values, see 8 | https://docs.djangoproject.com/en/stable/ref/settings/ 9 | """ 10 | 11 | import os 12 | 13 | import dj_database_url 14 | 15 | 16 | # Build paths inside the project like this: os.path.join(PROJECT_DIR, ...) 17 | PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 18 | BASE_DIR = os.path.dirname(PROJECT_DIR) 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/stable/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = "not-a-secure-key" # noqa: S105 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = ["localhost", "testserver"] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | "{{ cookiecutter.__project_name_snake }}", 36 | "{{ cookiecutter.__project_name_snake }}.test", 37 | "wagtail.contrib.search_promotions", 38 | "wagtail.contrib.forms", 39 | "wagtail.contrib.redirects", 40 | "wagtail.embeds", 41 | "wagtail.users", 42 | "wagtail.snippets", 43 | "wagtail.documents", 44 | "wagtail.images", 45 | "wagtail.search", 46 | "wagtail.admin", 47 | "wagtail.api.v2", 48 | "wagtail.contrib.routable_page", 49 | "wagtail.contrib.styleguide", 50 | "wagtail.sites", 51 | "wagtail", 52 | "taggit", 53 | "rest_framework", 54 | "django.contrib.admin", 55 | "django.contrib.auth", 56 | "django.contrib.contenttypes", 57 | "django.contrib.sessions", 58 | "django.contrib.messages", 59 | "django.contrib.staticfiles", 60 | "django.contrib.sitemaps", 61 | ] 62 | 63 | MIDDLEWARE = [ 64 | "django.middleware.security.SecurityMiddleware", 65 | "django.contrib.sessions.middleware.SessionMiddleware", 66 | "django.middleware.common.CommonMiddleware", 67 | "django.middleware.csrf.CsrfViewMiddleware", 68 | "django.contrib.auth.middleware.AuthenticationMiddleware", 69 | "django.contrib.messages.middleware.MessageMiddleware", 70 | "django.middleware.clickjacking.XFrameOptionsMiddleware", 71 | "wagtail.contrib.redirects.middleware.RedirectMiddleware", 72 | ] 73 | 74 | ROOT_URLCONF = "{{ cookiecutter.__project_name_snake }}.test.urls" 75 | 76 | TEMPLATES = [ 77 | { 78 | "BACKEND": "django.template.backends.django.DjangoTemplates", 79 | "DIRS": [], 80 | "APP_DIRS": True, 81 | "OPTIONS": { 82 | "context_processors": [ 83 | "django.template.context_processors.debug", 84 | "django.template.context_processors.request", 85 | "django.contrib.auth.context_processors.auth", 86 | "django.contrib.messages.context_processors.messages", 87 | ] 88 | }, 89 | } 90 | ] 91 | 92 | 93 | # Using DatabaseCache to make sure that the cache is cleared between tests. 94 | # This prevents false-positives in some wagtail core tests where we are 95 | # changing the 'wagtail_root_paths' key which may cause future tests to fail. 96 | CACHES = { 97 | "default": { 98 | "BACKEND": "django.core.cache.backends.db.DatabaseCache", 99 | "LOCATION": "cache", 100 | } 101 | } 102 | 103 | 104 | # don't use the intentionally slow default password hasher 105 | PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",) 106 | 107 | 108 | # Database 109 | # https://docs.djangoproject.com/en/stable/ref/settings/#databases 110 | 111 | DATABASES = { 112 | "default": dj_database_url.config(default="sqlite:///test_{{ cookiecutter.__project_name_snake }}.db"), 113 | } 114 | 115 | 116 | # Password validation 117 | # https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators 118 | 119 | AUTH_PASSWORD_VALIDATORS = [ 120 | { 121 | "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" 122 | }, 123 | {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, 124 | {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, 125 | {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, 126 | ] 127 | 128 | 129 | # Internationalization 130 | # https://docs.djangoproject.com/en/stable/topics/i18n/ 131 | 132 | LANGUAGE_CODE = "en-us" 133 | 134 | TIME_ZONE = "UTC" 135 | 136 | USE_I18N = True 137 | 138 | USE_L10N = True 139 | 140 | USE_TZ = True 141 | 142 | 143 | # Static files (CSS, JavaScript, Images) 144 | # https://docs.djangoproject.com/en/stable/howto/static-files/ 145 | 146 | STATICFILES_FINDERS = [ 147 | "django.contrib.staticfiles.finders.FileSystemFinder", 148 | "django.contrib.staticfiles.finders.AppDirectoriesFinder", 149 | ] 150 | 151 | STATICFILES_DIRS = [os.path.join(PROJECT_DIR, "static")] 152 | 153 | STATIC_ROOT = os.path.join(BASE_DIR, "test-static") 154 | STATIC_URL = "/static/" 155 | 156 | MEDIA_ROOT = os.path.join(BASE_DIR, "test-media") 157 | 158 | 159 | # Wagtail settings 160 | 161 | WAGTAIL_SITE_NAME = "Wagtail {{ cookiecutter.project_name }} test site" 162 | -------------------------------------------------------------------------------- /{{ cookiecutter.__project_name_kebab }}/LICENSE: -------------------------------------------------------------------------------- 1 | {%- if cookiecutter.open_source_license == 'MIT license' -%} 2 | MIT License 3 | 4 | Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | {%- elif cookiecutter.open_source_license == 'BSD 3-Clause license' -%} 24 | BSD 3-Clause License 25 | 26 | Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} 27 | 28 | Redistribution and use in source and binary forms, with or without 29 | modification, are permitted provided that the following conditions are met: 30 | 31 | 1. Redistributions of source code must retain the above copyright notice, this 32 | list of conditions and the following disclaimer. 33 | 34 | 2. Redistributions in binary form must reproduce the above copyright notice, 35 | this list of conditions and the following disclaimer in the documentation 36 | and/or other materials provided with the distribution. 37 | 38 | 3. Neither the name of the copyright holder nor the names of its 39 | contributors may be used to endorse or promote products derived from 40 | this software without specific prior written permission. 41 | 42 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 43 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 44 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 45 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 46 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 47 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 48 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 49 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 50 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 51 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 52 | {%- elif cookiecutter.open_source_license == 'ISC license' -%} 53 | ISC License 54 | 55 | Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} 56 | 57 | Permission to use, copy, modify, and/or distribute this software for any 58 | purpose with or without fee is hereby granted, provided that the above 59 | copyright notice and this permission notice appear in all copies. 60 | 61 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 62 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 63 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 64 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 65 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 66 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 67 | PERFORMANCE OF THIS SOFTWARE. 68 | {%- elif cookiecutter.open_source_license == 'Apache Software License 2.0' %} 69 | Apache License 70 | Version 2.0, January 2004 71 | http://www.apache.org/licenses/ 72 | 73 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 74 | 75 | 1. Definitions. 76 | 77 | "License" shall mean the terms and conditions for use, reproduction, 78 | and distribution as defined by Sections 1 through 9 of this document. 79 | 80 | "Licensor" shall mean the copyright owner or entity authorized by 81 | the copyright owner that is granting the License. 82 | 83 | "Legal Entity" shall mean the union of the acting entity and all 84 | other entities that control, are controlled by, or are under common 85 | control with that entity. For the purposes of this definition, 86 | "control" means (i) the power, direct or indirect, to cause the 87 | direction or management of such entity, whether by contract or 88 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 89 | outstanding shares, or (iii) beneficial ownership of such entity. 90 | 91 | "You" (or "Your") shall mean an individual or Legal Entity 92 | exercising permissions granted by this License. 93 | 94 | "Source" form shall mean the preferred form for making modifications, 95 | including but not limited to software source code, documentation 96 | source, and configuration files. 97 | 98 | "Object" form shall mean any form resulting from mechanical 99 | transformation or translation of a Source form, including but 100 | not limited to compiled object code, generated documentation, 101 | and conversions to other media types. 102 | 103 | "Work" shall mean the work of authorship, whether in Source or 104 | Object form, made available under the License, as indicated by a 105 | copyright notice that is included in or attached to the work 106 | (an example is provided in the Appendix below). 107 | 108 | "Derivative Works" shall mean any work, whether in Source or Object 109 | form, that is based on (or derived from) the Work and for which the 110 | editorial revisions, annotations, elaborations, or other modifications 111 | represent, as a whole, an original work of authorship. For the purposes 112 | of this License, Derivative Works shall not include works that remain 113 | separable from, or merely link (or bind by name) to the interfaces of, 114 | the Work and Derivative Works thereof. 115 | 116 | "Contribution" shall mean any work of authorship, including 117 | the original version of the Work and any modifications or additions 118 | to that Work or Derivative Works thereof, that is intentionally 119 | submitted to Licensor for inclusion in the Work by the copyright owner 120 | or by an individual or Legal Entity authorized to submit on behalf of 121 | the copyright owner. For the purposes of this definition, "submitted" 122 | means any form of electronic, verbal, or written communication sent 123 | to the Licensor or its representatives, including but not limited to 124 | communication on electronic mailing lists, source code control systems, 125 | and issue tracking systems that are managed by, or on behalf of, the 126 | Licensor for the purpose of discussing and improving the Work, but 127 | excluding communication that is conspicuously marked or otherwise 128 | designated in writing by the copyright owner as "Not a Contribution." 129 | 130 | "Contributor" shall mean Licensor and any individual or Legal Entity 131 | on behalf of whom a Contribution has been received by Licensor and 132 | subsequently incorporated within the Work. 133 | 134 | 2. Grant of Copyright License. Subject to the terms and conditions of 135 | this License, each Contributor hereby grants to You a perpetual, 136 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 137 | copyright license to reproduce, prepare Derivative Works of, 138 | publicly display, publicly perform, sublicense, and distribute the 139 | Work and such Derivative Works in Source or Object form. 140 | 141 | 3. Grant of Patent License. Subject to the terms and conditions of 142 | this License, each Contributor hereby grants to You a perpetual, 143 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 144 | (except as stated in this section) patent license to make, have made, 145 | use, offer to sell, sell, import, and otherwise transfer the Work, 146 | where such license applies only to those patent claims licensable 147 | by such Contributor that are necessarily infringed by their 148 | Contribution(s) alone or by combination of their Contribution(s) 149 | with the Work to which such Contribution(s) was submitted. If You 150 | institute patent litigation against any entity (including a 151 | cross-claim or counterclaim in a lawsuit) alleging that the Work 152 | or a Contribution incorporated within the Work constitutes direct 153 | or contributory patent infringement, then any patent licenses 154 | granted to You under this License for that Work shall terminate 155 | as of the date such litigation is filed. 156 | 157 | 4. Redistribution. You may reproduce and distribute copies of the 158 | Work or Derivative Works thereof in any medium, with or without 159 | modifications, and in Source or Object form, provided that You 160 | meet the following conditions: 161 | 162 | (a) You must give any other recipients of the Work or 163 | Derivative Works a copy of this License; and 164 | 165 | (b) You must cause any modified files to carry prominent notices 166 | stating that You changed the files; and 167 | 168 | (c) You must retain, in the Source form of any Derivative Works 169 | that You distribute, all copyright, patent, trademark, and 170 | attribution notices from the Source form of the Work, 171 | excluding those notices that do not pertain to any part of 172 | the Derivative Works; and 173 | 174 | (d) If the Work includes a "NOTICE" text file as part of its 175 | distribution, then any Derivative Works that You distribute must 176 | include a readable copy of the attribution notices contained 177 | within such NOTICE file, excluding those notices that do not 178 | pertain to any part of the Derivative Works, in at least one 179 | of the following places: within a NOTICE text file distributed 180 | as part of the Derivative Works; within the Source form or 181 | documentation, if provided along with the Derivative Works; or, 182 | within a display generated by the Derivative Works, if and 183 | wherever such third-party notices normally appear. The contents 184 | of the NOTICE file are for informational purposes only and 185 | do not modify the License. You may add Your own attribution 186 | notices within Derivative Works that You distribute, alongside 187 | or as an addendum to the NOTICE text from the Work, provided 188 | that such additional attribution notices cannot be construed 189 | as modifying the License. 190 | 191 | You may add Your own copyright statement to Your modifications and 192 | may provide additional or different license terms and conditions 193 | for use, reproduction, or distribution of Your modifications, or 194 | for any such Derivative Works as a whole, provided Your use, 195 | reproduction, and distribution of the Work otherwise complies with 196 | the conditions stated in this License. 197 | 198 | 5. Submission of Contributions. Unless You explicitly state otherwise, 199 | any Contribution intentionally submitted for inclusion in the Work 200 | by You to the Licensor shall be under the terms and conditions of 201 | this License, without any additional terms or conditions. 202 | Notwithstanding the above, nothing herein shall supersede or modify 203 | the terms of any separate license agreement you may have executed 204 | with Licensor regarding such Contributions. 205 | 206 | 6. Trademarks. This License does not grant permission to use the trade 207 | names, trademarks, service marks, or product names of the Licensor, 208 | except as required for reasonable and customary use in describing the 209 | origin of the Work and reproducing the content of the NOTICE file. 210 | 211 | 7. Disclaimer of Warranty. Unless required by applicable law or 212 | agreed to in writing, Licensor provides the Work (and each 213 | Contributor provides its Contributions) on an "AS IS" BASIS, 214 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 215 | implied, including, without limitation, any warranties or conditions 216 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 217 | PARTICULAR PURPOSE. You are solely responsible for determining the 218 | appropriateness of using or redistributing the Work and assume any 219 | risks associated with Your exercise of permissions under this License. 220 | 221 | 8. Limitation of Liability. In no event and under no legal theory, 222 | whether in tort (including negligence), contract, or otherwise, 223 | unless required by applicable law (such as deliberate and grossly 224 | negligent acts) or agreed to in writing, shall any Contributor be 225 | liable to You for damages, including any direct, indirect, special, 226 | incidental, or consequential damages of any character arising as a 227 | result of this License or out of the use or inability to use the 228 | Work (including but not limited to damages for loss of goodwill, 229 | work stoppage, computer failure or malfunction, or any and all 230 | other commercial damages or losses), even if such Contributor 231 | has been advised of the possibility of such damages. 232 | 233 | 9. Accepting Warranty or Additional Liability. While redistributing 234 | the Work or Derivative Works thereof, You may choose to offer, 235 | and charge a fee for, acceptance of support, warranty, indemnity, 236 | or other liability obligations and/or rights consistent with this 237 | License. However, in accepting such obligations, You may act only 238 | on Your own behalf and on Your sole responsibility, not on behalf 239 | of any other Contributor, and only if You agree to indemnify, 240 | defend, and hold each Contributor harmless for any liability 241 | incurred by, or claims asserted against, such Contributor by reason 242 | of your accepting any such warranty or additional liability. 243 | 244 | END OF TERMS AND CONDITIONS 245 | 246 | APPENDIX: How to apply the Apache License to your work. 247 | 248 | To apply the Apache License to your work, attach the following 249 | boilerplate notice, with the fields enclosed by brackets "[]" 250 | replaced with your own identifying information. (Don't include 251 | the brackets!) The text should be enclosed in the appropriate 252 | comment syntax for the file format. We also recommend that a 253 | file or class name and description of purpose be included on the 254 | same "printed page" as the copyright notice for easier 255 | identification within third-party archives. 256 | 257 | Copyright {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} 258 | 259 | Licensed under the Apache License, Version 2.0 (the "License"); 260 | you may not use this file except in compliance with the License. 261 | You may obtain a copy of the License at 262 | 263 | http://www.apache.org/licenses/LICENSE-2.0 264 | 265 | Unless required by applicable law or agreed to in writing, software 266 | distributed under the License is distributed on an "AS IS" BASIS, 267 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 268 | See the License for the specific language governing permissions and 269 | limitations under the License. 270 | 271 | {%- elif cookiecutter.open_source_license == 'GNU General Public License v3' %} 272 | GNU GENERAL PUBLIC LICENSE 273 | Version 3, 29 June 2007 274 | 275 | Copyright (C) 2007 Free Software Foundation, Inc. 276 | Everyone is permitted to copy and distribute verbatim copies 277 | of this license document, but changing it is not allowed. 278 | 279 | Preamble 280 | 281 | The GNU General Public License is a free, copyleft license for 282 | software and other kinds of works. 283 | 284 | The licenses for most software and other practical works are designed 285 | to take away your freedom to share and change the works. By contrast, 286 | the GNU General Public License is intended to guarantee your freedom to 287 | share and change all versions of a program--to make sure it remains free 288 | software for all its users. We, the Free Software Foundation, use the 289 | GNU General Public License for most of our software; it applies also to 290 | any other work released this way by its authors. You can apply it to 291 | your programs, too. 292 | 293 | When we speak of free software, we are referring to freedom, not 294 | price. Our General Public Licenses are designed to make sure that you 295 | have the freedom to distribute copies of free software (and charge for 296 | them if you wish), that you receive source code or can get it if you 297 | want it, that you can change the software or use pieces of it in new 298 | free programs, and that you know you can do these things. 299 | 300 | To protect your rights, we need to prevent others from denying you 301 | these rights or asking you to surrender the rights. Therefore, you have 302 | certain responsibilities if you distribute copies of the software, or if 303 | you modify it: responsibilities to respect the freedom of others. 304 | 305 | For example, if you distribute copies of such a program, whether 306 | gratis or for a fee, you must pass on to the recipients the same 307 | freedoms that you received. You must make sure that they, too, receive 308 | or can get the source code. And you must show them these terms so they 309 | know their rights. 310 | 311 | Developers that use the GNU GPL protect your rights with two steps: 312 | (1) assert copyright on the software, and (2) offer you this License 313 | giving you legal permission to copy, distribute and/or modify it. 314 | 315 | For the developers' and authors' protection, the GPL clearly explains 316 | that there is no warranty for this free software. For both users' and 317 | authors' sake, the GPL requires that modified versions be marked as 318 | changed, so that their problems will not be attributed erroneously to 319 | authors of previous versions. 320 | 321 | Some devices are designed to deny users access to install or run 322 | modified versions of the software inside them, although the manufacturer 323 | can do so. This is fundamentally incompatible with the aim of 324 | protecting users' freedom to change the software. The systematic 325 | pattern of such abuse occurs in the area of products for individuals to 326 | use, which is precisely where it is most unacceptable. Therefore, we 327 | have designed this version of the GPL to prohibit the practice for those 328 | products. If such problems arise substantially in other domains, we 329 | stand ready to extend this provision to those domains in future versions 330 | of the GPL, as needed to protect the freedom of users. 331 | 332 | Finally, every program is threatened constantly by software patents. 333 | States should not allow patents to restrict development and use of 334 | software on general-purpose computers, but in those that do, we wish to 335 | avoid the special danger that patents applied to a free program could 336 | make it effectively proprietary. To prevent this, the GPL assures that 337 | patents cannot be used to render the program non-free. 338 | 339 | The precise terms and conditions for copying, distribution and 340 | modification follow. 341 | 342 | TERMS AND CONDITIONS 343 | 344 | 0. Definitions. 345 | 346 | "This License" refers to version 3 of the GNU General Public License. 347 | 348 | "Copyright" also means copyright-like laws that apply to other kinds of 349 | works, such as semiconductor masks. 350 | 351 | "The Program" refers to any copyrightable work licensed under this 352 | License. Each licensee is addressed as "you". "Licensees" and 353 | "recipients" may be individuals or organizations. 354 | 355 | To "modify" a work means to copy from or adapt all or part of the work 356 | in a fashion requiring copyright permission, other than the making of an 357 | exact copy. The resulting work is called a "modified version" of the 358 | earlier work or a work "based on" the earlier work. 359 | 360 | A "covered work" means either the unmodified Program or a work based 361 | on the Program. 362 | 363 | To "propagate" a work means to do anything with it that, without 364 | permission, would make you directly or secondarily liable for 365 | infringement under applicable copyright law, except executing it on a 366 | computer or modifying a private copy. Propagation includes copying, 367 | distribution (with or without modification), making available to the 368 | public, and in some countries other activities as well. 369 | 370 | To "convey" a work means any kind of propagation that enables other 371 | parties to make or receive copies. Mere interaction with a user through 372 | a computer network, with no transfer of a copy, is not conveying. 373 | 374 | An interactive user interface displays "Appropriate Legal Notices" 375 | to the extent that it includes a convenient and prominently visible 376 | feature that (1) displays an appropriate copyright notice, and (2) 377 | tells the user that there is no warranty for the work (except to the 378 | extent that warranties are provided), that licensees may convey the 379 | work under this License, and how to view a copy of this License. If 380 | the interface presents a list of user commands or options, such as a 381 | menu, a prominent item in the list meets this criterion. 382 | 383 | 1. Source Code. 384 | 385 | The "source code" for a work means the preferred form of the work 386 | for making modifications to it. "Object code" means any non-source 387 | form of a work. 388 | 389 | A "Standard Interface" means an interface that either is an official 390 | standard defined by a recognized standards body, or, in the case of 391 | interfaces specified for a particular programming language, one that 392 | is widely used among developers working in that language. 393 | 394 | The "System Libraries" of an executable work include anything, other 395 | than the work as a whole, that (a) is included in the normal form of 396 | packaging a Major Component, but which is not part of that Major 397 | Component, and (b) serves only to enable use of the work with that 398 | Major Component, or to implement a Standard Interface for which an 399 | implementation is available to the public in source code form. A 400 | "Major Component", in this context, means a major essential component 401 | (kernel, window system, and so on) of the specific operating system 402 | (if any) on which the executable work runs, or a compiler used to 403 | produce the work, or an object code interpreter used to run it. 404 | 405 | The "Corresponding Source" for a work in object code form means all 406 | the source code needed to generate, install, and (for an executable 407 | work) run the object code and to modify the work, including scripts to 408 | control those activities. However, it does not include the work's 409 | System Libraries, or general-purpose tools or generally available free 410 | programs which are used unmodified in performing those activities but 411 | which are not part of the work. For example, Corresponding Source 412 | includes interface definition files associated with source files for 413 | the work, and the source code for shared libraries and dynamically 414 | linked subprograms that the work is specifically designed to require, 415 | such as by intimate data communication or control flow between those 416 | subprograms and other parts of the work. 417 | 418 | The Corresponding Source need not include anything that users 419 | can regenerate automatically from other parts of the Corresponding 420 | Source. 421 | 422 | The Corresponding Source for a work in source code form is that 423 | same work. 424 | 425 | 2. Basic Permissions. 426 | 427 | All rights granted under this License are granted for the term of 428 | copyright on the Program, and are irrevocable provided the stated 429 | conditions are met. This License explicitly affirms your unlimited 430 | permission to run the unmodified Program. The output from running a 431 | covered work is covered by this License only if the output, given its 432 | content, constitutes a covered work. This License acknowledges your 433 | rights of fair use or other equivalent, as provided by copyright law. 434 | 435 | You may make, run and propagate covered works that you do not 436 | convey, without conditions so long as your license otherwise remains 437 | in force. You may convey covered works to others for the sole purpose 438 | of having them make modifications exclusively for you, or provide you 439 | with facilities for running those works, provided that you comply with 440 | the terms of this License in conveying all material for which you do 441 | not control copyright. Those thus making or running the covered works 442 | for you must do so exclusively on your behalf, under your direction 443 | and control, on terms that prohibit them from making any copies of 444 | your copyrighted material outside their relationship with you. 445 | 446 | Conveying under any other circumstances is permitted solely under 447 | the conditions stated below. Sublicensing is not allowed; section 10 448 | makes it unnecessary. 449 | 450 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 451 | 452 | No covered work shall be deemed part of an effective technological 453 | measure under any applicable law fulfilling obligations under article 454 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 455 | similar laws prohibiting or restricting circumvention of such 456 | measures. 457 | 458 | When you convey a covered work, you waive any legal power to forbid 459 | circumvention of technological measures to the extent such circumvention 460 | is effected by exercising rights under this License with respect to 461 | the covered work, and you disclaim any intention to limit operation or 462 | modification of the work as a means of enforcing, against the work's 463 | users, your or third parties' legal rights to forbid circumvention of 464 | technological measures. 465 | 466 | 4. Conveying Verbatim Copies. 467 | 468 | You may convey verbatim copies of the Program's source code as you 469 | receive it, in any medium, provided that you conspicuously and 470 | appropriately publish on each copy an appropriate copyright notice; 471 | keep intact all notices stating that this License and any 472 | non-permissive terms added in accord with section 7 apply to the code; 473 | keep intact all notices of the absence of any warranty; and give all 474 | recipients a copy of this License along with the Program. 475 | 476 | You may charge any price or no price for each copy that you convey, 477 | and you may offer support or warranty protection for a fee. 478 | 479 | 5. Conveying Modified Source Versions. 480 | 481 | You may convey a work based on the Program, or the modifications to 482 | produce it from the Program, in the form of source code under the 483 | terms of section 4, provided that you also meet all of these conditions: 484 | 485 | a) The work must carry prominent notices stating that you modified 486 | it, and giving a relevant date. 487 | 488 | b) The work must carry prominent notices stating that it is 489 | released under this License and any conditions added under section 490 | 7. This requirement modifies the requirement in section 4 to 491 | "keep intact all notices". 492 | 493 | c) You must license the entire work, as a whole, under this 494 | License to anyone who comes into possession of a copy. This 495 | License will therefore apply, along with any applicable section 7 496 | additional terms, to the whole of the work, and all its parts, 497 | regardless of how they are packaged. This License gives no 498 | permission to license the work in any other way, but it does not 499 | invalidate such permission if you have separately received it. 500 | 501 | d) If the work has interactive user interfaces, each must display 502 | Appropriate Legal Notices; however, if the Program has interactive 503 | interfaces that do not display Appropriate Legal Notices, your 504 | work need not make them do so. 505 | 506 | A compilation of a covered work with other separate and independent 507 | works, which are not by their nature extensions of the covered work, 508 | and which are not combined with it such as to form a larger program, 509 | in or on a volume of a storage or distribution medium, is called an 510 | "aggregate" if the compilation and its resulting copyright are not 511 | used to limit the access or legal rights of the compilation's users 512 | beyond what the individual works permit. Inclusion of a covered work 513 | in an aggregate does not cause this License to apply to the other 514 | parts of the aggregate. 515 | 516 | 6. Conveying Non-Source Forms. 517 | 518 | You may convey a covered work in object code form under the terms 519 | of sections 4 and 5, provided that you also convey the 520 | machine-readable Corresponding Source under the terms of this License, 521 | in one of these ways: 522 | 523 | a) Convey the object code in, or embodied in, a physical product 524 | (including a physical distribution medium), accompanied by the 525 | Corresponding Source fixed on a durable physical medium 526 | customarily used for software interchange. 527 | 528 | b) Convey the object code in, or embodied in, a physical product 529 | (including a physical distribution medium), accompanied by a 530 | written offer, valid for at least three years and valid for as 531 | long as you offer spare parts or customer support for that product 532 | model, to give anyone who possesses the object code either (1) a 533 | copy of the Corresponding Source for all the software in the 534 | product that is covered by this License, on a durable physical 535 | medium customarily used for software interchange, for a price no 536 | more than your reasonable cost of physically performing this 537 | conveying of source, or (2) access to copy the 538 | Corresponding Source from a network server at no charge. 539 | 540 | c) Convey individual copies of the object code with a copy of the 541 | written offer to provide the Corresponding Source. This 542 | alternative is allowed only occasionally and noncommercially, and 543 | only if you received the object code with such an offer, in accord 544 | with subsection 6b. 545 | 546 | d) Convey the object code by offering access from a designated 547 | place (gratis or for a charge), and offer equivalent access to the 548 | Corresponding Source in the same way through the same place at no 549 | further charge. You need not require recipients to copy the 550 | Corresponding Source along with the object code. If the place to 551 | copy the object code is a network server, the Corresponding Source 552 | may be on a different server (operated by you or a third party) 553 | that supports equivalent copying facilities, provided you maintain 554 | clear directions next to the object code saying where to find the 555 | Corresponding Source. Regardless of what server hosts the 556 | Corresponding Source, you remain obligated to ensure that it is 557 | available for as long as needed to satisfy these requirements. 558 | 559 | e) Convey the object code using peer-to-peer transmission, provided 560 | you inform other peers where the object code and Corresponding 561 | Source of the work are being offered to the general public at no 562 | charge under subsection 6d. 563 | 564 | A separable portion of the object code, whose source code is excluded 565 | from the Corresponding Source as a System Library, need not be 566 | included in conveying the object code work. 567 | 568 | A "User Product" is either (1) a "consumer product", which means any 569 | tangible personal property which is normally used for personal, family, 570 | or household purposes, or (2) anything designed or sold for incorporation 571 | into a dwelling. In determining whether a product is a consumer product, 572 | doubtful cases shall be resolved in favor of coverage. For a particular 573 | product received by a particular user, "normally used" refers to a 574 | typical or common use of that class of product, regardless of the status 575 | of the particular user or of the way in which the particular user 576 | actually uses, or expects or is expected to use, the product. A product 577 | is a consumer product regardless of whether the product has substantial 578 | commercial, industrial or non-consumer uses, unless such uses represent 579 | the only significant mode of use of the product. 580 | 581 | "Installation Information" for a User Product means any methods, 582 | procedures, authorization keys, or other information required to install 583 | and execute modified versions of a covered work in that User Product from 584 | a modified version of its Corresponding Source. The information must 585 | suffice to ensure that the continued functioning of the modified object 586 | code is in no case prevented or interfered with solely because 587 | modification has been made. 588 | 589 | If you convey an object code work under this section in, or with, or 590 | specifically for use in, a User Product, and the conveying occurs as 591 | part of a transaction in which the right of possession and use of the 592 | User Product is transferred to the recipient in perpetuity or for a 593 | fixed term (regardless of how the transaction is characterized), the 594 | Corresponding Source conveyed under this section must be accompanied 595 | by the Installation Information. But this requirement does not apply 596 | if neither you nor any third party retains the ability to install 597 | modified object code on the User Product (for example, the work has 598 | been installed in ROM). 599 | 600 | The requirement to provide Installation Information does not include a 601 | requirement to continue to provide support service, warranty, or updates 602 | for a work that has been modified or installed by the recipient, or for 603 | the User Product in which it has been modified or installed. Access to a 604 | network may be denied when the modification itself materially and 605 | adversely affects the operation of the network or violates the rules and 606 | protocols for communication across the network. 607 | 608 | Corresponding Source conveyed, and Installation Information provided, 609 | in accord with this section must be in a format that is publicly 610 | documented (and with an implementation available to the public in 611 | source code form), and must require no special password or key for 612 | unpacking, reading or copying. 613 | 614 | 7. Additional Terms. 615 | 616 | "Additional permissions" are terms that supplement the terms of this 617 | License by making exceptions from one or more of its conditions. 618 | Additional permissions that are applicable to the entire Program shall 619 | be treated as though they were included in this License, to the extent 620 | that they are valid under applicable law. If additional permissions 621 | apply only to part of the Program, that part may be used separately 622 | under those permissions, but the entire Program remains governed by 623 | this License without regard to the additional permissions. 624 | 625 | When you convey a copy of a covered work, you may at your option 626 | remove any additional permissions from that copy, or from any part of 627 | it. (Additional permissions may be written to require their own 628 | removal in certain cases when you modify the work.) You may place 629 | additional permissions on material, added by you to a covered work, 630 | for which you have or can give appropriate copyright permission. 631 | 632 | Notwithstanding any other provision of this License, for material you 633 | add to a covered work, you may (if authorized by the copyright holders of 634 | that material) supplement the terms of this License with terms: 635 | 636 | a) Disclaiming warranty or limiting liability differently from the 637 | terms of sections 15 and 16 of this License; or 638 | 639 | b) Requiring preservation of specified reasonable legal notices or 640 | author attributions in that material or in the Appropriate Legal 641 | Notices displayed by works containing it; or 642 | 643 | c) Prohibiting misrepresentation of the origin of that material, or 644 | requiring that modified versions of such material be marked in 645 | reasonable ways as different from the original version; or 646 | 647 | d) Limiting the use for publicity purposes of names of licensors or 648 | authors of the material; or 649 | 650 | e) Declining to grant rights under trademark law for use of some 651 | trade names, trademarks, or service marks; or 652 | 653 | f) Requiring indemnification of licensors and authors of that 654 | material by anyone who conveys the material (or modified versions of 655 | it) with contractual assumptions of liability to the recipient, for 656 | any liability that these contractual assumptions directly impose on 657 | those licensors and authors. 658 | 659 | All other non-permissive additional terms are considered "further 660 | restrictions" within the meaning of section 10. If the Program as you 661 | received it, or any part of it, contains a notice stating that it is 662 | governed by this License along with a term that is a further 663 | restriction, you may remove that term. If a license document contains 664 | a further restriction but permits relicensing or conveying under this 665 | License, you may add to a covered work material governed by the terms 666 | of that license document, provided that the further restriction does 667 | not survive such relicensing or conveying. 668 | 669 | If you add terms to a covered work in accord with this section, you 670 | must place, in the relevant source files, a statement of the 671 | additional terms that apply to those files, or a notice indicating 672 | where to find the applicable terms. 673 | 674 | Additional terms, permissive or non-permissive, may be stated in the 675 | form of a separately written license, or stated as exceptions; 676 | the above requirements apply either way. 677 | 678 | 8. Termination. 679 | 680 | You may not propagate or modify a covered work except as expressly 681 | provided under this License. Any attempt otherwise to propagate or 682 | modify it is void, and will automatically terminate your rights under 683 | this License (including any patent licenses granted under the third 684 | paragraph of section 11). 685 | 686 | However, if you cease all violation of this License, then your 687 | license from a particular copyright holder is reinstated (a) 688 | provisionally, unless and until the copyright holder explicitly and 689 | finally terminates your license, and (b) permanently, if the copyright 690 | holder fails to notify you of the violation by some reasonable means 691 | prior to 60 days after the cessation. 692 | 693 | Moreover, your license from a particular copyright holder is 694 | reinstated permanently if the copyright holder notifies you of the 695 | violation by some reasonable means, this is the first time you have 696 | received notice of violation of this License (for any work) from that 697 | copyright holder, and you cure the violation prior to 30 days after 698 | your receipt of the notice. 699 | 700 | Termination of your rights under this section does not terminate the 701 | licenses of parties who have received copies or rights from you under 702 | this License. If your rights have been terminated and not permanently 703 | reinstated, you do not qualify to receive new licenses for the same 704 | material under section 10. 705 | 706 | 9. Acceptance Not Required for Having Copies. 707 | 708 | You are not required to accept this License in order to receive or 709 | run a copy of the Program. Ancillary propagation of a covered work 710 | occurring solely as a consequence of using peer-to-peer transmission 711 | to receive a copy likewise does not require acceptance. However, 712 | nothing other than this License grants you permission to propagate or 713 | modify any covered work. These actions infringe copyright if you do 714 | not accept this License. Therefore, by modifying or propagating a 715 | covered work, you indicate your acceptance of this License to do so. 716 | 717 | 10. Automatic Licensing of Downstream Recipients. 718 | 719 | Each time you convey a covered work, the recipient automatically 720 | receives a license from the original licensors, to run, modify and 721 | propagate that work, subject to this License. You are not responsible 722 | for enforcing compliance by third parties with this License. 723 | 724 | An "entity transaction" is a transaction transferring control of an 725 | organization, or substantially all assets of one, or subdividing an 726 | organization, or merging organizations. If propagation of a covered 727 | work results from an entity transaction, each party to that 728 | transaction who receives a copy of the work also receives whatever 729 | licenses to the work the party's predecessor in interest had or could 730 | give under the previous paragraph, plus a right to possession of the 731 | Corresponding Source of the work from the predecessor in interest, if 732 | the predecessor has it or can get it with reasonable efforts. 733 | 734 | You may not impose any further restrictions on the exercise of the 735 | rights granted or affirmed under this License. For example, you may 736 | not impose a license fee, royalty, or other charge for exercise of 737 | rights granted under this License, and you may not initiate litigation 738 | (including a cross-claim or counterclaim in a lawsuit) alleging that 739 | any patent claim is infringed by making, using, selling, offering for 740 | sale, or importing the Program or any portion of it. 741 | 742 | 11. Patents. 743 | 744 | A "contributor" is a copyright holder who authorizes use under this 745 | License of the Program or a work on which the Program is based. The 746 | work thus licensed is called the contributor's "contributor version". 747 | 748 | A contributor's "essential patent claims" are all patent claims 749 | owned or controlled by the contributor, whether already acquired or 750 | hereafter acquired, that would be infringed by some manner, permitted 751 | by this License, of making, using, or selling its contributor version, 752 | but do not include claims that would be infringed only as a 753 | consequence of further modification of the contributor version. For 754 | purposes of this definition, "control" includes the right to grant 755 | patent sublicenses in a manner consistent with the requirements of 756 | this License. 757 | 758 | Each contributor grants you a non-exclusive, worldwide, royalty-free 759 | patent license under the contributor's essential patent claims, to 760 | make, use, sell, offer for sale, import and otherwise run, modify and 761 | propagate the contents of its contributor version. 762 | 763 | In the following three paragraphs, a "patent license" is any express 764 | agreement or commitment, however denominated, not to enforce a patent 765 | (such as an express permission to practice a patent or covenant not to 766 | sue for patent infringement). To "grant" such a patent license to a 767 | party means to make such an agreement or commitment not to enforce a 768 | patent against the party. 769 | 770 | If you convey a covered work, knowingly relying on a patent license, 771 | and the Corresponding Source of the work is not available for anyone 772 | to copy, free of charge and under the terms of this License, through a 773 | publicly available network server or other readily accessible means, 774 | then you must either (1) cause the Corresponding Source to be so 775 | available, or (2) arrange to deprive yourself of the benefit of the 776 | patent license for this particular work, or (3) arrange, in a manner 777 | consistent with the requirements of this License, to extend the patent 778 | license to downstream recipients. "Knowingly relying" means you have 779 | actual knowledge that, but for the patent license, your conveying the 780 | covered work in a country, or your recipient's use of the covered work 781 | in a country, would infringe one or more identifiable patents in that 782 | country that you have reason to believe are valid. 783 | 784 | If, pursuant to or in connection with a single transaction or 785 | arrangement, you convey, or propagate by procuring conveyance of, a 786 | covered work, and grant a patent license to some of the parties 787 | receiving the covered work authorizing them to use, propagate, modify 788 | or convey a specific copy of the covered work, then the patent license 789 | you grant is automatically extended to all recipients of the covered 790 | work and works based on it. 791 | 792 | A patent license is "discriminatory" if it does not include within 793 | the scope of its coverage, prohibits the exercise of, or is 794 | conditioned on the non-exercise of one or more of the rights that are 795 | specifically granted under this License. You may not convey a covered 796 | work if you are a party to an arrangement with a third party that is 797 | in the business of distributing software, under which you make payment 798 | to the third party based on the extent of your activity of conveying 799 | the work, and under which the third party grants, to any of the 800 | parties who would receive the covered work from you, a discriminatory 801 | patent license (a) in connection with copies of the covered work 802 | conveyed by you (or copies made from those copies), or (b) primarily 803 | for and in connection with specific products or compilations that 804 | contain the covered work, unless you entered into that arrangement, 805 | or that patent license was granted, prior to 28 March 2007. 806 | 807 | Nothing in this License shall be construed as excluding or limiting 808 | any implied license or other defenses to infringement that may 809 | otherwise be available to you under applicable patent law. 810 | 811 | 12. No Surrender of Others' Freedom. 812 | 813 | If conditions are imposed on you (whether by court order, agreement or 814 | otherwise) that contradict the conditions of this License, they do not 815 | excuse you from the conditions of this License. If you cannot convey a 816 | covered work so as to satisfy simultaneously your obligations under this 817 | License and any other pertinent obligations, then as a consequence you may 818 | not convey it at all. For example, if you agree to terms that obligate you 819 | to collect a royalty for further conveying from those to whom you convey 820 | the Program, the only way you could satisfy both those terms and this 821 | License would be to refrain entirely from conveying the Program. 822 | 823 | 13. Use with the GNU Affero General Public License. 824 | 825 | Notwithstanding any other provision of this License, you have 826 | permission to link or combine any covered work with a work licensed 827 | under version 3 of the GNU Affero General Public License into a single 828 | combined work, and to convey the resulting work. The terms of this 829 | License will continue to apply to the part which is the covered work, 830 | but the special requirements of the GNU Affero General Public License, 831 | section 13, concerning interaction through a network will apply to the 832 | combination as such. 833 | 834 | 14. Revised Versions of this License. 835 | 836 | The Free Software Foundation may publish revised and/or new versions of 837 | the GNU General Public License from time to time. Such new versions will 838 | be similar in spirit to the present version, but may differ in detail to 839 | address new problems or concerns. 840 | 841 | Each version is given a distinguishing version number. If the 842 | Program specifies that a certain numbered version of the GNU General 843 | Public License "or any later version" applies to it, you have the 844 | option of following the terms and conditions either of that numbered 845 | version or of any later version published by the Free Software 846 | Foundation. If the Program does not specify a version number of the 847 | GNU General Public License, you may choose any version ever published 848 | by the Free Software Foundation. 849 | 850 | If the Program specifies that a proxy can decide which future 851 | versions of the GNU General Public License can be used, that proxy's 852 | public statement of acceptance of a version permanently authorizes you 853 | to choose that version for the Program. 854 | 855 | Later license versions may give you additional or different 856 | permissions. However, no additional obligations are imposed on any 857 | author or copyright holder as a result of your choosing to follow a 858 | later version. 859 | 860 | 15. Disclaimer of Warranty. 861 | 862 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 863 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 864 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 865 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 866 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 867 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 868 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 869 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 870 | 871 | 16. Limitation of Liability. 872 | 873 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 874 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 875 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 876 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 877 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 878 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 879 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 880 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 881 | SUCH DAMAGES. 882 | 883 | 17. Interpretation of Sections 15 and 16. 884 | 885 | If the disclaimer of warranty and limitation of liability provided 886 | above cannot be given local legal effect according to their terms, 887 | reviewing courts shall apply local law that most closely approximates 888 | an absolute waiver of all civil liability in connection with the 889 | Program, unless a warranty or assumption of liability accompanies a 890 | copy of the Program in return for a fee. 891 | 892 | END OF TERMS AND CONDITIONS 893 | 894 | How to Apply These Terms to Your New Programs 895 | 896 | If you develop a new program, and you want it to be of the greatest 897 | possible use to the public, the best way to achieve this is to make it 898 | free software which everyone can redistribute and change under these terms. 899 | 900 | To do so, attach the following notices to the program. It is safest 901 | to attach them to the start of each source file to most effectively 902 | state the exclusion of warranty; and each file should have at least 903 | the "copyright" line and a pointer to where the full notice is found. 904 | 905 | {{ cookiecutter.project_short_description }} 906 | Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }} 907 | 908 | This program is free software: you can redistribute it and/or modify 909 | it under the terms of the GNU General Public License as published by 910 | the Free Software Foundation, either version 3 of the License, or 911 | (at your option) any later version. 912 | 913 | This program is distributed in the hope that it will be useful, 914 | but WITHOUT ANY WARRANTY; without even the implied warranty of 915 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 916 | GNU General Public License for more details. 917 | 918 | You should have received a copy of the GNU General Public License 919 | along with this program. If not, see . 920 | 921 | Also add information on how to contact you by electronic and paper mail. 922 | 923 | If the program does terminal interaction, make it output a short 924 | notice like this when it starts in an interactive mode: 925 | 926 | Wagtail {{ cookiecutter.project_name }} Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }} 927 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 928 | This is free software, and you are welcome to redistribute it 929 | under certain conditions; type `show c' for details. 930 | 931 | The hypothetical commands `show w' and `show c' should show the appropriate 932 | parts of the General Public License. Of course, your program's commands 933 | might be different; for a GUI interface, you would use an "about box". 934 | 935 | You should also get your employer (if you work as a programmer) or school, 936 | if any, to sign a "copyright disclaimer" for the program, if necessary. 937 | For more information on this, and how to apply and follow the GNU GPL, see 938 | . 939 | 940 | The GNU General Public License does not permit incorporating your program 941 | into proprietary programs. If your program is a subroutine library, you 942 | may consider it more useful to permit linking proprietary applications with 943 | the library. If this is what you want to do, use the GNU Lesser General 944 | Public License instead of this License. But first, please read 945 | . 946 | {% endif %} 947 | --------------------------------------------------------------------------------