views:

54

answers:

1

I am quite new to Django, so it may be a stupid question, but, nevertheless:

I need Django admin part to edit contents on the site, and also I want to have authentification, that will allow registred users to leave comments.

I have the following idea of implementation it: have 2 different tables(admins and other registred users) and use the /admin url to login in admin area and /login to login other users for leaving comments, etc.

Is this nice scheme? Or should I use the same url for all users, that will redirect admins to admin area?? What is the most simple way to implement this? Examples of nice Django code are highly appreciated. Thanks!

+4  A: 

"have 2 different tables(admins and other registred users)"

Bad idea. Django auth module has one user table. You can easily assign users to groups. Some groups have admin access to anything. Other groups can only leave comments. Read up on the auth module before you do anything more.

http://docs.djangoproject.com/en/dev/topics/auth/

"use the /admin url to login in admin area and /login to login other users for leaving comments, etc."

That's fine. Turns out, both with use the same authentication mechanism. Read this: http://docs.djangoproject.com/en/dev/topics/auth/#the-login-required-decorator

All view functions will use decorators to determine who's allowed to perform those functions.

S.Lott
thanks, this should help!
loder