I've started discovering WSGI tonight and bumped into the problem I can't fully understand. What I did is that I started with Apache + mod_wsgi and run my WSGI "Hello World" app in embedded mode. I've just pointed WSGIScriptAlias to it, restarted Apache and "Hello World" was there.
Then I continued doing a research and found out that if I use WSGI app in embed mode I will need to restart Apache every time I make some change so I changed my VirtualHost configuration so it now runs in deamon mode:
WSGIDaemonProcess wsgi-app processes=2 threads=15
WSGIProcessGroup wsgi-app
I've restarted Apache but still - there is my "Hello World" output although I completly changed my WSGI to output something different
def application(environ, start_response):
status = '200 OK'
if not environ['mod_wsgi.process_group']:
output = 'EMBEDDED MODE'
else:
output = 'DAEMON MODE'
response_headers = [('Content-Type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
Anyone has any explanation or link to help me figure out what's going wrong? Did Apache even started WSGI under separate process or it's still locked in embed mode after restart? I made this changes before I changed it to deamon mode so this shouldn't be true? If so - even if WSGI fired it's own process it would have to change output from "HelloWorld" to this new one?
Sorry if this question is a beginner error - I just failed to make sense of it after reading http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
Thanks for the help once again :)