courtneypattison / thegrouch

Stripe integrated with django-oscar, django-oscar-api and a basic react app bootstrapped with Vite
MIT License
1 stars 1 forks source link

Error: connect ECONNREFUSED ::1:8000 #1

Closed j2l closed 7 months ago

j2l commented 7 months ago

Hello, I was curious about your stripe implementation and stumbled on a few problems: SECRET_KEY = os.environ['SECRET_KEY'], I guess you have an .env file?

To test, I can access http://localhost:8000/api/categories/?format=json but the client react app fails with Error: connect ECONNREFUSED ::1:8000

courtneypattison commented 7 months ago

Hey, I published the django secret key since this project isn't used in production. The stripe keys need to be setup yourself and added to a .env. Also the STRIPE_PUBLISHABLE_KEY needs to be set in settings.py. Let me know if that helps :)

j2l commented 7 months ago

Thank you @courtneypattison :) I solved that by replacing it with string. The issue is mainly the ECONNREFUSED ::1:8000. If you can do a fresh install of it, you might get the same issue. I'm using Ubuntu, maybe there's a difference.

j2l commented 7 months ago

I found the issue and made a PR! See https://github.com/courtneypattison/thegrouch/pull/2

In vite config file, it must be target: "http://127.0.0.1:8000", I was helped by the reply at https://stackoverflow.com/questions/75994380/how-to-resolve-error-connect-econnrefused-13306-on-my-node-js-backend

courtneypattison commented 7 months ago

Awesome, thank you so much!