Changed 'django-admin startapp' so that it doesn't create the 'urls' directory. People have said they're a bit overwhelmed by the multiple url directories, and this one isn't necessary for basic Django usage. You can always make it yourself if you know what you're doing and want to decouple/distribute your apps.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
59c3ebc6dd
commit
a537a4efa1
|
@ -1,5 +0,0 @@
|
||||||
from django.conf.urls.defaults import *
|
|
||||||
|
|
||||||
urlpatterns = patterns('{{ project_name }}.apps.{{ app_name }}.views',
|
|
||||||
# (r'', ''),
|
|
||||||
)
|
|
|
@ -122,9 +122,6 @@ That'll create a directory structure like this::
|
||||||
models/
|
models/
|
||||||
__init__.py
|
__init__.py
|
||||||
polls.py
|
polls.py
|
||||||
urls/
|
|
||||||
__init__.py
|
|
||||||
polls.py
|
|
||||||
views/
|
views/
|
||||||
__init__.py
|
__init__.py
|
||||||
|
|
||||||
|
|
|
@ -369,9 +369,10 @@ We've been editing the URLs in ``myproject/settings/urls/main.py``, but the
|
||||||
URL design of an app is specific to the app, not to the Django installation --
|
URL design of an app is specific to the app, not to the Django installation --
|
||||||
so let's move the URLs within the app directory.
|
so let's move the URLs within the app directory.
|
||||||
|
|
||||||
Just copy the file ``myproject/settings/urls/main.py`` to
|
Create a directory ``myproject/apps/polls/urls/``, and put a blank file called
|
||||||
``myproject/apps/polls/urls/polls.py``, which had already been created, as a
|
``__init__.py`` into it. (The ``__init__.py`` file is necessary for Python to
|
||||||
stub, by ``django-admin.py startapp``.
|
treat the directory as a package.) Then copy the file
|
||||||
|
``myproject/settings/urls/main.py`` to ``myproject/apps/polls/urls/polls.py``.
|
||||||
|
|
||||||
Then, change ``myproject/settings/urls/main.py`` to remove the poll-specific
|
Then, change ``myproject/settings/urls/main.py`` to remove the poll-specific
|
||||||
URLs and insert an ``include()``::
|
URLs and insert an ``include()``::
|
||||||
|
|
Loading…
Reference in New Issue