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

Auto reload with manage.py runfcgi

Open francescortiz opened this issue 12 years ago • 3 comments

Is there a way to have rosetta reload translations when started with manage.py runfcgi?

I have tried with ROSETTA_WSGI_AUTO_RELOAD = True and ROSETTA_UWSGI_AUTO_RELOAD = True

with no luck.

Thank you.

francescortiz avatar Apr 02 '12 06:04 francescortiz

If you could point me to the right way to reload the runfcgi process I'll gladly integrate this.

mbi avatar Jun 07 '12 14:06 mbi

This is what I did:

from rosetta.signals import post_save

def restart_instance(*args, **kwargs):
    from subprocess import call
    call(["/home/username/init/django", "restartdelay"])

post_save.connect(restart_instance)

and the restarday option of the daemon waits one second to restart the django instance

$(sleep 1; /home/username/init/django stop; /home/username/init/django start) &

francescortiz avatar Jun 07 '12 15:06 francescortiz

So, there is no right way, just a solution for every case

francescortiz avatar Jun 07 '12 15:06 francescortiz