Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6fa789804 | ||
|
|
8b48a9b9bb | ||
|
|
9793da4dbf | ||
|
|
9b6edfec0e | ||
|
|
dfcd598da3 | ||
|
|
d64ca9ddb2 | ||
|
|
3e6cb2f055 | ||
|
|
5ce5ebbb09 | ||
|
|
ca79f1968e | ||
|
|
ca077e380c | ||
|
|
44299ed8a9 | ||
|
|
916d97ffdf | ||
|
|
66927b988a | ||
|
|
df68383b44 | ||
|
|
d3066a7ceb | ||
|
|
72e6b0df0f | ||
|
|
7b8d6f3342 |
No files matched your search
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v7
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v7
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v7
|
||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.12'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#--------------------------------------------------#
|
#--------------------------------------------------#
|
||||||
# The following was generated by djinit: #
|
# The following was generated by djinit: #
|
||||||
#--------------------------------------------------#
|
#--------------------------------------------------#
|
||||||
AGENTS.md
|
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ packages = ["src/djinit"]
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "djinitx"
|
name = "djinitx"
|
||||||
version = "0.3.6"
|
version = "0.3.7"
|
||||||
description = "A CLI tool to setup Django project"
|
description = "A CLI tool to setup Django project"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
questionary==2.1.1
|
questionary==2.1.1
|
||||||
rich==15.0.0
|
rich==15.0.0
|
||||||
# dev
|
# dev
|
||||||
ruff==0.15.18
|
ruff==0.16.6
|
||||||
pre-commit==4.6.0
|
pre-commit==4.6.2
|
||||||
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="djinitx",
|
name="djinitx",
|
||||||
version="0.3.6",
|
version="0.3.7",
|
||||||
description="A CLI tool to setup Django projects",
|
description="A CLI tool to setup Django projects",
|
||||||
long_description=open("README.md").read(),
|
long_description=open("README.md").read(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ environ.Env.read_env(env_path)
|
|||||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -83,7 +83,7 @@ WSGI_APPLICATION = "[[ project_name ]].wsgi.application"
|
|||||||
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/6.1/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/5.2/topics/i18n/
|
# https://docs.djangoproject.com/en/6.1/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = "en-us"
|
LANGUAGE_CODE = "en-us"
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "UTC"
|
||||||
@@ -176,7 +176,6 @@ CORS_ALLOW_HEADERS = [
|
|||||||
|
|
||||||
CORS_PREFLIGHT_MAX_AGE = 86400 # 24 hours
|
CORS_PREFLIGHT_MAX_AGE = 86400 # 24 hours
|
||||||
# Security Settings
|
# Security Settings
|
||||||
SECURE_BROWSER_XSS_FILTER = True
|
|
||||||
SECURE_CONTENT_TYPE_NOSNIFF = True
|
SECURE_CONTENT_TYPE_NOSNIFF = True
|
||||||
X_FRAME_OPTIONS = "DENY"
|
X_FRAME_OPTIONS = "DENY"
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ DEBUG = True
|
|||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
@@ -30,8 +30,12 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Email backend for development
|
# Email settings for development
|
||||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
MAILERS = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "django.core.mail.backends.console.EmailBackend",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
# CORS settings for development
|
# CORS settings for development
|
||||||
# Allow all origins in development (convenient but not secure)
|
# Allow all origins in development (convenient but not secure)
|
||||||
|
|||||||
@@ -43,14 +43,20 @@ CORS_ALLOW_CREDENTIALS = True
|
|||||||
CORS_ALLOW_PRIVATE_NETWORK = False
|
CORS_ALLOW_PRIVATE_NETWORK = False
|
||||||
|
|
||||||
# Email settings
|
# Email settings
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
MAILERS = {
|
||||||
EMAIL_HOST = env('EMAIL_HOST', default="smtp.gmail.com")
|
'default': {
|
||||||
EMAIL_PORT = env.int('EMAIL_PORT', default=587)
|
'BACKEND': 'django.core.mail.backends.smtp.EmailBackend',
|
||||||
EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', default=True)
|
'OPTIONS': {
|
||||||
EMAIL_HOST_USER = env('EMAIL_HOST_USER', default="")
|
'host': env('EMAIL_HOST', default='smtp.gmail.com'),
|
||||||
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD', default="")
|
'port': env.int('EMAIL_PORT', default=587),
|
||||||
DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER', default="")
|
'use_tls': env.bool('EMAIL_USE_TLS', default=True),
|
||||||
SERVER_EMAIL = env('EMAIL_HOST_USER', default="")
|
'username': env('EMAIL_HOST_USER', default=''),
|
||||||
|
'password': env('EMAIL_HOST_PASSWORD', default=''),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER', default='')
|
||||||
|
SERVER_EMAIL = env('EMAIL_HOST_USER', default='')
|
||||||
|
|
||||||
# Security settings for production
|
# Security settings for production
|
||||||
SECURE_SSL_REDIRECT = True
|
SECURE_SSL_REDIRECT = True
|
||||||
@@ -63,9 +69,6 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
CSRF_COOKIE_SECURE = True
|
CSRF_COOKIE_SECURE = True
|
||||||
|
|
||||||
# Static files
|
|
||||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
|
||||||
|
|
||||||
# @IF use_tailwind
|
# @IF use_tailwind
|
||||||
## Tailwind
|
## Tailwind
|
||||||
TAILWIND_CLI_VERSION = "4.1.3" # Pin version
|
TAILWIND_CLI_VERSION = "4.1.3" # Pin version
|
||||||
|
|||||||
@@ -3,22 +3,27 @@
|
|||||||
"""generated with djinit"""
|
"""generated with djinit"""
|
||||||
|
|
||||||
"""Django's command-line utility for administrative tasks."""
|
"""Django's command-line utility for administrative tasks."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import environ
|
import environ
|
||||||
|
|
||||||
env_path = Path(__file__).resolve().parent / ".env"
|
# Load environment variables from .env
|
||||||
|
BASE_DIR = Path(__file__).resolve().parent
|
||||||
env = environ.Env()
|
env = environ.Env()
|
||||||
environ.Env.read_env(env_path)
|
env.read_env(BASE_DIR / ".env")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Run administrative tasks."""
|
"""Run administrative tasks."""
|
||||||
os.environ.setdefault(
|
os.environ.setdefault(
|
||||||
"DJANGO_SETTINGS_MODULE",
|
"DJANGO_SETTINGS_MODULE",
|
||||||
env("DJANGO_SETTINGS_MODULE", default="[[ project_name ]].settings.production"),
|
env(
|
||||||
|
"DJANGO_SETTINGS_MODULE",
|
||||||
|
default="[[ project_name ]].settings.production",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -29,12 +34,9 @@ def main():
|
|||||||
"available on your PYTHONPATH environment variable? Did you "
|
"available on your PYTHONPATH environment variable? Did you "
|
||||||
"forget to activate a virtual environment?"
|
"forget to activate a virtual environment?"
|
||||||
) from exc
|
) from exc
|
||||||
|
|
||||||
execute_from_command_line(sys.argv)
|
execute_from_command_line(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
env = environ.Env()
|
|
||||||
# Read .env file, if it exists
|
|
||||||
environ.Env.read_env()
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "[[ package_name ]]"
|
name = "[[ project_name ]]"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = ""
|
description = ""
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"django",
|
"django>=6.1,<7.0",
|
||||||
"django-environ",
|
"django-environ",
|
||||||
"django-jazzmin",
|
"django-jazzmin",
|
||||||
"djangorestframework",
|
"djangorestframework",
|
||||||
@@ -37,9 +37,9 @@ dependencies = [
|
|||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = [
|
||||||
"ruff>=0.14.2",
|
"ruff>=0.16.6",
|
||||||
"pytest>=8.0.0",
|
"pytest>=9.1.1",
|
||||||
"pytest-django>=4.9.0",
|
"pytest-django>=4.14.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
@@ -62,4 +62,7 @@ ignore = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
known-first-party = ["[[ module_name ]]"]
|
known-first-party = ["[[ project_name ]]"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
"[[ project_name ]]/settings/*.py" = ["F403", "F405"]
|
||||||
Reference in new issue
Block a user