#32734: django-admin startapp with trailing slash in directory name results in
error
---------------------------+---------------------------------------------
Reporter: jooadam | Owner: Rohith P R
Type: Bug | Status: closed
Component: Utilities | Version: 3.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------+---------------------------------------------
Comment (by dotuser):
Does any plan backport https://github.com/django/django/pull/11270 and
https://github.com/django/django/pull/14382 to branch stable/2.2.x and
stable/3.2.x.
{{{
# https://github.com/django/django/pull/11270
(base) root@69faeb96:/tmp/123321/django# git branch -a --contains
fc9566d42daf28cdaa25a5db1b5ade253ceb064f
* main
stable/3.2.x
remotes/origin/HEAD -> origin/main
remotes/origin/main
remotes/origin/make-zoneinfo-default-timezone-implementation
remotes/origin/stable/3.0.x
remotes/origin/stable/3.1.x
remotes/origin/stable/3.2.x
# https://github.com/django/django/pull/14382
(base) root@69faeb96-0f43-442b-ad2d-3e5cfa31f6d5:/tmp/123321/django# git
branch -a --contains 530f58caaa5052e9e56bf8461caee4d821953bcb
* main
remotes/origin/HEAD -> origin/main
remotes/origin/main
remotes/origin/make-zoneinfo-default-timezone-implementation
}}}
Or, startapp will crash bug since PR
https://github.com/django/django/pull/11270:
{{{
(base) root@69faeb96:/tmp# /tmp/venv/bin/python -m django --version
3.2.6
(base) root@69faeb96:/tmp# /tmp/venv/bin/python -m django startproject
my_project -v3 && cd my_project
Rendering project template files with extensions: .py
Rendering project template files with filenames:
Creating /tmp/my_project/manage.py
Creating /tmp/my_project/my_project/__init__.py
Creating /tmp/my_project/my_project/asgi.py
Creating /tmp/my_project/my_project/settings.py
Creating /tmp/my_project/my_project/urls.py
Creating /tmp/my_project/my_project/wsgi.py
(base) root@69faeb96:/tmp/my_project# mkdir -p my_app && cd my_app
(base) root@69faeb96:/tmp/my_project/my_app# /tmp/venv/bin/python -m
django startapp my_app . -v3
CommandError: '.' is not a valid app directory. Please make sure the
directory is a valid identifier.
}}}
However, that's ok if startapp with other same method:
{{{
(base) root@69faeb96:/tmp/my_project/my_app# cd ..
(base) root@69faeb96:/tmp/my_project# ls
manage.py my_app my_project
(base) root@69faeb96:/tmp/my_project# rm -rf my_app/
(base) root@69faeb96:/tmp/my_project# ls
manage.py my_project
(base) root@69faeb96:/tmp/my_project# /tmp/venv/bin/python -m django
startapp my_app -v3
Rendering app template files with extensions: .py
Rendering app template files with filenames:
Creating /tmp/my_project/my_app/__init__.py
Creating /tmp/my_project/my_app/admin.py
Creating /tmp/my_project/my_app/apps.py
Creating /tmp/my_project/my_app/models.py
Creating /tmp/my_project/my_app/tests.py
Creating /tmp/my_project/my_app/views.py
Creating /tmp/my_project/my_app/migrations/__init__.py
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32734#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.68443d34de341e23edf0f2a0a93a8c96%40djangoproject.com.