Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,36 @@
"password": "changeme123",
"max_line_length": "120",
"silk": [
"no",
"yes"
false,
true
],
"storage": [
"no",
"yes"
false,
true
],
"channels": [
"no",
"yes"
false,
true
],
"rosetta": [
"no",
"yes"
false,
true
],
"cacheops": [
"no",
"yes"
false,
true
],
"ckeditor": [
"no",
"yes"
false,
true
],
"modeltranslation": [
"no",
"yes"
false,
true
],
"parler": [
"no",
"yes"
false,
true
],
"version": "0.1.1"
}
28 changes: 16 additions & 12 deletions scripts/validate_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
import tomllib
from pathlib import Path

from cookiecutter.main import cookiecutter


ROOT = Path(__file__).resolve().parent.parent
DEFAULT_PROJECT = "django_blueprint"
OPTIONAL_TRUE = {
"channels": "yes",
"rosetta": "yes",
"cacheops": "yes",
"ckeditor": "yes",
"modeltranslation": "yes",
"parler": "yes",
"storage": "yes",
"silk": "yes",
"channels": True,
"rosetta": True,
"cacheops": True,
"ckeditor": True,
"modeltranslation": True,
"parler": True,
"storage": True,
"silk": True,
"cache": "yes",
"celery": "yes",
}
Expand All @@ -32,10 +34,12 @@ def run(command: list[str], cwd: Path = ROOT) -> None:


def render_project(output_dir: Path, extra_context: dict[str, str] | None = None) -> Path:
command = ["cookiecutter", str(ROOT), "--no-input", "--output-dir", str(output_dir)]
for key, value in (extra_context or {}).items():
command.append(f"{key}={value}")
run(command)
cookiecutter(
str(ROOT),
no_input=True,
output_dir=str(output_dir),
extra_context=extra_context,
)
return output_dir / DEFAULT_PROJECT


Expand Down
Loading