从Django项目提供Angular构建包

嗨,我有一个包含多个应用程序的django项目。

我的项目结构是:

apt.yml     DCMS_API/  infra/  manage.py*    odbc-cfg/  requirements.txt  static/       templates/

Authorize / afility / manifest.yml Procfile runtime.txt

我从前端团队那里获得了angular6 buildpack,已将其复制到静态文件夹中:

ls:

3rdpartylicenses.txt                          
fontawesome-webfont.af7ae505a9eed503f8b8.woff2  
scripts.5bde77e84291ce59c080.js
assets/                                       
fontawesome-webfont.b06871f281fee6b241d6.ttf    
  Staticfile
devManifest.yml                               
fontawesome-webfont.fee66e712a8a08eef580.woff   
json-data/                          
styles.38614f36c93ac671679e.css
favicon.ico                                   
index.html                                      
main.e7b9143f2f482d6d3cc7.js
fontawesome-webfont.674f50d287a8c48dc19b.eot             
polyfills.f3fc5ca24d1323624670.js
fontawesome-webfont.912ec66d7572ff821749.svg               
runtime.a66f828dca56eeb90e02.js

在settings.py中,我添加了whitenose服务于静态构建包:

中间件:“ whitenoise.middleware.WhiteNoiseMiddleware”, 已安装的应用程序:“ whitenoise.runserver_nostatic”,

通过我的“授权”应用程序:调用

def dcmsApi(request):
return render(request,'index.html',{})

这将打开index.html文件。但是它会加载主页,但是如果我点击显示的任何内容

Not Found
The requested resource was not found on this server.

这是从Django服务器静态角度构建包的正确方法吗 我想念什么吗?

johnnysydney 回答:从Django项目提供Angular构建包

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3076262.html

大家都在问