Go back to post Create new comment

RSS Be notified of new comments on this post with the RSS feed for this post.

#

Thanks a lot! Very straightforward and helpful..

#

thanks

#

Hi im using Django version 1.1.1 when logged site just displays "Welcome," to make it display username u need to add to portal/views.py

from django.template import RequestContext

and modify render_to_response to

return render_to_response('portal/index.html',{},context_instance=RequestContext(request))
Last edited by the original poster on Mon, 9th Aug 2010 13:21:08
#

I get:

TemplateSyntaxError at /portal/

Caught UnicodeDecodeError while rendering: ('utf8', 'then displays everything in templates/portal/portal.html and index.html and at the end says: {% endblock %}\n', 521, 522, 'unexpected code byte')

Any suggestions as to what might cause this?

thanks

#

Thanks. It works for me

#

Thanks, I got it working :D

I had to add a "{% csrf_token %}" to the form, though - otherwise it wouldn't let me log in.

#

I think you have missed

{% csrf_token %}

inside the form tag in the login.html file.

Thanks bdw, it was very helpful.

#

Dude, very helpful post indeed. Probably worth revisiting and including the csrf considerations in Django >1.2, e.g.

<

form method="post" action="{% url django.contrib.auth.views.login %}">{% csrf_token %}

#

Dude, very helpful post indeed. Probably worth revisiting and including the csrf considerations in Django >1.2, e.g.

<

form method="post" action="{% url django.contrib.auth.views.login %}">{% csrf_token %}

#

just dropping by to say hello

#

simply stopping by to say hello

#

Hi .. I Just found your site ...and this is very helpful.

I Have question :

A.How to route '/' to '/portal' ?

B. let's say I have a model called 'Car' under portal app, and I did not write a view for it yet. How to enable user to access this model ? all i know is something like --> admin.site.register(Car)

using that admin.site.register in portal/admin will show the model url in /admin/ page

Kindly please give me your enlightment

Sincerely -bino-

Last edited by the original poster on Tue, 26th Feb 2013 11:09:27
#

Your way of telling everything in this post is genuinely good, every one be capable of without difficulty be aware of it, Thanks a lot.

Go back to post

Create a new comment

Go to the top

You can use a restricted version of markdown formatting here. You can use the toolbar above the text field to make this more painless. For more information about markdown please refer to the markdown cheatsheet.

For post: User Authentication With Django
Your name:
Your email (optional):
Your website (optional):
 
 
 

A preview of your comment:

Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.