Created
February 13, 2017 19:10
Revisions
-
Sovetnikov created this gist
Feb 13, 2017 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ import os import time from copy import copy from celery.events.snapshot import evcam from qiwichain import settings as novtest_settings from qiwichain.celery import app DATABASES = copy(novtest_settings.DATABASES) if 'postgis' in DATABASES['default']['ENGINE']: # Just my case, postgis asks for additional libraries, but it's not needed here DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2' from django.conf import settings settings.configure( INSTALLED_APPS=( 'djcelery', ), TIME_ZONE=novtest_settings.TIME_ZONE, DATABASES=DATABASES, CACHES={ 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } } ) if hasattr(time, 'tzset'): # Check that it's not development server on Windows os.environ['TZ'] = settings.TIME_ZONE time.tzset() if __name__ == '__main__': import django django.setup() evcam(camera='djcelery.snapshot.Camera', app=app, loglevel='INFO', freq=1)