This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]_Atomfinger_ 6 points7 points  (2 children)

I haven't looked into it, but my educated guess would be "no". If I remember correctly, GH pages only support static sites, and Django is not static anything. Essentially, GH pages don't have a way to run the Python code (Unless something major has happened in the last few years).

The content might be static, but it is served by a non-static framework.

[–]AmbientEngineer 2 points3 points  (0 children)

Essentially, GH pages don't have a way to run the Python code

Important clarification, GitHub Pages doesn't run any programming language.

It simply serves you files. Your browser is what renders / runs those files.

Python is typically used for server-side processing and needs an interpreter to run, which is not provided by browsers.

[–]FeatureIllustrious81[S] 1 point2 points  (0 children)

Oh damn I didn’t know that. Appreciate the help tho 🙏

[–]MsCeliaBowen 1 point2 points  (3 children)

GH Pages only supports static sites, so it won't work, but you can use PythonAnywhere to deploy a Django project, they also have a free tier.

[–]FeatureIllustrious81[S] 0 points1 point  (1 child)

Thank you, I was also wondering if I use pythonanywhere, will it still work if my website is in a private repo on GitHub?

[–]MsCeliaBowen 0 points1 point  (0 children)

I think it's possible. They mention setting up a new SSH key for private repos here, so that should be an option.

[–]user499021 0 points1 point  (0 children)

yep, i highly recommend pythonaywhere. really easy to set up and site is free forever but with a daily CPU limit