The last test I did was deleting settings.py, to see if there was some
kind of problem of other type, but the settings.py does get read,
since runserver gave me this error:
$ python manage.py runserver
Error: Can't find the file 'settings.py' in the directory containing
'manage.py'. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an
ImportError somehow.)
So, I restored settings.py and with urls.py deleted, the server keeps
resolving old urls.
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsub...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/
> group/django-users?hl=en.
>
Did you delete the .pyc files? Python generates a compiled version of the file, and if you don't delete it, it never get's updated. At least it's the problem I have. So if you update views.py and don't delete the old view.pyc file, it will work as the old version.
That's the way it *should* work, however, if you are running under a web
server (runserver, Apache, Lighttpd), you need to manually delete the
.pyc files and restart the server.
...Ken
Forget headaches, think full-on head-banger migraines! ;-)
> The only times I have to manually delete .pyc files are when I have
> deleting the corresponding .py files, or done a major restructuring and
> moved things around. I've never had to delete .pyc files for simple code
> changes. Running under a webserver or not makes no difference in this.
> Where running under a web server may make a difference is in the need to
> restart the server to get it to see changes. You generally don't need to
> do that for runserver, but usually do for production setups. You do not,
> however, need to delete .pyc files -- you just need to restart the server.
I listed runserver above, but its not normally a problem.
The problem only appears when you do an update of the .py files while
either Apache or Lighttpd are running. For some reason, even a restart
of the servers will not always catch the modification of the .py file.
Not sure why this is, but I've run into this on multiple Linux distros,
multiple versions of Python and Django, and multiple versions of web
servers.
...Ken
Yes Karen, that's what I thought from the beginning, something is
broken in my Python installation, I'll explain it better. I'm
currently using django dev server and it doesn't update the .pyc
files, let's say I just change a line in the models, I have to delete
the models.pyc file because python doesn't update i, if it helps,
timestamps difer just seconds (I make quick changes).
This happens to me even on other programs where every change I make,
I have to delete manually the .pyc file. As someone said before is
like head-banging. How can I track down this problem? I'm not a
programmer, this is just a hobby.
I'll test this on other python installation I have on my mac, just in
case. Thanks everybody, and forgive my bad english ;)
Yes Karen, that's what I thought from the beginning, something is broken in my Python installation, I'll explain it better. I'm currently using django dev server and it doesn't update the .pyc files, let's say I just change a line in the models, I have to delete the models.pyc file because python doesn't update i, if it helps, timestamps difer just seconds (I make quick changes).
This happens to me even on other programs where every change I make, I have to delete manually the .pyc file. As someone said before is like head-banging. How can I track down this problem? I'm not a programmer, this is just a hobby.