You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
binarydud edited this page Sep 13, 2010
·
1 revision
There have been several questions asked about setting up external settings. For instance, using django, one needs to setup the DJANGO_SETTINGS_MODULE. Below are 2 examples of doing that before running a worker.
First is inside the job’s perform method:
import logging
class BlogJob(object):
queue = ‘blog-queue’
@staticmethod
def perform(id, comment):
import os
os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘blog.settings’
from blog.models import Blog
Blog.objects.get(id)
“etc…”