Django + fcgi = new edits to not shown

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

from datetime import datetime
from django.http import HttpResponse
def index(request):
 return HttpResponse('%H:%M:%S'))

But now, when I do any changes to - 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 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 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:

$ touch index.fcgi

See How to use Django with FastCGI, SCGI, or AJP.

Dreamhost, a Hostgator competitor says that you sometimes need to kill the process:

killall -USR1 index.fcgi

But I don't know if that works with hostgator too.

Need Your Help

Unwanted clipping in WrapPanel

wpf wrappanel

I need to create a ListBox with the WrapPanel ItemsTemplate.

Prevent control-c from sending SIGINT to all process group children

c terminal signals posix

I'm trying to interface with a really crappy, completely opaque API that creates two subprocesses within a POSIX-like environment (OS X/Linux) in C. Basically, it starts an external program and pro...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.