On Nov 3, 2010, at 12:31 PM, Sebastian Alonso wrote:

>     Hi everyone, I'm a complete django newbie, and I need to use the Auth 
> system. The problem is that I haven't been able to find a good tutorial such 
> as que django one, with all the examples, pretty simple, very easy, with the 
> templates included, etc... My main issue is that i dont get on well with 
> html, so the templates are a complete mistery, and the forms, and everything. 
> The django tutorial provides you with the different templates and everything.
> 
>     For example if I search among the other tutorials in the django site, 
> there are tutorials related to the Auth system, but they are somehow more 
> advanced than what I'm looking for. For example there's one on how to expand 
> the user model.. but I dont even know who to use the basic auth system :P
> 
> 
> So, if you know of any tutorial like the one I describe let me know, any link 
> is helpful...

Hi Sebastian,

The documentation for auth is here: 
http://docs.djangoproject.com/en/1.2/topics/auth/

Part of that documentation covers what you need, I think, but it isn't 
necessarily obvious which parts you need just to get started, so here are some 
pointers.  You need to mark the views you want protected with the 
@login_required decorator, as documented here:  
http://docs.djangoproject.com/en/1.2/topics/auth/#the-login-required-decorator

You need to add the login view to your URLs, there's boilerplate for this 
immediately above this link:  
http://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.views.login

In that same section, but a bit further down, there's a code listing for a 
login template, which should go in registration/login.html.

That should be enough to get you started.  There are more parts to it all, 
which are covered in the auth documentation linked above, but just start with 
the parts I've listed and you will have a decent simple basis for 
authentication within your app.  You can add the other bits and pieces as you 
find you need them (for instance, a logout page, groups and permissions are the 
common ones).

Hope that helps,

---Peter Herndon

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

Reply via email to