Sep
26
26
So you need to write an external script that would run outside Django and still have access to your app’s models?
Nothing could be more simple.
Python
-
from django.core.management import setup_environ
-
import settings
-
setup_environ(settings)
-
-
from foo import models
-
-
# rest of your code…


But the daemon should be in the same directory of the settings file, otherwise you have an import errore ’cause the module can’t be found.
do you know a workaround to place the daemon in each folder you want in the filesystem?
Thanks in advance. Please reply at my mail.