import_modules的功能

import_module()

import_module 可以执行字符串模块

如 engine=import_module('django.contrib.sessions.backends.db')  

##的意思就是将engine=    from  django.contrib.sessions.backends import db这个付给了 engine

self.SessionStore = engine.SessionStore

实际就是调用了  db 模块中的SessionStore模块

 

posted on 2018-03-08 23:36  王大拿  阅读(131)  评论(0)    收藏  举报

导航