To be clear, I am not saying there is a bug. It does what it is programmed
to do. I am saying the expected behavior of the API / CLI / whatever you
want to call it is inconsistent.
I am not going to get into an argument of what a "proper" django structure
is, etc. I want to focus purely on the behavior of the command.
A more "normal" setup might look like this:
/repository
manage.py
/project
settings.py
urls.py
etc..
/polls
models.py
etc...
When you run `python manage.py startapp polls` from the same directory as
manage.py, it will create the polls directory for you, normal expected
behavior.
Another, equally as valid setup looks like this:
repository/
manage.py
/project
settings.py
urls.py
etc...
/polls
models.py
etc...
/my_app_2
models.py
etc...
Where all of the apps live in the project directory, or perhaps some other
directory. Now if you try to execute `python manage.py startapp polls
project`, it will complain that the directory doesn't exist and that you
need to create it first. However if you `cd` into /project, and run `python
../manage.py startapp polls`, it will create the directory for you, even
though it doesn't exist.
My ultimate point is this, the behavior of the command should not depend on
where it is ran. It should only care if the directory already exists or
not, which it does check, but the applied behavior of that check is
different depending on if you're in the line 68 if block
<https://github.com/django/django/blob/53209f78302a639032afabf5326d28d4ddd9d03c/django/core/management/templates.py#L68>
or
the line 76 else block
<https://github.com/django/django/blob/53209f78302a639032afabf5326d28d4ddd9d03c/django/core/management/templates.py#L76>.
The applied behavior ought to be the same, regardless of where the command
is ran from.
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/dfe324ce-3718-4379-b20e-a2703973869c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.