Replies: 1 comment 1 reply
-
或者可以通过 # urls.py
from functools import partial
from django.urls import path
from django.views.static import serve
from pywebio import STATIC_PATH
from pywebio.platform.django import webio_view
from django.views.decorators.csrf import csrf_exempt
# `pywebio_app` 为 PyWebIO 应用
webio_view_func = webio_view(pywebio_app)
@csrf_exempt
def view_func(request):
# add auth in this
response = webio_view_func(request)
return response
urlpatterns = [
path(r"app", webio_view_func),
] 参见:https://pywebio.readthedocs.io/zh_CN/latest/guide.html#integration-with-web-framework |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请问下作者,跟 Django 集成之后,怎样获取到 request 对象?
因为一些内部运营工具需要登录态来鉴权之后才能访问对应的内容。
🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions