#🔒 django and nodejs deployment issue

22 messages · Page 1 of 1 (latest)

slender hawk
#

Local Setup (Works Perfectly)

Django runs on 127.0.0.1:8000.
proxy.js runs on 127.0.0.1:3000.
Everything works smoothly — requests are routed properly through the proxy.js server to the Django backend.

Heroku Deployment (Fails)

On Heroku, both Django and proxy.js must run on the same web dyno. Heroku assigns a single dynamic $PORT for the dyno, and this is where things break:

Gunicorn binds to $PORT (this works).
proxy.js tries to bind to 3000 (or another static port) and fails because Heroku doesn't allow multiple ports per dyno.
I’ve tried making proxy.js bind to $PORT instead, but then Django and proxy.js conflict because both try to use the same port.
rocky citrusBOT
#

@slender hawk

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

slender hawk
#

!paste

rocky citrusBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

slender hawk
slender hawk
slender hawk
#

and this is my structure

#

the problem is in tap.js and proxy.js which i provided in the links
i need to setup the axios calls for deployment in heroku and i don't know how since in local i can use ports but can't in heroku unless i used two dynos, this is just overkill

forest spade
#

Then you don't need 2 services running separate ports. Its 1 service running the same port, just different endpoints after that

slender hawk
#

can you give me a reference about how the integeration should look like? or maybe something clarifies the idea for me so i can understand😅

slender hawk
forest spade
#

Have you seen Django-Ninja?

forest spade
slender hawk
#

well, this looks useful, will i be able to find youtube videos that simplifies the concept for me?

forest spade
slender hawk
#

wish me luck

rocky citrusBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.