Objective: Give my Django App (with Python backend [written] and react/redux/js frontend [written]) a Smartsheet API OAuth page that redirects users off the main website until auth is done, and then back to website (that utilizes Smartsheet API in features)
Crux: A hunch said that the OAuth should be in node.js to match front end more, and I found a working sample code for how to do Smartsheet OAuth in Node. It worked great on its own! Then when I tried to integrate this node.js page into Django, I got errors from which ever server I set up second, that there is already a server on that given (12.0.0.1:{port}) local url. Maybe OAuth should be written in python instead, but I couldn't find sample code for it, so it would be great if I could keep it in Node.
Question- Is there a way to deploy components from both Node and Django to the same server/domain? It's weird to have users go to one site, finish their oauth, just to be pushed to a totally separate domain. This may also pose security risks.
My attempt- I thought I would just create a simple landing page and then after being logged in, shoot the user forward on the website (on a redirect url). This is what the Django urls.py would look like:
from django.urls import path
from . import views
urlpatterns = [
path('', views.oauth ), //Views.oauth is fairy blank, and I wanted my Node.JS server
//to listen at that hostname:port
path('loggedin/', views.index ), //when oauth ended, I wanted it to send the user here
]
This attempt made these errors: Django Error Node Error
Thanks for any ideas to my inquiry!