Still working through this tutorial.
I have got the problem:
TemplateDoesNotExist at /polls/
polls/index.html
Traceback:
Environment:
Request Method: GET
Request URL: http://localhost:8060/polls/
Django Version: 1.0.2 final
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth'
Help was much appreciated, thanks ;)
On Mar 17, 1:26 pm, Oliver Beattie wrote:
> You're probably using the tutorial for the development (trunk) version
> of Django, but you're running 1.0.x — you should be following this
> tutorial:http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate
You're probably using the tutorial for the development (trunk) version
of Django, but you're running 1.0.x — you should be following this
tutorial:
http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate-the-admin-site
On Mar 17, 1:21 pm, TP wrote:
> I have fixed this error:
>
> now wh
I have fixed this error:
now when I comes to view the admin site I get the error:
AttributeError at /admin/
'AdminSite' object has no attribute 'urls'
On the webpage.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
Below that there will be an error. I'm guessing it may be a
SyntaxError or NameError, since it looks like you have python after
'mysite.polls' (probably by accident) — that is if that traceback is
right.
On Mar 17, 12:36 pm, TP wrote:
> This relates to the first tutorial on django project.
> My
This relates to the first tutorial on django project.
My models.py file:
from django.db import models
import datetime
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.que
On Tue, Mar 17, 2009 at 8:29 AM, TP wrote:
>
> When I try to run the Python shell again I get this:
>
> python manage.py shell
> Traceback (most recent call last):
> File "manage.py", line 4, in
>import settings # Assumed to be in the same directory.
> File "/home/cserv2_a/ug/scs5tdp/Desk
When I try to run the Python shell again I get this:
python manage.py shell
Traceback (most recent call last):
File "manage.py", line 4, in
import settings # Assumed to be in the same directory.
File "/home/cserv2_a/ug/scs5tdp/Desktop/mysite/mysite/settings.py",
line 79
'mysite.poll
On Tue, Mar 17, 2009 at 9:20 AM, TP wrote:
>
> Right I have now changed to use __unicode__
>
> This looks like:
>
>
> from django.db import models
>
> class Poll(models.Model):
> question = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
> def __unico
>>> from mysite.polls.models import Poll, Choice
>>> Poll.objects.all()
[]
Is my output.
The desired output is:
>>> Poll.objects.all()
[]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To po
Right I have now changed to use __unicode__
This looks like:
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question
def was_publishe
__unicode__ is called when unicode(ModelInstance) is called. __str__
is called when str(ModelInstance) is called.
Internally, if you only define __unicode__, then Django will provide
__str__ for you (see
http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L277
for the nit
I am currently running through the first tutorial on the django
projects site.
When I have added the __unicode__() method to my models I don't see
any change in how they're represented.
I am using Django 1.0.2 So an old version is not the problem.
My models.py looks like this:
from django.db i
13 matches
Mail list logo