Re: __unicode__() addition not working in basic poll application.

2014-03-27 Thread Steve Evans
Hi I am having the same issue: I am using Python 2.7, and Django 1.6. Here is my code for models.py: import datetime from django.db import models from django.utils import timezone # Create your models here. class Poll(models.Model): question = models.CharField(max_length=200) def __unicode_

Re: __unicode__() addition not working in basic poll application.

2014-03-27 Thread Shai Efrati
i wonder if it is just the formatting of the email, but i think you missed spaces before your def. def are hierarchically under classes, so it should be: import datetime from django.db import models from django.utils import timezone # Create your models here. class Poll(models.Model): questio

Re: wsgi does not work as intended even it works fine when python manage.py runserver 0.0.0.0:8000

2014-03-27 Thread Liam Thompson
Are you seeing any error messages ? On Saturday, 22 March 2014 11:07:32 UTC+2, Jun Tanaka wrote: > > Hello, > > wsgi does not work as usually even it works fine when python manage.py > runserver 0.0.0.0:8000 > I use django version 1.3 > > I have two issues here. > 1. how to add projectname insid

Re: __unicode__() addition not working in basic poll application.

2014-03-27 Thread Steve Evans
Thankyou! so much...! It was because i had tabs instead of 4 spaces for the indents. So basically it was an indentation error but it didn't say that in the console. I think this will fix a lot of other peoples problems if they are using tabs instead of spaces for indentations. Cheers. On Thur

Re: __unicode__() addition not working in basic poll application.

2014-03-27 Thread Matheus Henrique Oliveira
Hi Steve. The __unicode__ method must be within the model class. I took your code and applied the fix. http://pastebin.com/sH2J50jS 2014-03-27 7:06 GMT-03:00 Steve Evans <00sev...@gmail.com>: > Hi I am having the same issue: > > I am using Python 2.7, and Django 1.6. > > Here is my code for

Re: How transform specific geometry column using Django GIS GeoQuerySet

2014-03-27 Thread Shoaib Ijaz
> > I am doing sql queries in django, the queries that i mentioned above are > print queries of django Network.objects.transform(srid=3857).values('geometry', 'bbox') *This is printed SQL query output of above django query * SELECT ST_Transform("tbl_network"."geometry", 3857), "tbl_networ

Re: How transform specific geometry column using Django GIS GeoQuerySet

2014-03-27 Thread Shoaib Ijaz
*(*)* I am not doing sql queries in django On Thursday, 27 March 2014 16:53:30 UTC+5, Shoaib Ijaz wrote: > > I am doing sql queries in django, the queries that i mentioned above are >> print queries of django > > > Network.objects.transform(srid=3857).values('geometry', 'bbox') > > *This is pr

Use custom HTML to render forms

