diff --git a/pyproject.toml b/pyproject.toml index 9048070..092f475 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ classifiers=[ "Framework :: Django :: 4.2", "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", + "Framework :: Django :: 6.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", diff --git a/setup.py b/setup.py deleted file mode 100644 index 429cfc3..0000000 --- a/setup.py +++ /dev/null @@ -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", - }, -) diff --git a/src/djinit/templates/config/settings/base.py-tpl b/src/djinit/templates/config/settings/base.py-tpl index c45dbe8..2aca120 100644 --- a/src/djinit/templates/config/settings/base.py-tpl +++ b/src/djinit/templates/config/settings/base.py-tpl @@ -17,7 +17,7 @@ environ.Env.read_env(env_path) BASE_DIR = Path(__file__).resolve().parent.parent.parent # 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 @@ -26,7 +26,6 @@ THIRD_PARTY_APPS = [ "rest_framework_simplejwt", "rest_framework_simplejwt.token_blacklist", "corsheaders", - "drf_yasg", "django_tailwind_cli", # @IF use_tailwind "django_htmx", # @IF use_htmx ] @@ -83,7 +82,7 @@ WSGI_APPLICATION = "[[ project_name ]].wsgi.application" # 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 = [ { @@ -102,12 +101,11 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization -# https://docs.djangoproject.com/en/6.1/topics/i18n/ +# https://docs.djangoproject.com/en/6.0/topics/i18n/ LANGUAGE_CODE = "en-us" TIME_ZONE = "UTC" USE_I18N = True -USE_TZ = True # Static files and media files STATIC_URL = "/static/" @@ -139,7 +137,6 @@ REST_FRAMEWORK = { "rest_framework_simplejwt.authentication.JWTAuthentication", "rest_framework.authentication.SessionAuthentication", ), - "DEFAULT_SCHEMA_CLASS": "rest_framework.schemas.coreapi.AutoSchema", "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", "PAGE_SIZE": 20, } diff --git a/src/djinit/templates/config/settings/development.py-tpl b/src/djinit/templates/config/settings/development.py-tpl index 67f2349..09fdf6e 100644 --- a/src/djinit/templates/config/settings/development.py-tpl +++ b/src/djinit/templates/config/settings/development.py-tpl @@ -10,7 +10,7 @@ DEBUG = True ALLOWED_HOSTS = ["*"] # Database -# https://docs.djangoproject.com/en/6.1/ref/settings/#databases +# https://docs.djangoproject.com/en/6.0/ref/settings/#databases DATABASES = { "default": { diff --git a/src/djinit/templates/config/urls.py-tpl b/src/djinit/templates/config/urls.py-tpl index bab30d3..d5cdbfc 100644 --- a/src/djinit/templates/config/urls.py-tpl +++ b/src/djinit/templates/config/urls.py-tpl @@ -9,8 +9,6 @@ from django.views.static import serve from django.urls import include # @ENDIF # @IF include_api -from drf_yasg.views import get_schema_view -from drf_yasg import openapi from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, @@ -39,22 +37,6 @@ urlpatterns = [ # @ENDLOOP # @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 # django-browser-reload for tailwind live reload (dev only) diff --git a/src/djinit/templates/project/pyproject.toml-tpl b/src/djinit/templates/project/pyproject.toml-tpl index 378f379..7797bb0 100644 --- a/src/djinit/templates/project/pyproject.toml-tpl +++ b/src/djinit/templates/project/pyproject.toml-tpl @@ -6,12 +6,11 @@ readme = "README.md" requires-python = ">=3.13" license = { text = "MIT" } dependencies = [ - "django>=6.1,<7.0", + "django>=6.0,<7.0", "django-environ", "django-jazzmin", "djangorestframework", "djangorestframework-simplejwt", - "drf-yasg", "django-cors-headers", "whitenoise", # @IF database_type == 'mysql' diff --git a/src/djinit/templates/project/requirements-tpl b/src/djinit/templates/project/requirements-tpl index 355ed8c..df9e0f7 100644 --- a/src/djinit/templates/project/requirements-tpl +++ b/src/djinit/templates/project/requirements-tpl @@ -7,7 +7,6 @@ django-environ django-jazzmin djangorestframework djangorestframework_simplejwt -drf-yasg django-cors-headers whitenoise django-tailwind-cli # @IF use_tailwind diff --git a/src/djinit/ui/input.py b/src/djinit/ui/input.py index 2058d7c..c086724 100644 --- a/src/djinit/ui/input.py +++ b/src/djinit/ui/input.py @@ -187,6 +187,9 @@ class InputCollector: """Helper method to generate metadata dictionary.""" project_dir = options["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] = [] # Default package_name to "backend" if project_dir is "." or empty