Django + fcgi = new edits to views.py 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 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!

Answers


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

Bitwise AND and order of operations in C/C++

c++

I'm currently dissecting through the ol' Doom engine source code, and came across an interesting line:

Do custom events need to be set to null when disposing an object?

c# events dispose

Lets says we have 2 objects, Broadcaster and Listener. Broadcaster has an event called Broadcast to which Listener is subscribed. If Listener is disposed without unsubscribing from the Broadcast ev...

Spring MVC vs ASP.NET (MVC?)

asp.net asp.net-mvc spring spring-mvc content-management-system

I have to work to develop a management from a clothing company.

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.