0

我正在尝试为我的 Django 项目设置 APE 服务器。

设置

  1. 我按照 APE wiki 中的设置说明进行操作:Simple APE Con​​figuration

    我不得不改变端口。我的虚拟主机配置如下:

    NameVirtualHost 127.0.0.1:8100
    Listen 127.0.0.1:8100
    <VirtualHost 127.0.0.1:8100>
        ServerName local.ape-project.org
        ServerAlias ape.local.ape-project.org
        ServerAlias *.ape.local.ape-project.org
    
        DocumentRoot "/path/to/my/project/ape-jsf/"
    </VirtualHost>
    

    运行http://local.ape-project.org:8100/Tools/Check/成功运行所有测试并返回消息:All test done. Now you can play with your APE \o/

  2. Django 在 8000 端口上运行:

    python manage.py runserver_plus 0.0.0.0:8000

  3. 我按照第一个教程的说明进行操作:教程:换色器

    我将 JavaScript 代码放入我的 django 项目中(包含Clients/JavaScript.js)。

问题

当我打开页面时,我收到此错误:

Unsafe JavaScript attempt to access frame with URL http://2.ape.local.ape-project.org:6969/?[{%22cmd%22:%22script%22,%22params%22:{%22domain%22:%22127.0.0.1%22,%22scripts%22:[%22http://local.ape-project.org:8100/static/ape-jsf/Source/mootools-core.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Core/APE.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Core/Events.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Core/Core.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Pipe/Pipe.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Pipe/PipeProxy.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Pipe/PipeMulti.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Pipe/PipeSingle.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Request/Request.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Request/Request.Stack.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Request/Request.CycledStack.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Transport/Transport.longPolling.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Transport/Transport.SSE.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Transport/Transport.XHRStreaming.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Transport/Transport.JSONP.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Core/Utility.js%22,%22http://local.ape-project.org:8100/static/ape-jsf/Source/Core/JSON.js%22]}}]
from frame with URL http://127.0.0.1:8000/mydjangoapp/somepage/. Domains, protocols and ports must match.

我了解不同域和端口存在安全问题。

但这应该如何工作?

4

1 回答 1

2

事实证明,很难配置一个同时运行Ape和的环境runserver。解决此问题的方法是使用另一个 Web 服务器。

我选择了 Apache 和 mod_wsgi 模块:

于 2012-05-21T17:00:07.507 回答