#18296: Make creating apps inside project folder more intuitive with manage.py
startapp command
-------------------------------------+-------------------------------------
Reporter: lgp171188@… | Owner:
Type: | vanessagomes
Cleanup/optimization | Status: new
Component: Core (Management | Version: 1.4
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: manage.py, startapp | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by ptone):
* needs_tests: 0 => 1
Comment:
Thanks for the work on this.
To be clear, this is not a bug. For the currently documented behavior,
this should never work:
{{{
(django-dev)element:tmp$ django-admin.py startproject myproject
(django-dev)element:tmp$ cd myproject
(django-dev)element:myproject$ ./manage.py startapp myapp myproject
}}}
Because the destination argument to startapp should be a folder *into
which* the app package contents are injected, not a containing folder, if
that sequence ran without error, it would result in an app and a project
inside the same python package (sharing a single __init__, having a
models.py next to a settings.py etc).
The docs are: "If the optional destination is provided, Django will use
that existing directory rather than creating a new one. You can use '.' to
denote the current working directory."
If you instead meant:
{{{
./manage.py startapp myapp myproject/somedir
}}}
you instead get an error about the directory not existing and to create it
first - I'm not sure that Django shouldn't just create it if it doesn't
exist - that would be a different ticket.
If you see a way to clarify the docs on this, perhaps a documentation
ticket could be opened as well?
I see doing:
{{{
cd myproject
../manage.py startapp myapp
or
django-admin.py startapp myapp
}}}
as preferable to a backwards incompatible design change as proposed by the
patch - but that is getting into DDN territory...
--
Ticket URL: <https://code.djangoproject.com/ticket/18296#comment:10>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.