【问题标题】:Possible to have react + Django on pythonanywhere.com可能在 pythonanywhere.com 上有 react + Django
【发布时间】:2020-10-09 12:29:06
【问题描述】:

是否可以在 pythonanyhere.com 上部署 react 前端应用和 Django 作为后端应用?

我有 django API 作为后端和 React 作为前端应用程序。

【问题讨论】:

    标签: django reactjs pythonanywhere


    【解决方案1】:

    是的,是的。 React 只是 Javascript,所以只要你提供你的 react 代码并将其加载到你的 Django 页面中,它就可以工作。

    【讨论】:

    • 如何在 pythonanywhere 上安装 nodejs。我在 reactJs 中有完整的前端并使用微服务 django
    • node 已安装在 PythonAnywhere 上,但如果需要,您可以使用 nvm 获取更新版本的 node。见help.pythonanywhere.com/pages/Node
    • 只是为了澄清-您应该使用节点将您的反应代码编译为纯 js 并从您的 webapp 提供该 js-您不应该运行单独的节点服务器
    猜你喜欢
    • 2015-03-31
    • 1970-01-01
    • 1970-01-01
    • 2021-12-11
    • 2020-03-20
    • 2013-10-03
    • 2015-11-26
    • 2022-01-23
    • 2020-03-20
    相关资源
    最近更新 更多