Home  >  Q&A  >  body text

Website hosted on Github Pages with Python API encounters operational issues

We are working on a group project with two other people to implement a CRUD using HTML, CSS, Vue.js and the API on pythonanywhere and put it on GitHub Pages. The problem is, it runs fine locally and connects to pythonanywhere with no issues, but online on GitHub Pages it fails with an error message. I've tried everything I know but can't seem to load products saved on pythonanywhere.

I know GitHub Pages has its peculiarities, but I can't seem to find a way around it yet. It would be great if anyone could help or explain what the problem is.

Here are the links to the repository and GitHub Pages website:

https://github.com/GasparB123/Codo-a-Codo-TPO

https://gasparb123.github.io/Elbow-to-Elbow-TPO/crud_products.html

I know GitHub Pages is picky about paths to images and js files, so I've fixed them.

For example:

Change "/img/logo.png" to "img/logo.png".

But this didn't work.

I think there may be a conflict issue between HTTP on pythonanywhere and HTTPS deployed by GitHub Pages, but if that is the problem, I don't know how to solve it.

P粉973899567P粉973899567398 days ago727

reply all(1)I'll reply

  • P粉908138620

    P粉9081386202023-09-17 13:16:08

    Send the request to https://pablodelapuente.pythonanywhere.com/productos instead of http://pablodelapuente.pythonanywhere.com/productos

    All web applications on

    <username>.pythonanywhere.com have https enabled by default. It needs to be manually enabled on custom domain names. See https://help.pythonanywhere.com/pages/HTTPSSetup

    reply
    0
  • Cancelreply