haroba
haroba

Reputation: 2310

Django running on Apache with WSGI caches everything

I am running Django on a shared webhost using WSGI and Apache. My problem is that everything is cached, thus making it very difficult to test changes. Even if I remove an app (such as admin) from the URLconf or remove it from settings.py, I'm able to access it through the URL I removed from the URLconf. Is there a way to prevent this "caching"?

I understand that it's ideal to use Django's runserver while developing, but I'd prefer to use this webhost and I don't have access to run runserver there. I'm also aware that I could restart Apache everytime I change something, but as this is a shared host I obviously don't have access to do that.

Upvotes: 2

Views: 2050

Answers (2)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

Read:

http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

It explains in what situations code reloading occurs.

Upvotes: 3

Alex
Alex

Reputation: 9031

I have a similar setup (FastCGI) and the way I get around this is to rename the index.fcgi each time i make a change. so i do the following:

  1. Rename index.fcgi >> index1.fcgi
  2. edit .htaccess
  3. change reference of index.fcgi >> index1.fcgi

The cache usually expires every 24 hours, so you wont end up with index1881881.fcgi :)

This isn't ideal, but when using shared systems you have to work with what you've got. Hope this helps.

Upvotes: 1

Related Questions