2014-03-27 Thread Fred DJar
Hello, I am a beginner in python and django programming, i have a question that already have been asked in stackoverflow and many forums, but i couldnt solve my own. this exactly my situation: this the code in my app html page: *{% extends 'base.html' %}* *{% block content %}* * {% csrf_tok

Re: Pip type error.

2014-03-27 Thread Dylan F.
Thanks Brian! The out-file command with ascii encoding specified fixed this for me. On Wednesday, September 26, 2012 1:55:31 AM UTC-4, Brian Peiris wrote: > > Thanks John, that was useful. > This happens because powershell outputs UTF-16 by default. Another way to > fix it is by using the out-

DjangoCon Europe 2014

2014-03-27 Thread Daniele Procida
Djangonauts! This year's DjangoCon Europe is taking place in mid-May, on its very own island off the coast of the French riviera. If you're planning to come and don't yet have your ticket, you should act swiftly, because ticket sales must close on the 20th April. If you haven't yet decided whe

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Try clicking view source in your browser when you view it. Perhaps the URL needs to be HTML escaped? Just a guess. Aaron On 3/21/14, Paolo Bertasi wrote: > Hello, > I'm trying to setup a mini django app to allow users to download files from > > s3. I wrote a simple python function (using boto

How transform geometry column using GeoDjango

2014-03-27 Thread Shoaib Ijaz
I am trying to transform geometry column in django, here is my model class Network(models.Model): name = models.CharField(max_length=50, blank=True) alias = models.CharField(max_length=100, blank=True) geometry = models.GeometryField(srid=3857, null=True, blank=True) bbox = model

Strange behavior with Django 1.5.4 and syncbd/South (missing model fields)

2014-03-27 Thread Jorge Arevalo
Hello, I have a strange problem trying to transform my model fields to PostgreSQL tables. The problem is described here: http://stackoverflow.com/questions/22545252/django-1-5-4-syncdb-not-creating-some-fields-in-postgresql-9-1-postgis-2-tables I don't want to duplicate content, so I just send t

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Paolo Bertasi
Hi Aaron, the html is "wrong" as well. Moreover i tried {% autoescape off %} but with no luck :( Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto: > > Try clicking view source in your browser when you view it. Perhaps > the URL needs to be HTML escaped? > > Just a gue

Re: Client side timestamp handling and timezone

2014-03-27 Thread Aaron Cannon
Have you seen this SO answer? This might help you to convert to UTC in JS. No idea why you're seeing different results inside and outside the shell. Luck. Aaron On 3/18/14, Yoanis Gil Delgado wrote: > Hello there, > > I've been struggling with this issue for the last few days and I cannot see

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Other things I'd probably try to debug this issue would be: * Hard coding the string into the call to HttpResponse, * printing the variable that contains the URL to the console. If the URL was still bad after trying the first item, and the second item printed the expected result, then you could c

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Is the url a bytestring? A quick check of the code for HttpResponse shows that that class is expecting a byte string. Perhaps the URL contains unicode characters that aren't being escaped properly? Aaron On 3/27/14, Aaron Cannon wrote: > Other things I'd probably try to debug this issue would

Re: How transform specific geometry column using Django GIS GeoQuerySet

2014-03-27 Thread Alex Mandel
On 03/27/2014 04:53 AM, Shoaib Ijaz wrote: > >> >> I am doing sql queries in django, the queries that i mentioned above are >> print queries of django > > > Network.objects.transform(srid=3857).values('geometry', 'bbox') > > *This is printed SQL query output of above django query * > > SE

populating my postgres with openpyxl

2014-03-27 Thread willy Hakizimana
I am new to django/python and have been stuck. What is wrong with my script? from openpyxl import Workbook, load_workbook import os import psycopg2 import pycountry #Make the dictionary of countries country_dict = {} country_list = list(pycountry.countries) for country in country_list: coun

settings set in stone on import?

2014-03-27 Thread Tin Tvrtković
Hi, I'm trying to create an init script for a project of mine (open source). In short, my users should be able to initialize a Django project from scratch with one command. The internal workflow of the command would go something like this: * call startproject with a custom template * call sync

Re: populating my postgres with openpyxl

2014-03-27 Thread Thomas Lockhart
I keep getting this error, saying that there is 0207.xlsx is not there, but it is in the directory. File "hsdata.py", line 34, in wb = load_workbook(filename = fname, use_iterators=True) File "/home/william/.virtualenvs/hsdata/local/lib/python2.7/site-packages/openpyxl/reader/excel.py"

Django: Having trouble with nesting URLS

2014-03-27 Thread ApathyBear
I posted this on stack, but I feel like I would get better help here: I am trying to connect my urls together after installing the django-registration app via pip install. My main project is called Club , here is *club/club/

Re: Geodjango and Python 3.3

2014-03-27 Thread Sam Lai
Hmm, you might be right Alex. I set up the virtualenv with all that a while ago and I've just been copying the geo-related DLLs for new environments. On 27 March 2014 11:27, Alex Mandel wrote: > You might get more responses on the GeoDjango mailing list: > geodja...@googlegroups.com > > I agree t

Re: Proxy problem (permissions denied)

2014-03-27 Thread rmu
Hi, I have been stuck in the same *proxy* thing. While I tried to get wfs point layer from geoserver in openlayers i got error in the chrome console: 1. OPTIONS http://localhost:8080/geoserver/EMIS/wfs No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin