javascript - Fullcalendar 无法定位/数据馈送

标签 javascript python apache flask fullcalendar

我正在尝试使用 Fullcalendar 来渲染从另一个使用 Flask 用 Python 编写的应用程序返回的事件。我已经成功查询应用程序并在我的测试设置(我的笔记本电脑本地)上将 JSON 返回到 Fullcalendar,效果很好。

当我尝试将相同的代码部署到服务器(带有 Apache 的 CentOS 7)时,Apache 记录以下错误:

AH00128: File does not exist: /etc/httpd/htdocs/data

calendar.html 模板的摘录如下:

<script>
    $(document).ready(function() {
        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,listWeek'
            },
            defaultView: 'listWeek',
            editable: false,
            eventLimit: true, // allow "more" link when too many events
            events: {
                url: 'data',
                error: function() {
                    $('#script-warning').show();
                }
            },
            loading: function(bool) {
                $('#loading').toggle(bool);
            }
        });
    });
</script>

我发现 url: 'data' 行似乎正在控制路径,但我无法在那里设置任何有效的内容。我在代码中看不到可以设置路径的其他任何地方 - 显然 /etc/httpd/htdocs/data/ 无效 - 如何配置路径以便呈现数据?

编辑:我相信这是一个 Apache 问题 - 我的 conf 文件如下:

<virtualhost *:443>
  ServerName server.example.com
  LogLevel info
  SSLEngine On
  SSLProtocol all -SSLv2 -SSLv3

  WSGIDaemonProcess fs_calendar user=apache group=apache threads=5 home=/var/www/fs_calendar/
  WSGIScriptAlias /fs_calendar /var/www/fs_calendar/calendar.wsgi

  <directory /var/www/fs_calendar>
    WSGIProcessGroup fs_api
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptReloading On
    WSGIPassAuthorization On
    Order deny,allow
    Allow from all
  </directory>

  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/server.example.com/cert.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/server.example.com/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateChainFile /etc/letsencrypt/live/server.example.com/chain.pem
</virtualhost>

最佳答案

听起来您的网址指向的位置不匹配。

尝试放置

url: "https://myhost/data" 

在您的代码中绝对确定它指向正确的位置。

关于javascript - Fullcalendar 无法定位/数据馈送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50336493/

相关文章:

python - Django 测试——无法删除并重新创建测试数据库

python - 使用 INSERT IGNORE 的 SQLAlchemy session 查询

regex - apache .htaccess 重写不应包含 www

apache - 如何使用 htaccess 重写 url 并保持相关链接正常工作

security - 如何保护 Amazon S3 URL

javascript - 当代码放置在 Joomla 文章中时,Jquery 拖放在 Chrome 浏览器中无法正常工作

javascript - 如何将带有键作为索引的对象转换为 JavaScript 中的数组?

javascript - 鼠标悬停元素上的反向径向渐变 SVG 动画

javascript - 基于浏览器的实时 MMO 游戏的内部运作

python - OpenCV VideoCapture 以来自 GoPro 的视频结束