hi all.
I use this code in my view for login a user in
def logmein(request):
if request.POST:
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username,password=password)
if user is not None:
if user.is_active:
login(request, user)
else:
return render_to_response('login.html', locals(),
context_instance=RequestContext(request))
assert False
return render_to_response('kontakt.html')
template:
<div id="login">
<form action="{% url mysite.kontakftormular.views.logmein %}"
method="POST" id="loginform">
<p>
<label for="username">Username:</label>
<input type="text" name="username" id="username" value="" />
<label for="password"> Passwort:</label>
<input type="password" name="password" id="password" value="" />
</p>
<input type="submit" value="Login" /></p>
</form>
</div>
well if the login is correct it links to valid.html
and valid.html links to another Funktion:
<html>
<body>
<p><a href="{% url mysite.kontakftormular.views.kontaktformular %}>:)</
a></p>
</body>
</html>
the problem now is the login formular pops up as soon as the url links
to the other funktion would be great if someone could help me out.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---