django的hello world
程序员文章站
2022-07-02 20:53:23
==================hello.py================================= ======================================================== 运行命令: python hello.py runserver ......
==================hello.py=================================
import sys from django.conf import settings from django.http import HttpResponse from django.conf.urls import url from django.core.management import execute_from_command_line settings.configure( DEBUG=True, SECRET_KEY='onlyfortest', ROOT_URLCONF=__name__, ) def index(request): return HttpResponse('Hello World') urlpatterns = ( url('^$', index), ) if __name__ == "__main__": execute_from_command_line(sys.argv)
========================================================
运行命令:
python hello.py runserver
上一篇: CefSharp 支持mp4
下一篇: PHP中Session的概念