If you are using mod_wsgi read: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
In short, code changes by default aren't picked up until a process restart. Thus when they are read depends on when specific hosting mechanisms starts new or restarts old processes. Graham On Wednesday, December 22, 2010 12:54:47 AM UTC+11, xota wrote: > > A related question... why my apache forks (to server to the clients) don't > update the code at same time? Can I force django to compile and load the .py > files at time of server? (Only for debug) > > On Thu, Dec 16, 2010 at 22:33, Graham Dumpleton <graham.d...@gmail.com>wrote: > >> >> >> On Friday, December 17, 2010 1:21:26 AM UTC+11, Craig Trader wrote: >>> >>> Alex ... >>> >>> This is the point where my experience ends -- I'm not operating in a >>> hosting environment. I can tell you that mod_python has to be compiled for >>> a specific version of Apache AND Python (one of the reasons that mod_wsgi >>> is >>> better is that it breaks the Python-version dependency). >> >> >> No it doesn't. As is the case with mod_python, mod_wsgi is also compile >> time bound to specific Python major/minor version. >> >> Graham >> >> >>> If you need a different Python (2.6 in this case), you'll need a differ >>> mod_python. I won't know how it gets installed and configured in your >>> hosting environment. Sorry. >>> >>> - Craig - >>> >>> On Thu, Dec 16, 2010 at 03:51, Álex González <agon...@gmail.com> wrote: >>> >>>> Thanks for your reply Craig, >>>> >>>> to use mod_python in my hosting I'm using this .htaccess file: >>>> >>>> SetHandler python-program >>>> PythonOption django.root / >>>> PythonHandler django.core.handlers.modpython >>>> PythonPath "['/var/www/vhosts/myhosting.com/httpdocs'] + sys.path" >>>> SetEnv DJANGO_SETTINGS_MODULE settings >>>> PythonDebug On >>>> >>>> The problem is that when I need to install something I must talk with >>>> the shared hosting admin, and this isn't working because the python is >>>> 2.3. >>>> The administrator said me that I must activate python26-mod_python.so >>>> but I can't use the LoadModule directive in .htaccess so I don't know what >>>> he want and I'm waiting for a reply yet... >>>> >>>> You are using your self handler in python code to load the webpage? Can >>>> I force here to use the python2.6 interpreter instead the 2.3? >>>> >>>> Thanks for you help! >>>> >>>> On Thu, Dec 16, 2010 at 00:57, W. Craig Trader <crai...@gmail.com>wrote: >>>> >>>>> Alex ... >>>>> >>>>> You're not going to be able to trick your host into loading mod_wsgi >>>>> from an .htaccess file -- Apache doesn't allow the load directives in >>>>> .htaccess files. >>>>> >>>>> While mod_python is not supported, and it has a large number of open >>>>> issues, there aren't any specific security holes you really need to worry >>>>> about; I'm using mod_python on a project at work because mod_wsgi isn't >>>>> supported in our deployment environment. I wouldn't recommend mod_python >>>>> as >>>>> the direction for all future work, but it will get the job done until you >>>>> can get mod_wsgi deployed with your host (or move to another host). >>>>> >>>>> See my earlier post from today (look for Re: running projects on the >>>>> back of a base URL and having issues with the homepage) for more >>>>> details about making mod_wsgi work with VirtualEnv. The apache script >>>>> for >>>>> mod_python is similar to the one I posted earlier ; the only >>>>> differences involve making certain that you chdir to your project >>>>> directory, >>>>> and that you import the Django mod_python handler. >>>>> >>>>> The mod_python configuration is significantly different from the >>>>> mod_wsgi configuration, and look like this: >>>>> >>>>> <Location "/"> >>>>> SetHandler python-program >>>>> PythonPath "[ '/data/web/foo/apache', ] + sys.path" >>>>> PythonHandler django_mp >>>>> PythonInterpreter foo >>>>> </Location> >>>>> >>>>> Alias /static/ /data/web/foo/site/foo/static/ >>>>> <Location /static/> >>>>> SetHandler None >>>>> </Location> >>>>> >>>>> In this case, mp_python represents /data/web/foo/apache/mp_python.py, >>>>> which is my script to deal with configuring the VirtualEnv environment >>>>> and >>>>> then starting the Django mod_python handler. It's basically an amalgam >>>>> of >>>>> the VirtualEnv activate_this.py script, and the mod_python startup script >>>>> from the Django documentation. >>>>> >>>>> - Craig - >>>>> >>>>> On Wed, Dec 15, 2010 at 16:56, Álex González <agon...@gmail.com>wrote: >>>>> >>>>>> Hi guys! >>>>>> >>>>>> Thanks for your replies! >>>>>> >>>>>> My hosting is a shared hosting and I think that I can only uses >>>>>> mod_python at the moment. I can load mod_wsgi from htaccess (I test it) >>>>>> but >>>>>> I can edit my virtualhosts or something similar... any trick to get >>>>>> mod_wsgi >>>>>> up&running? >>>>>> >>>>>> About the virtualenv as Piotr said, some modules must be compiled, so >>>>>> my solution was create a requeriments files as he said, but include in >>>>>> my >>>>>> code django-registration and django-piston because the versions >>>>>> installed >>>>>> with pip doesn't work for me (it said me that it's the correct version, >>>>>> but >>>>>> I can get a actual version at bitbucket). >>>>>> >>>>>> Now my question is, mod_python is deprecated but it's dangerous to use >>>>>> it for a months (until I get money to migrate the code to a non-shared >>>>>> hosting?). And the old question: can I trick the hosting to use mod_wsgi >>>>>> if >>>>>> I can load it from htaccess? >>>>>> >>>>>> Thanks! >>>>>> >>>>>> >>>>>> On Wed, Dec 15, 2010 at 19:49, Ovnicraft <ovn...@gmail.com> wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> On Wed, Dec 15, 2010 at 11:48 AM, Álex González >>>>>>> <agon...@gmail.com>wrote: >>>>>>> >>>>>>>> Hi! >>>>>>>> >>>>>>>> I'm using virtualenv with --no-site-packages and now I like to do a >>>>>>>> deployment of my app... I'm using a sharing hosting, can I uypload all >>>>>>>> my >>>>>>>> enviroment dir (with the packages installed with pip) to the server >>>>>>>> and use >>>>>>>> them? >>>>>>>> >>>>>>>> What's the better way to the deployment? mod_python, mod_wsgi, >>>>>>>> perhaps fast-cgi? >>>>>>>> >>>>>>> >>>>>>> >>>>>>> Remember mod_python is deprecated. >>>>>>> >>>>>>> Regards, >>>>>>> >>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> -- >>>>>>>> @agonzalezro <http://twitter.com/agonzalezro> >>>>>>>> Please, don't send me files with extensions: .doc, .docx, .xls, >>>>>>>> .xlsx, .ppt and/or .pptx >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "Django users" group. >>>>>>>> To post to this group, send email to djan...@googlegroups.com. >>>>>>>> To unsubscribe from this group, send email to >>>>>>>> django-...@googlegroups.com. >>>>>>>> >>>>>>>> For more options, visit this group at >>>>>>>> http://groups.google.com/group/django-users?hl=en. >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Cristian Salamea >>>>>>> @ovnicraft >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Django users" group. >>>>>>> To post to this group, send email to djan...@googlegroups.com. >>>>>>> To unsubscribe from this group, send email to >>>>>>> django-...@googlegroups.com. >>>>>>> >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/django-users?hl=en. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> @agonzalezro <http://twitter.com/agonzalezro> >>>>>> Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, >>>>>> .ppt and/or .pptx >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Django users" group. >>>>>> To post to this group, send email to djan...@googlegroups.com. >>>>>> To unsubscribe from this group, send email to >>>>>> django-...@googlegroups.com. >>>>>> >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/django-users?hl=en. >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Django users" group. >>>>> To post to this group, send email to djan...@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> django-...@googlegroups.com. >>>>> >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/django-users?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> @agonzalezro <http://twitter.com/agonzalezro> >>>> Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, >>>> .ppt and/or .pptx >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Django users" group. >>>> To post to this group, send email to djan...@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> django-...@googlegroups.com. >>>> >>>> For more options, visit this group at >>>> http://groups.google.com/group/django-users?hl=en. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django...@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > > > -- > @agonzalezro <http://twitter.com/agonzalezro> > Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, .ppt > and/or .pptx > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.