8

如何创建一个 request.user 的实例?

 3 years ago
source link: https://www.v2ex.com/t/787192
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Python

如何创建一个 request.user 的实例?

  leven87 · 12 小时 47 分钟前 · 344 次点击
v 友好,新入坑 django,问题多多。 如何创建一个 request.user 的实例,我并不想存储这个 user 到数据库,而只是为了给另外一个插件提供调用。我知道可以通过 request._force_auth_user 可以强制的定义 request.user,但是它必须是一个 User 对象。请教如创建何这个 model 的实例,而不存储它,谢谢。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK