News for hackers. Stuff that matters.
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.
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.
Re:Show HN: My first python web app - What do you want to do... by adlq on Saturday January 12, 2013 @12:29PM (#5048270)
I've got a 'KeyError at /twitter/thanks' when refusing access from the app to my twitter account (no offense meant, I was just testing it out) and then clicking on "Go Back to This Year" (which, I guess, is supposed to redirect me to the app?). I can send you the full error page if you want.

Anyways, kudos on your first Python app & keep building things!

Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:41AM (#5051090)
Thanks! I'm so pleased to have finally built my first one. I'm sorry about the error - I'll look into it.
Re:Show HN: My first python web app - What do you want to do... by sycren on Saturday January 12, 2013 @12:23PM (#5048253)
I was thinking of making a python web app integrated with Twitter. Why did you choose python over other languages and what else was in the stack?
Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:46AM (#5051099)
Hi sycren, I mainly chose python because of http://learnpythonthehardway.org/. I've tried so many different tutorials but this one really clicked with me. I also used Django (following this https://docs.djangoproject.com/en/1.4/intro/tutorial01/) The other languages I used were HTML, CSS, JavaScript and jQuery. Thanks to Twitter Bootstrap I didn't have to do much with the CSS. I would definitely recommend the tutorials above.
Re:Show HN: My first python web app - What do you want to do... by jimzvz on Saturday January 12, 2013 @11:52AM (#5048169)
Looks cool, it would be nice to have some kind of voting system for pledges and maybe reminders to achieve the pledge every few months.

Also, the design works on mobile but isn't really that aesthetically pleasing with normal screen resolutions.

Getting some errors too: http://i.imgur.com/iLRRG.png

Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:50AM (#5051113)
Thanks jimzvz. I'm planning to add more features over the next couple of weeks. Thanks for pointing out the errors - I'll look into those.
Re:Show HN: My first python web app - What do you want to do... by arenaninja on Saturday January 12, 2013 @02:02PM (#5048534)
I quite like the simplicity of it. Personally, I'd move the "Submit" button next to the textbox for the resolution or directly underneath it (to the right of the checkbox's label).

Can I ask what framework you used (if any)? Also, it seems like you're repeating a lot of in-line css, you would really benefit of adding another CSS file.

Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:47AM (#5051104)
Thanks arenaninja. Yes, I used Django and Twitter Bootstrap as proexploit said.
Re:Show HN: My first python web app - What do you want to do... by proexploit on Saturday January 12, 2013 @02:04PM (#5048546)
It's Twitter Bootstrap.
Re:Show HN: My first python web app - What do you want to do... by smit on Saturday January 12, 2013 @12:03PM (#5048195)
Nice app. Looks very similar to http://startupresolution.com that we launched on hn on 29th.
Re:Show HN: My first python web app - What do you want to do... by wanghq on Saturday January 12, 2013 @03:32PM (#5048799)
I keep seeing similar apps popping up on HN. Wish you guys the best! Making an app is simple, but do you have a plan to continuously improve your app/bring more people to your app. Take startupresolution.com for example, how many startup resolutions does a person make per year? Do you expect people to use it once or few times per year? Saying one thing is easy, but doing it is hard. One thing you guys might can try is that providing a feature to let people follow up the resolutions/iwant. Otherwise, it's not that useful.
Re:Show HN: My first python web app - What do you want to do... by smit on Saturday January 12, 2013 @04:22PM (#5048932)
Great point. Our goal was just to have a campaign but it would be nice to have a system to keep track of the resolutions and maybe have resources to keep them.
Re:Show HN: My first python web app - What do you want to do... by dwolchon on Saturday January 12, 2013 @01:15PM (#5048398)
I like how the options are already pre-filled for you. It took me a second to realize I should scroll down, I wasn't sure what to do (if some element was clickable, etc).
Re:Show HN: My first python web app - What do you want to do... by smit on Saturday January 12, 2013 @04:24PM (#5048939)
good point. issue was that it was hard to fit the description and buttons above the fold. something clickable to scroll would have definitely been a good idea.
Re:Show HN: My first python web app - What do you want to do... by prezjordan on Saturday January 12, 2013 @02:09PM (#5048560)
I've always loved that shade of orange (or is it closer to salmon?)
Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:56AM (#5051132)
Thanks smit. Startup Resolution looks awesome. I love the design!
Re:Show HN: My first python web app - What do you want to do... by ceeK on Saturday January 12, 2013 @12:02PM (#5048193)
I like it tis pretty cool.

I'm not a Pythoner but I believe you have debug mode on, was revealing some errors to me.

Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:57AM (#5051136)
Thanks ceeK. I've set the debug mode to false now.
Re:Show HN: My first python web app - What do you want to do... by chewxy on Saturday January 12, 2013 @11:46AM (#5048150)
Cool. What's the stack?
Re:Show HN: My first python web app - What do you want to do... by jessratcliffe on Sunday January 13, 2013 @11:54AM (#5051130)
Thanks. It's built using Django, Bootstrap, Heroku, Postgres and twython.