On Sep 12, 11:36 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I use apachemod_wsgi(WSGIDaemonProcess) and for development
> maximum-requests=1.
>
> This way I don't need to change any code for reloading: Just hit ctrl-r
> (reload in firefox).

I would recommend against maximum-requests=1 for mod_wsgi daemon mode.
This will give worse performance than Python development server.

Read:

  http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

In there you will see that for mod_wsgi daemon mode, to cause a
restart you just need to touch the WSGI script after having made a set
of changes.

If you are too lazy to touch the WSGI script file, then see the in
process restart monitor in section 'Restarting Daemon Processes'. With
this, at least it only restarts when code changes and not on every
request regardless of whether a change is made or not.

Graham

>  Thomas
>
> n00m schrieb:
>
>
>
> > 1.
> > Rename views.py to (say) views_base.py
>
> > 2.
> > Create a new views.py file, with code like this:
>
> > import os.path
> > import views_base
>
> > def test(request):
> >     if os.path.isfile(__file__ + '1'):
> >         reload(views_base)
> >     return views_base.test(request)
>
> > def tables(request, table_name=None, cur_page=1):
> >     if os.path.isfile(__file__ + '1'):
> >         reload(views_base)
> >     return views_base.tables(request, table_name, cur_page)
>
> > ..............
> > ..............
> > ..............
>
> > Idea is straightforward:
>
> > functions test, tables etc are from views_base.py (former views.py);
> > if exists dummy file views.py1, which existence is a sign of changes
> > made in views_base.py, then reload the whole thing
>
> > Just put this dummy empty file views.py1 into the dir of views.py
> > (if at the time you need no AutoReload just delete or rename it).
>
> > Now you can edit your views_base.py and see the changes in action,
> > without restarting Web Server (except of args of defs(request, args).
>
> --
> Thomas Guettler,http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to