views:

28

answers:

1

So I ran through a lot of Django tuts and I seem to understand the basics.

I know everything about the urls.py.

But now I need to design the urls for the whole site.

It seems not as easy as I imagined.

I would like to achieve the following.

overall structure:

main-site/

main_site/projects/

main_site/projects/project1
         /project2
        /project3
        /projectn

Project structure:

Every project has components that every Project shares:

projectn/description
projectn/criteria_to_participate
projectn/other

And components that just that project has.


projectn/section1/paginatorgallery1
projectn/section2/paginatorgallery2
projectn/final_summary/

If somebody lands in projectn/section1/paginatorgallery1

So my questions:

  1. Is this a good structure?
  2. Is there a site, resource to get some nice overview of django site structures for certain purposes? e.g. Webgallery, Photosite, Blog, Professional Site etc..
  3. Is there a way to prevent people to go back e.g. to main_site, once in one project?

So if the user would just manually take away urls:

e.g. He is actually is on:

/main_site/project1/gallery

and manually takes away gallery in the browser.

/main_site/project1/

Can I say that is forbidden? How can I achieve this?

  1. Can I solve that by letting people login in?

And how can I achieve a url system that deals with the logged in user different?

In other words how do I have to design the urls if I have a login and a non login part?

I know a lot of questions.

But I hope that everybody had to go through this part sooner or later and might be able to share some insights..

Thanks

A: 

Is this a good structure?

This is a subjective question. You project layout looks OK to me but that doesn't mean much. I suggest that you use this as a starting point and change if and when you find it inadequate.

Is there a site, resource to get some nice overview of django site structures for certain purposes? e.g. Webgallery, Photosite, Blog, Professional Site etc..

There a bunch of good Django projects out there (take this listing of blog engines for instance). A Google search should yield some nice examples.

Is there a way to prevent people to go back e.g. to main_site, once in one project?

Why do you want to do this? Giving specific reasons for this would help people provide better answers.

In other words how do I have to design the urls if I have a login and a non login part?

One way to achieve this would be to decorate the views that require login with the appropriately named login_required decorator. Other views that do not need logging in can be left alone.

Manoj Govindan
ad "Is there a way to prevent people to go back e.g. to main_site, once in one project?"Because the user is linked into that project and should stay in that project and preferably neither go back nor fast forward to the end. Think of it as a survey. When you dont want users to jump around but run through your survey. You cant prevent to drop out, but to go back and fast forward.
MacPython