You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于Open edX中ORA2 XBlock的Django URL配置问题咨询

ORA2 XBlock Filesystem Upload URL Configuration in Open edX LMS

Let's break down how to properly wire up the openassessment.fileupload URLs into your LMS urls.py as noted in the filesystem.py comments.

Step 1: Update LMS's urls.py

First, open up your edx-platform/lms/urls.py file. You'll need to handle two small tasks here:

  • Make sure you have the include import from Django's URL module (add it if it's missing)
  • Add a new entry to your urlpatterns that points to the ORA2 fileupload URL configuration

Here's what the updated code should look like:

# At the top of edx-platform/lms/urls.py
from django.conf.urls import include, patterns, url  # Ensure `include` is imported

# ... keep all your existing urlpatterns content ...

# Add this line to your urlpatterns list
url(r'^openassessment/fileupload/', include('openassessment.fileupload.urls')),

Why This Setup Matters

The openassessment/fileupload/urls.py snippet you shared defines a route that maps to the filesystem_storage view in openassessment.fileupload.views_filesystem. By including this in the LMS's root URLconf, you're telling Django to route any requests starting with /openassessment/fileupload/ to those specific URL patterns.

For example, a request to /openassessment/fileupload/my-unique-file-key/ will trigger the filesystem_storage view, passing my-unique-file-key as the key parameter to handle the file upload/retrieval.

Quick Validation Check

After making this change, restart your LMS service. You can test if the route is working by sending a request to the endpoint (you may need to authenticate first depending on your instance settings). If Django doesn't return a 404 error, that means the routing is configured correctly.

内容的提问来源于stack exchange,提问作者R.R

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:26:28