﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32734	django-admin startapp with trailing slash in directory name results in error	jooadam	Rohith P R	"Bash tab-completion appends trailing slashes to directory names. `django-admin startapp name directory/` results in the error:

{{{CommandError: '' is not a valid app directory. Please make sure the directory is a valid identifier.}}}

The error is caused by [https://github.com/django/django/blob/main/django/core/management/templates.py#L77 line 77] of `django/core/management/templates.py` by calling `basename()` on the path with no consideration for a trailing slash:

{{{#!python
self.validate_name(os.path.basename(target), 'directory')
}}}

Removing potential trailing slashes would solve the problem:

{{{#!python
self.validate_name(os.path.basename(target.rstrip(os.sep)), 'directory')
}}}"	Bug	closed	Utilities	3.2	Normal	fixed			Ready for checkin	1	0	0	0	1	0
