玩蛇网提供最新Python编程技术信息以及Python资源下载!

Python导入方法都有哪些,除import外

我看见别人的代码没有引入相关的库,但是仍然能够运行,不知道为啥

from user import *
from django.template import Template
from decimal import Context
from models import ServiceCore

def Register(request):
    register_t = loader.get_template('core/_register.html')
    c = Context({"REQUEST":request.REQUEST})
    return HttpResponse(register_t.render(c))

上面代码没有引入loader也没有HttpResponse,也能运行不知道为啥

因为没有执行这个函数。。在最下面添加一行 Register(your_arg)就会报错了。NameError: global name 'loader' is not defined

玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/wenda/wd20185.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
修订日期:2017年05月18日 - 21时20分17秒 发布自玩蛇网

您现在的位置: 玩蛇网首页 > Python问题解答 > 正文内容
我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules