I have a site that has quite a few Django based pages plus login etc.
and I certainly had to structure the code over multiple modules.  I
suggest that you do both a top-down and a bottom-up design (actually,
iterate between these).

Start with a top-down view which is the urls - list those and plan for
a single view method for each url.  I then started with a single
view.py source file and added each view method to it.  After a while.
this single views.py grew too large to be easily manageable so I split
it.  There are two ways to split it.

Firstly, having one file called views.py is only a convention.  it is
a useful convention but it can be broken so for one of my apps, I
split the view methods into four separate source files and referred to
those from urls.py.  In my case, I had messages.py, groups.py etc.

Secondly, as one of the other posters said, if you have commonly used
utility functions then they can be pulled out into separate modules.

Once you realise that the views.py is only a convention then it just
becomes a question of structuring a large Python app.

Hope this helps,
Ian McDowall

On Jun 15, 5:55 am, Joel Klabo <joelkl...@gmail.com> wrote:
> I am working on a simple site right now and the views are pretty easy.
> Usually just iterate a loop of objects. But, I am trying to figure out
> how a website with all different kinds of data, including a sign in
> form, is setup in django. Is that all in one big view? Or, is there
> some way to combine them?
>
> Any insight would be helpful, thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to