fix: resolve '.' project name and clean up templates
- Resolve current directory to folder name when using '.' - Remove obsolete setup.py - Update Django classifier and template dependencies to 6.0 - Remove deprecated USE_TZ, coreapi schema, and drf-yasg
This commit is contained in:
8 files changed
+9
-91
No files matched your search
@@ -38,6 +38,7 @@ classifiers=[
|
|||||||
"Framework :: Django :: 4.2",
|
"Framework :: Django :: 4.2",
|
||||||
"Framework :: Django :: 5.1",
|
"Framework :: Django :: 5.1",
|
||||||
"Framework :: Django :: 5.2",
|
"Framework :: Django :: 5.2",
|
||||||
|
"Framework :: Django :: 6.0",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
from setuptools import find_packages, setup
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="djinitx",
|
|
||||||
version="0.3.7",
|
|
||||||
description="A CLI tool to setup Django projects",
|
|
||||||
long_description=open("README.md").read(),
|
|
||||||
long_description_content_type="text/markdown",
|
|
||||||
author="Sankalp Tharu",
|
|
||||||
author_email="sankalptharu50028@gmail.com",
|
|
||||||
url="https://github.com/S4NKALP/djinit",
|
|
||||||
packages=find_packages(where="src"),
|
|
||||||
package_dir={"": "src"},
|
|
||||||
include_package_data=True,
|
|
||||||
install_requires=[
|
|
||||||
"rich>=14.2.0",
|
|
||||||
"questionary>=2.0.1",
|
|
||||||
"typer>=0.21.1",
|
|
||||||
],
|
|
||||||
entry_points={
|
|
||||||
"console_scripts": [
|
|
||||||
"djinit=djinit.cli:app",
|
|
||||||
"dj=djinit.cli:app",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
classifiers=[
|
|
||||||
"Programming Language :: Python",
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"Programming Language :: Python :: 3.10",
|
|
||||||
"Programming Language :: Python :: 3.11",
|
|
||||||
"Programming Language :: Python :: 3.12",
|
|
||||||
"Programming Language :: Python :: 3.13",
|
|
||||||
"Environment :: Web Environment",
|
|
||||||
"Framework :: Django",
|
|
||||||
"Framework :: Django :: 4.2",
|
|
||||||
"Framework :: Django :: 5.1",
|
|
||||||
"Framework :: Django :: 5.2",
|
|
||||||
"Intended Audience :: Developers",
|
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"Operating System :: OS Independent",
|
|
||||||
"Topic :: Internet :: WWW/HTTP",
|
|
||||||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
||||||
"Topic :: Software Development :: Code Generators",
|
|
||||||
],
|
|
||||||
keywords=[
|
|
||||||
"django",
|
|
||||||
"cli",
|
|
||||||
"project",
|
|
||||||
"djinit",
|
|
||||||
"djinitx",
|
|
||||||
"dj",
|
|
||||||
"django-init",
|
|
||||||
"django project",
|
|
||||||
"django starter",
|
|
||||||
],
|
|
||||||
python_requires=">=3.10",
|
|
||||||
project_urls={
|
|
||||||
"Bug Reports": "https://github.com/S4NKALP/djinit/issues",
|
|
||||||
"Source": "https://github.com/S4NKALP/djinit",
|
|
||||||
"Documentation": "https://github.com/S4NKALP/djinit#readme",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
@@ -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/6.1/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -26,7 +26,6 @@ THIRD_PARTY_APPS = [
|
|||||||
"rest_framework_simplejwt",
|
"rest_framework_simplejwt",
|
||||||
"rest_framework_simplejwt.token_blacklist",
|
"rest_framework_simplejwt.token_blacklist",
|
||||||
"corsheaders",
|
"corsheaders",
|
||||||
"drf_yasg",
|
|
||||||
"django_tailwind_cli", # @IF use_tailwind
|
"django_tailwind_cli", # @IF use_tailwind
|
||||||
"django_htmx", # @IF use_htmx
|
"django_htmx", # @IF use_htmx
|
||||||
]
|
]
|
||||||
@@ -83,7 +82,7 @@ WSGI_APPLICATION = "[[ project_name ]].wsgi.application"
|
|||||||
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/6.1/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
{
|
{
|
||||||
@@ -102,12 +101,11 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/6.1/topics/i18n/
|
# https://docs.djangoproject.com/en/6.0/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = "en-us"
|
LANGUAGE_CODE = "en-us"
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "UTC"
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
USE_TZ = True
|
|
||||||
|
|
||||||
# Static files and media files
|
# Static files and media files
|
||||||
STATIC_URL = "/static/"
|
STATIC_URL = "/static/"
|
||||||
@@ -139,7 +137,6 @@ REST_FRAMEWORK = {
|
|||||||
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
||||||
"rest_framework.authentication.SessionAuthentication",
|
"rest_framework.authentication.SessionAuthentication",
|
||||||
),
|
),
|
||||||
"DEFAULT_SCHEMA_CLASS": "rest_framework.schemas.coreapi.AutoSchema",
|
|
||||||
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
|
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
|
||||||
"PAGE_SIZE": 20,
|
"PAGE_SIZE": 20,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ DEBUG = True
|
|||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
|
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ from django.views.static import serve
|
|||||||
from django.urls import include
|
from django.urls import include
|
||||||
# @ENDIF
|
# @ENDIF
|
||||||
# @IF include_api
|
# @IF include_api
|
||||||
from drf_yasg.views import get_schema_view
|
|
||||||
from drf_yasg import openapi
|
|
||||||
from rest_framework_simplejwt.views import (
|
from rest_framework_simplejwt.views import (
|
||||||
TokenObtainPairView,
|
TokenObtainPairView,
|
||||||
TokenRefreshView,
|
TokenRefreshView,
|
||||||
@@ -39,22 +37,6 @@ urlpatterns = [
|
|||||||
# @ENDLOOP
|
# @ENDLOOP
|
||||||
# @ENDIF
|
# @ENDIF
|
||||||
]
|
]
|
||||||
# @IF include_api
|
|
||||||
|
|
||||||
# Don't show schema in production
|
|
||||||
if settings.DEBUG:
|
|
||||||
schema_view = get_schema_view(
|
|
||||||
openapi.Info(
|
|
||||||
title="[[ project_name ]] API",
|
|
||||||
default_version="v1",
|
|
||||||
),
|
|
||||||
public=True,
|
|
||||||
)
|
|
||||||
urlpatterns += [
|
|
||||||
path("docs/", schema_view.with_ui("swagger", cache_timeout=0)),
|
|
||||||
path("schema/", schema_view.with_ui("redoc", cache_timeout=0)),
|
|
||||||
]
|
|
||||||
# @ENDIF
|
|
||||||
# @IF use_tailwind
|
# @IF use_tailwind
|
||||||
|
|
||||||
# django-browser-reload for tailwind live reload (dev only)
|
# django-browser-reload for tailwind live reload (dev only)
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ readme = "README.md"
|
|||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"django>=6.1,<7.0",
|
"django>=6.0,<7.0",
|
||||||
"django-environ",
|
"django-environ",
|
||||||
"django-jazzmin",
|
"django-jazzmin",
|
||||||
"djangorestframework",
|
"djangorestframework",
|
||||||
"djangorestframework-simplejwt",
|
"djangorestframework-simplejwt",
|
||||||
"drf-yasg",
|
|
||||||
"django-cors-headers",
|
"django-cors-headers",
|
||||||
"whitenoise",
|
"whitenoise",
|
||||||
# @IF database_type == 'mysql'
|
# @IF database_type == 'mysql'
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ django-environ
|
|||||||
django-jazzmin
|
django-jazzmin
|
||||||
djangorestframework
|
djangorestframework
|
||||||
djangorestframework_simplejwt
|
djangorestframework_simplejwt
|
||||||
drf-yasg
|
|
||||||
django-cors-headers
|
django-cors-headers
|
||||||
whitenoise
|
whitenoise
|
||||||
django-tailwind-cli # @IF use_tailwind
|
django-tailwind-cli # @IF use_tailwind
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ class InputCollector:
|
|||||||
"""Helper method to generate metadata dictionary."""
|
"""Helper method to generate metadata dictionary."""
|
||||||
project_dir = options["project_dir"]
|
project_dir = options["project_dir"]
|
||||||
project_name = project_dir
|
project_name = project_dir
|
||||||
|
if project_name == "." or not project_name:
|
||||||
|
project_name = os.path.basename(os.path.abspath(os.getcwd()))
|
||||||
|
|
||||||
app_names: list[str] = []
|
app_names: list[str] = []
|
||||||
|
|
||||||
# Default package_name to "backend" if project_dir is "." or empty
|
# Default package_name to "backend" if project_dir is "." or empty
|
||||||
|
|||||||
Reference in new issue
Block a user