django-rosetta
django-rosetta copied to clipboard
Auto reload with manage.py runfcgi
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.
If you could point me to the right way to reload the runfcgi process I'll gladly integrate this.
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) &
So, there is no right way, just a solution for every case