简体   繁体   中英

Django: How to run python scripts on a running env with gunicorn

I was wondering how I could run some external python scripts on my django application while it is running with gunicorn and nginx ?

Locally without gunicorn and web server, I would just open a python shell using the below:

python manage.py shell

Then run my python script on my django application with the following:

exec(open('myscript.py').read())

Can you please advise ?

PS: I need to run the script on specific time and not on the startup.

Kind regards.

您可以将脚本导入您的 Django 项目文件之一,例如settings.py ,然后它就会同时运行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM