As I was following the django tutorial part 2, I got stuck because there is no Polls entry in the admin page.
- I have checked out the solution to this problem. They say that the poll app must be included in the
INSTALLED_APPS
. It is included. - I have also restarted the server.
- I verified that I have done everything mentioned in the tutorial - everything worked up to now.
- The
admin.py
file from the polls directory seems to be ignored.
I have absolutely no idea what's wrong.
I run python 2.7.3 with django 1.4.2 on ubuntu 12.04 LTS.
[SOLVED]
This is something very strange.
As I was viewing my admin.py
file with gedit, I have noticed that the key words, like from
and import
were not grey coloured, as they were in other .py
files.
So I have copied and pasted the models.py
file in the same folder, renamed it admin.py
, deleted the old one and replaced the code with the original one. Now the key words were colored. And, yes, it worked perfectly!
So it must have been the way I created that admin.py
file in ubuntu 12.04 LTS.
It is a little bit embarrassing, but it took me a while to solve this, since it wasn't a programming problem, as I expected, but an OS one.