I have been walking through the Tutorial for Django, and upon reaching part 
5 and introducing the first test case, I get this output (the directory I 
put the tutorial in is called 'demo')

 

RuntimeError: Model class demo.polls.models.Question doesn't declare an 
explicit app_label and isn't in an application in INSTALLED_APPS.

 

I tried adding a Meta section to the Question model, after doing some 
poking around in the docs.

 

class Question(models.Model):

    question_text = models.CharField(max_length=200)

    pub_date = models.DateTimeField('date published')

 

    class Meta:

        app_label='polls'

 

But then I get this:

 

RuntimeError: Conflicting 'question' models in application 'polls': <class 
'polls.models.Question'> and <class 'demo.polls.models.Question'>.

 

What modifications would I have to make to the standard Tutorial code so 
the Models are correctly bound to the polls app? Do I have to add something 
else to the installed_apps besides 'polls.apps.PollsConfig'? That's the 
only thing the tutorial says to add.

 

Thanks,

Eric

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf6740d8-3b1b-44de-a396-ab1b95b183c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to