aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-06-14 20:41:23 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-06-14 20:41:23 +0300
commit02a219db25034d839b55a0aa456e4b70ae2f32ec (patch)
tree3e65d2b2e27b31628747e2c3e863160d38a53539
parent4b2d491c2908ec6b677fe494547774bf7d323cb5 (diff)
downloadServo-02a219db25034d839b55a0aa456e4b70ae2f32ec.tar.gz
Servo-02a219db25034d839b55a0aa456e4b70ae2f32ec.tar.bz2
Servo-02a219db25034d839b55a0aa456e4b70ae2f32ec.zip
Import local_settings last
-rw-r--r--servo/management/commands/importparts.py1
-rw-r--r--servo/management/commands/scheduler.py3
-rw-r--r--settings.py4
3 files changed, 5 insertions, 3 deletions
diff --git a/servo/management/commands/importparts.py b/servo/management/commands/importparts.py
index 8909773..099a0e5 100644
--- a/servo/management/commands/importparts.py
+++ b/servo/management/commands/importparts.py
@@ -20,6 +20,7 @@ from django.contrib.contenttypes.models import ContentType
from servo.models import Product, TaggedItem
+
def import_parts(parts, **options):
content_type = ContentType.objects.get(model="product")
diff --git a/servo/management/commands/scheduler.py b/servo/management/commands/scheduler.py
index c400b7b..c9e3839 100644
--- a/servo/management/commands/scheduler.py
+++ b/servo/management/commands/scheduler.py
@@ -1,10 +1,10 @@
from datetime import datetime
import django
+import django_rq
from django.core.management.base import BaseCommand
from django_rq.management.commands import rqscheduler
-import django_rq
django.setup() # To avoid django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
@@ -19,6 +19,7 @@ class Command(rqscheduler.Command):
help = "Start task scheduler"
def handle(self, *args, **kwargs):
+ # reset all tasks on registration
for job in scheduler.get_jobs():
job.delete()
diff --git a/settings.py b/settings.py
index d37b43e..b83cb78 100644
--- a/settings.py
+++ b/settings.py
@@ -221,8 +221,6 @@ WKHTMLTOPDF_CMD_OPTIONS = {
'page-size': 'a4'
}
-from local_settings import *
-
CACHES['comptia'] = {
'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
'LOCATION': '127.0.0.1:11211',
@@ -238,3 +236,5 @@ RQ_QUEUES = {
'DEFAULT_TIMEOUT': 3600, # 60 minutes
},
}
+
+from local_settings import *