startapp creating urls.py?

127 views
Skip to first unread message

James Bennett

unread,
Apr 9, 2006, 10:02:01 PM4/9/06
to django-d...@googlegroups.com
A good question was just raised by a friend of mine who's trying out
Django: we encourage the use of a URLConf for each application to
ensure pluggability, but manage.py doesn't create one when you start a
new app.

How would people feel about changing that so that 'manage.py startapp'
creates a urls.py in the app directory, and maybe generates the
appropriate include statement in the project-wide URLConf?

--
"May the forces of evil become confused on the way to your house."
-- George Carlin

Seth Falcon

unread,
Apr 9, 2006, 11:30:14 PM4/9/06
to django-d...@googlegroups.com
"James Bennett" <ubern...@gmail.com> writes:
> How would people feel about changing that so that 'manage.py startapp'
> creates a urls.py in the app directory,

I think that's a nice idea, especially since a per app urls.py seems
to be recommended. +1

> and maybe generates the appropriate include statement in the
> project-wide URLConf?

I wonder if just adding a comment to the generated <app>/urls.py file
with a line that could be copy/pasted would be a good compromise?

+ seth

SmileyChris

unread,
Apr 10, 2006, 12:28:05 AM4/10/06
to Django developers
+1 to creating urls.py

-1 to changing project-wide URLConf
+1 to comment to copy in urls.py

:)

Adrian Holovaty

unread,
Apr 11, 2006, 10:16:39 AM4/11/06
to django-d...@googlegroups.com
On 4/9/06, James Bennett <ubern...@gmail.com> wrote:
> How would people feel about changing that so that 'manage.py startapp'
> creates a urls.py in the app directory, and maybe generates the
> appropriate include statement in the project-wide URLConf?

I've gone back and forth on this one. If I recall correctly, startapp
used to do that, and we removed it to make things seem simpler. (Fewer
files == less scary.) Then again, it's an extra convenience to create
the urls.py automatically. Ehh, I'm +0 either way.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

limodou

unread,
Apr 11, 2006, 10:45:33 AM4/11/06
to django-d...@googlegroups.com

Yes, I also remember this. So -0

Because copy urls.py from the project is easily. You can modify the
project's urls.py to suit for your need.

--
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

Reply all
Reply to author
Forward
0 new messages