Re:Show HN: My first python web app - What do you want to do...
by mmq on Saturday January 12, 2013 @12:51PM
(#5048331)
You should probably set DEBUG at False. This is very undesirable in a production environment as it will probably leak sensitive information that attackers can use against your site. Unless, of course, if you use only the Django ORM.
[ Parent
| on HN ]
Re:Show HN: My first python web app - What do you want to do...
by jessratcliffe on Sunday January 13, 2013 @11:40AM
(#5051085)
Thank you. I've tried setting debug to false but it causes a problem with the template. Do you know how I set it to false without affecting the design? I've tried a couple of ways as suggested on SO but all seem to return a server error.
Re:Show HN: My first python web app - What do you want to do...
by mmq on Sunday January 13, 2013 @03:07PM
(#5051713)
How is your design affected?
For the case when the user isn't willing to give access to his/her twitter account.
The error returned is KeyError, since you are trying to access :
user = User.objects.get(username = authorized_tokens['screen_name'])
I see that you have put a try, except blocks. But you are not catching the KeyError exception. You are only making an exception when the user doesn't exist.
you should add a block : except KeyError. And figure out the logic for this particular case. (probably just redirecting the user to the home page)
Re:Show HN: My first python web app - What do you want to do...
by cookingrobot on Sunday January 13, 2013 @03:33AM
(#5050308)
Seconded - I tried to participate but wasn't willing to give access to my twitter account. It gave me a very verbose error page.