简体   繁体   中英

I can't find a host for my python and django website

I've created a website using Django framework. I have HTML CSS Python and SQL. I was able to put python into my index.html thanks to : https://docs.djangoproject.com/en/4.0/ref/templates/language/#variables

Regarding python I have a script.py that generates a list of numbers L = [120, 140.65, etc] This script updates every 10 minutes because the numbers change L = [122.2, 140.85, etc] Then this list is imported into MySQL. So the DB changes every 10 minutes. Finally, a table is generated on my site using index.html and css with the updated numbers every 10 minutes.
My website :
--index.html
--style.css
--script.py
--MySQL database

The problem is, how can I find a website host who will automatically run my script.py (which will update my website every 10 minutes), which will understand python in html (this: {% for x in story_list %} ) and which will host my database. Thank you for your help! : Sorry for my bad english

For hosting you can try Python anywhere or Heroku . For executing your code you will probably need something more than just index.html, ie Flask or Django that you even tagged here. There are plenty of ways to start cron/interval jobs, like apscheduler or for bigger projects - Celery .

You can host this on AWS using Elastic Beanstalk. You will create a primary container to host the web app and then a worker container for your script. Then you define a cron.yaml file to start the script every 10 minutes.

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