Re: importing csv data into database

2015-04-23 Thread Andrew Farrell
You might have to make sure that my indentation there is correct. Also, I noticed something else about your code: you are assigning 2-tuples to all of your data types rather than strings when you do data.PersonID=row[0], data.FirstName=row[1], data.LastName=row[2], data.Address=row[3],

Re: importing csv data into database

2015-04-23 Thread Andrew Farrell
could you replace your function with def readcsvfile(request): with open('/var/www/html/webapp/csvupload/data.csv','rb') as csvfile: readata=csv.reader(csvfile,delimiter=';', quotechar='|') #readata=csv.reader(csvfile) for i, row in enumerate(readata): try:

Re: importing csv data into database

2015-04-23 Thread sum abiut
Hi, could you please help me figure out why i am getting this error i am trying to import data from csv file to model buty i am getting the error: *list index out of range* and if refering to line 20 on view which is: *data.FirstName=row[1]* view.py def readcsvfile(request): with open('/var/ww

Re: python / django demand

2015-04-23 Thread Larry Martell
On Tue, Apr 21, 2015 at 2:20 PM, Jay wrote: > Just curious if any long time python / django developers have seen an > increase in the demand/growth/popularity of these skills? I run a dev team > of python/django/aws developers building an ecommerce website and was > curious about what people think

Re: Django Migrations - Relation Already Exists

2015-04-23 Thread john
I'm a newbie here so be careful. I believe you can use manage.py migrate --fake That works for me. Johnf On 04/23/2015 11:37 AM, Rick Weinberger wrote: I posted the same question on stack overflow, here: http://stackoverflow.com/questions/29830928/django-db-utils-programmingerror-relation-alrea

Django Migrations - Relation Already Exists

2015-04-23 Thread Rick Weinberger
I posted the same question on stack overflow, here: http://stackoverflow.com/questions/29830928/django-db-utils-programmingerror-relation-already-exists I basically can't figure out how to get my app to migrate, and I can't use syncdb, because I inherit from contrib.auth. I also can't find any

Re: error logging with nginx and uWSGI

2015-04-23 Thread Larry Martell
On Thu, Apr 23, 2015 at 2:44 PM, Andrew Farrell wrote: > Hi Larry, > > What does > cd /etc/nginx && ag log > Give you? Not familar with the ag command, and it's not on my system. Googling it, it seems to be some sort of grep like tool. Grepping for log in that dir shows this: nginx.conf: access_

Re: error logging with nginx and uWSGI

2015-04-23 Thread Andrew Farrell
Hi Larry, What does cd /etc/nginx && ag log Give you? On Thu, Apr 23, 2015 at 1:05 PM, Larry Martell wrote: > This is not really a django question, but I think these are issues > folks here have faced, so I hope someone can help me. > > Prior to now, all the django p

Re: python / django demand

2015-04-23 Thread Joel Goldstick
>> >> On Tue, Apr 21, 2015 at 11:50 PM, Jay wrote: >>> >>> Just curious if any long time python / django developers have seen an >>> increase in the demand/growth/popularity of these skills? I run a dev team >>> of python/django/aws developers building an ecommerce website and was >>> curious abou

error logging with nginx and uWSGI

2015-04-23 Thread Larry Martell
This is not really a django question, but I think these are issues folks here have faced, so I hope someone can help me. Prior to now, all the django projects I've worked on have used apache and WSGI. With those, when an error occurred I went to /var/log/httpd/error_log and details of the error we

Re: Trying understand static files.

2015-04-23 Thread john
Thank you very very much! It's no longer black magic. I did not think about the fact that the template just becomes a simple HTML page and the client browser has to get the javascript as requested. Johnf On 04/23/2015 07:35 AM, C. Kirby wrote: Hi John, It can be a little confusing. Once yo

Re: Trying understand static files.

2015-04-23 Thread C. Kirby
Hi John, It can be a little confusing. Once you are in production and not using runserver, django does not serve the static files. This is what happens: The template expands this snippet with a tag: into (something like) this (Taking into account the STATIC_URL that Lachlan discussed above):

Re: Form to create several objects with one-to-one relation

2015-04-23 Thread Ilya Kazakevich
Well, I found solution. ``CreateWithInlinesView `` works perfectly with ``OneToOneField`` (after all, 1-to-1 is just a foreign key with constraint), but my main model here is ``Comment``, not ``Task``. So I should set ``Comment`` as ``model`` field in this view and ``Task`` as ``inline``. It lo