我在 Ubuntu 主机上的 docker 容器上有一个 Geoserver 实例。目前,对 Geoserver 容器的请求通过主机的 Apache Web 服务器转发。我正在从 JavaScript Web 应用程序发出这些请求。
我想保护 Geoserver 上的一些图层的安全。
我的问题:如何提供正确的凭据(大概是用户名和密码)来从我的 javascript 应用程序访问这些层,而不在源代码中以普通视图显示它们?
这个站点上有很多与此类似的问题,但是我找不到一个可以解释这种特殊行为的问题。
我对django和ubuntu比较陌生,所以也许解释很简单。这是我尝试迁移到新服务器的旧(v1.3.7)django项目。
这是我在apache日志中遇到的完整错误:
TemplateDoesNotExist at /admin/
admin/login.html
Request Method: GET
Request URL: http://131.212.123.7:26080/glrimon/admin/
Django Version: 1.3.7
Exception Type: TemplateDoesNotExist
Exception Value:
admin/login.html
Exception Location: /.../leave_beave/lib/python2.7/site-packages/django/template/loader.py in find_template, line 138
Python Executable: /.../leave_beave/bin/python
Run Code Online (Sandbox Code Playgroud)
leave_beave 是我的virtualenv的名称。
这是回溯传递的信息:
Template-loader postmortem
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/glri_mon/siteweb/templates/admin/login.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/glri_mon/siteweb/gps_upload/templates/admin/login.html (File does not exist)
/glri_mon/siteweb/siteapp/templates/admin/login.html (File does not exist)
/glri_mon/siteweb/glrimon_models/templates/admin/login.html (File does not exist)
/glri_mon/siteweb/sdde/templates/admin/login.html (File does not exist)
/glri_mon/siteweb/dv/templates/admin/login.html (File does not …Run Code Online (Sandbox Code Playgroud)