Yes.  Django is python and python can handle a modular layout. But
it's not PHP/Zend.  You will have to entirely rewire your brain by
learning Python. There is a respectable curve to climb if you're
coming from PHP.

But to give you some comparison I have about 8 months experience with
django (and a lifetime of programming) and, very recently, to achieve
a similar goal to yours - separate, isolated authentication entry
points - i've managed to cut/paste/rewrite the contrib.auth in, say,
30 hours.  The result uses our models - not joined to auth_user -, is
keyed by email address rather than username, and shares nothing with
an administrator's session  - so different user/pass, reauth if you go
from one 'site' to another.  I expect it will take me another 20-30
hours to bed down the suite of decorators for the permissioning model
we're looking for.

Maybe that helps.

On Nov 18, 7:57 am, "esatterwh...@wi.rr.com" <esatterwh...@wi.rr.com>
wrote:
> I think all you would need to do is organize the permissions and
> assign users to groups with the permissions need to access the various
> views / data.
>
> You could also easily make decorators for the view function. something
> like @employee_login_required that checks if the user is loged in and
> if the logged in user has the permissions to move on. If they don't
> you just redirect them somewhere else or don't display certain links
> in the template to get there ( both is probably the best option ).  or
> check for is_staff  in the User object. or put a check for
> is_employee
>
> I don't think you would need to make a different permissions system,
> you can create any number of permissions for any model and check for
> them in your views and in templates. I would think this is all you
> need to do. Make a permission can_view_stat_site, and check for it.
> @permission_required('yourapp.can_view_stat_site')
> def your_viewcode(self):
> ...
>
> You can import your model into another just like any other python
> module, But this would make your code less modular if that is what you
> are going for. I think the primary problem here is you are trying to
> build a site the same way you did with Zend, but in django (?)
>
> On Nov 17, 4:54 am, zimnyx <zim...@gmail.com> wrote:
>
> > Guys,
>
> > I'm trying to lay out Django code for large "website", which consists
> > of four subsytems:
> > - employees' website
> > - statistics website used also by employees
> > - public website (with users accounts)
> > - monitoring webservices
>
> > This four components have different:
> > - auth types,
> > - different user types (employee account has really nothing to do with
> > customer account)
> > - different permission system
> > - different webpage layout, css, media
> > - different forms
>
> > What is common between them:
> > - they use the same database
> > - most of models are shared between
> > - global configuration (database uri, debug level, i18n, session etc.)
>
> > In (for example) Zend Framework it's very easy to lay out:
> > every subsystem is one ZF module and authentication is delegated to
> > appropriate plugin based on detected module. Every module has its own
> > controllers (Django views) + helpers, templates etc. Models connected
> > with specific module are stored within module directory, and "global"
> > models are available for all ZF modules. All rocks in a minute, code
> > has very readable structure.
>
> > Can Django handle such modular code layout?
> > What's your advice?
>
> > Cheers,
> > Piotrek

--

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=.


Reply via email to