是否有可能让django中间件模块包含自己的模板和静态文件?

时间:2016-12-06 18:43:48

标签: django middleware

我将DUO 2FA迁移到中间件层,它执行以下操作:

If the request is not authenticated through DUO, render the template containing the DUO login form

我的问题是,我的中间件包含这个代码,但是我从我的前端应用程序的模板文件夹中提取模板和静态文件,并从我的前端应用程序中提取静态文件。是否可以在中间件模块中包含依赖模板和静态文件?

以下是文件夹结构的简化视图

djangoproject
   myapp
      settings.py
      duo_middleware
          middlewareclass.py
   frontend
      views.py
      template
          index.html
          duo-login.html
      static
          someduodependency.js

我正在寻找在duo_middleware和静态文件夹中添加模板文件夹的可能性

0 个答案:

没有答案
相关问题