Re: How to: Django development and debugging

2016-10-22 Thread Mike Dewhirst
On Thursday, October 20, 2016 at 8:30:45 PM UTC-4, Don Thilaka Jayamanne wrote: Hi Everyone, I'm the author of a Python plugin for the VS Code editor (https://github.com/DonJayamanne/pythonVSCode ). Basically it provides

Re: Am I missing a design pattern? My views code somehow isn't as elegant as it should be...

2016-10-22 Thread Vinicius Assef
I'd say you're missing a service layer. It's known as a good practice to not have "business rules" in your views. IP lookup should be done in your view anyway, because it's a "web related thing". The `save_the_lead()` and email sending should be in the service layer. Extending a little bit and

Re: Django can't find database

2016-10-22 Thread Gary Roach
psql -U gary -d archivedb gives: FATAL: Peer authentication failed for user "gary" which probably means that psql can't find the database either. My process table ( ps -xaf) shows: 642 ?S 0:07 /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c

Re: Django can't find database

2016-10-22 Thread Vijay Khemlani
Can you connect to the database via command line? psql -U gary -d archivedb On Sat, Oct 22, 2016 at 3:48 PM, Jamie Lawrence wrote: > > > On Oct 22, 2016, at 11:35 AM, Gary Roach > wrote: > > > When I try to migrate, I get the following error:

Re: Am I missing a design pattern? My views code somehow isn't as elegant as it should be...

2016-10-22 Thread ludovic coues
Class Based View really shine in form handling. You can find the documentation at [1]. All the boilerplate code will be 3 assignment like template_name = 'wizard/questionnaire.html' while the logic will go into form_valid function. I would also add a comment for the Matcher object and why the m

Re: Tutorial part 4 help: the raidio buttons to make a choice on the polls question won't show.

2016-10-22 Thread ludovic coues
I would try to add that right before the loop: {{ question|pprint }} {{ question.choice_set.all|pprint }} The result should be something like that the pprint filter is for debugging, you should remove once your issue is fixed. It will make obvious some error like

Re: Django can't find database

2016-10-22 Thread Jamie Lawrence
> On Oct 22, 2016, at 11:35 AM, Gary Roach wrote: > When I try to migrate, I get the following error: > >> psycopg2.OperationalError: FATAL: database "archivedb" does not exist > What's happening here? Are you certain the ‘archivedb’ database actually exists?

Django can't find database

2016-10-22 Thread Gary Roach
Hi all, Debian System, stretch, 64 bit. KDE4 Desktop Django 1.10 Postgresql 9.6 with psycopg2 When I try to migrate, I get the following error: Traceback (most recent call last): File "/home/gary/workspace/djenv/lib/python3.5/site-packages/django/db/backends/base/base.py", line 199, in

Re: Deploy on Heroku Error

2016-10-22 Thread Aline C. R. Souza
Hi Constantine, I did such changes because Gunicorn does not work on Windows, as the article itself states. And the psycopg2==2.5.3 does not work with Visual Studio Community 2015. Your comment made me have an idea. I'll try to deploy with psycopg2 instead of gunicorn. It is a sample blog for