Django user control commands from admin interface

I asked the previous question that the django team should run on schedule . I have a solution for this question, but I still want my commands to be run from the admin interface. The obstacle I am facing is that my user control commands are not recognized when I get the admin interface.

I traced this back to the __init__.pyutility file django/core/management. There seems to be some kind of strange behavior. When the server first appears, the _conformation variable of the dictionary is populated with basic commands (from django/core/management/commands). User control commands from all installed applications are also placed in the _commands variable for a complete dictionary of all control commands.

Somehow, although between when the server starts and when the django-chronograph starts the task from the admin interface, the _commands variable loses user commands; the only commands in the dictionary are the main teams. I do not know why this is so. Could this be a problem? Am I missing some settings? Is this a specific problem of the django-chronograph? So forget about planning. How can I run a custom control command from the django admin GUI to prove that it really can be done? Rather, how can I make sure that user control commands are accessible from the specified interface?

+3
source share
2

- "unix-guy", tom tom.

, , tom tom, .

django-cronograph ( -, "lib-" -?

, " pythonpath", .

cron- pythonpath, django. : cron- crontab - ? , : cron-process AND django-process ( -), script crontab pythonpath :

#!/bin/bash

PYTHONPATH=/path/to/libs:/path/to/project_root:/path/to/other/libs/used/in/project
export PYTHONPATH

python /path/to/project/manage.py cron

cron-start pythonpath, .

greez /

Berni

0

django-chronograph

. , . , , . , , .

. -, . .

+1

Source: https://habr.com/ru/post/1782011/


All Articles