I wanted to dive into Python\Django development and used what I had at hands:
- hosting on Hostgator (not a vps but shared).
They do support Django but through fcgi. I did all what was said in the small guide here
So I got “hello world” working. Though I have a time instead of hello world in my app’s views.py:
from datetime import datetime
from django.http import HttpResponse
def index(request):
return HttpResponse(datetime.now().strftime('%H:%M:%S'))
But now, when I do any changes to views.py – i can’t see resutls immidiately. I do delete all *.pyc files, still nothing. For example even if do this:
return HttpResponse('Hello World!')
I don’t get this but still see time.
I’m totaly lost already. I tried many things through ssh with django-admin.py…but still – I see time.
If I make a mistake in a code – it will catch it up quick (may be not immidiately) and give out error\debug info, but even after that if I correct it to a new code = still the result is time.
Seems like I’m missing something. Some “refresh” function of views.py…Purge cache..or smth like that? Restart app?
UPD: kill -USR1 index.fcgi did it!
It’s the fcgi!
You probably have to restart the spawned server, so it reloads the Python files.
You can achieve that by touching the .fcgi file:
See How to use Django with FastCGI, SCGI, or AJP.
Dreamhost, a Hostgator competitor says that you sometimes need to kill the process:
But I don’t know if that works with hostgator too.