django-rosetta icon indicating copy to clipboard operation
django-rosetta copied to clipboard

WSGI reload button

Open Visgean opened this issue 12 years ago • 3 comments

It would be nice if there could reload the wsgi and uwsgi processes manually, auto_reloading is not a good choice on production and it is not even neccesary to apply new translation for every page that is saved...

It could be written quite easily as I can see from glancing at the code - the code that reloads wsgi is this:

if rosetta_settings.WSGI_AUTO_RELOAD and \
    'mod_wsgi.process_group' in request.environ and \
    request.environ.get('mod_wsgi.process_group', None) and \
    'SCRIPT_FILENAME' in request.environ and \
    int(request.environ.get('mod_wsgi.script_reloading', '0')):
        try:
            os.utime(request.environ.get('SCRIPT_FILENAME'), None)
        except OSError:
            pass
# Try auto-reloading via uwsgi daemon reload mechanism
if rosetta_settings.UWSGI_AUTO_RELOAD:
    try:
        import uwsgi
        # pretty easy right?
        uwsgi.reload()
    except:
        # we may not be running under uwsgi :P
        pass    

The reason why I did not fork implemented is that I have no idea where to put the reload button and what should I call it - maybe something like "Apply changes"

Visgean avatar Jun 28 '13 17:06 Visgean

I second this. I didn´t quite love the idea of restarting the webserver every time one person hits "save".

Gesias avatar Jul 03 '13 07:07 Gesias

+1

Glideh avatar Dec 23 '13 10:12 Glideh

+1

liminspace avatar Jul 12 '16 10:07 liminspace