Building with Python
so im new to cloudflare pages and stuff but basically I need help because my website runs off of python, so basically it would need to like install requirements.txt first then run
python manage.py runserver
, but the thing is i have 0 clue on how to execute this and i need help with it.6 Replies
is that even possible i have 0 clue, if not then what are some good alternatives
You can't run a Python server on Workers/Pages. You can run a build step, but that has to exit before deploying your project
then what's a good alternative to run my website (im running django)
?pages-webserver
Cloudflare Pages is for static content (HTML, CSS, JS, images and other such files). It will not run a webserver such as Express, Koa or the likes. If you're using those to serve static content then you can just remove that part and use Pages! If you're doing more dynamic content you can use Functions (https://developers.cloudflare.com/pages/platform/functions). It will run code on request (so still not a webserver in the conventional sense). This would allow for more dynamic content though especially with KV (Key Value storage) and Durable Objects (transactional data storage). Functions are natively integrated with Pages so are super easy to get up and running along your website. Otherwise, a good old VPS or dedicated server from one of the many hosts out there is for you.
VPS or something like Fly.io, railway etc for hosting is best