Not preaching (as I often fall into this trap myself) but just copy&paste 
from others' examples, without understanding what is the intent of the 
code, can lead to problems.

In this case, the docs are useful (for understanding how to construct the 
`app_label`, for example):

https://docs.djangoproject.com/en/1.10/ref/models/options/

And also this link:

https://docs.djangoproject.com/en/1.10/topics/db/models/#meta-options

where it explicitly says:

"... adding class Meta to a model is completely optional."

so, if you find you need this, it may because something else has not been 
done correctly.

On Saturday, 11 February 2017 13:27:24 UTC+2, Gerald Brown wrote:
>
> Finally solved the problem!!!
> At the end of each Model definition I had added:
>     class Meta:
>         managed = True
>         db_table = 'refer'
>         app_label = 'Refer'
>
> I then commented those lines out and then the program worked like it 
> should. I saw another post where they had put those variables as part of an 
> "options" statement.
>
> I was getting other errors when I did not have the "app_label" line so 
> that is why I added that.
>  
>
> On Wednesday, February 8, 2017 at 7:09:12 AM UTC+8, Gerald Brown wrote:
>>
>> I have just started an app on Ubuntu 16.04 Server using Python 3.5 and 
>> Django 1.10.5.
>>
>> When I do "@admin.register(Province)" in my admin.py file I get the error 
>> that is the subject of this post.
>>
>> Of course there is NO app with label of 'province' as that is the label 
>> of a 'Model'.
>>
>> Why is Django trying to register an app instead of the Model?
>>
>> Thanks,
>>
>> Gerald
>>
>>
>>

-- 
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/ebd97fee-714f-4feb-bc26-d5ddf2918d79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to