views.py getting big

1 view
Skip to first unread message

Tasmania

unread,
Feb 17, 2009, 7:44:09 PM2/17/09
to Django developers
Hi there,
I have one single application that has building up functionalities so
views.py has grown and it's getting big. The application is running
fast, but I'd like to partitionate views.py (i.e. putting some
functions in a different file, etc) can I do that in Django?

Thanks!

T

Alex Gaynor

unread,
Feb 17, 2009, 8:08:35 PM2/17/09
to django-d...@googlegroups.com
a) Yes you can keep views wherever you want, but in keeping with the views convention you could make views a directory and make multiple files there (plus an __init__.py file) and map the urls to the new address correctly.
b) by the time you get to this point it usually indicates that you're doing too much in one application, checkout James' video on making your apps reusable: http://www.youtube.com/watch?v=A-S0tqpPga4

Alex

--
"I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire
"The people's good is the highest law."--Cicero

Malcolm Tredinnick

unread,
Feb 17, 2009, 8:09:42 PM2/17/09
to django-d...@googlegroups.com

Please ask this question on the django-users mailing list. This list
(django-dev) is for the internal development of Django itself, not "how
do I use Django" questions.

Regards,
Malcolm


Tasmania

unread,
Feb 17, 2009, 8:39:44 PM2/17/09
to Django developers
Thanks Alex!

On Feb 17, 8:08 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:

Tasmania

unread,
Feb 17, 2009, 8:39:58 PM2/17/09
to Django developers
Sorry... will do next time

On Feb 17, 8:09 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
Reply all
Reply to author
Forward
0 new messages