标签:his serve height tin develop comm nbsp wmi middle
创建一个hello.py 内容如下:
import sys from django.conf import settings # 设置 settings.configure( DEBUG = True, SECRET_KEY = ‘thisisthe‘, ROOT_URLCONF = __name__, MIDDLEWARE_CLASSES = ( ‘django.middleware.common.CommonMiddleware‘, ‘django.middleware.csrf.CsrfViewMiddleware‘, ‘django.middleware.clickjacking.XFrameOptionsMiddleware‘, ), ) from django.conf.urls import url from django.http import HttpResponse # 创建视图 def index(request): return HttpResponse("Hello world") # URL urlpatterns = ( url(r‘^$‘, index), ) if __name__ == "__main__": from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
终端运行:python hello.py runserver
System check identified no issues (0 silenced).
Django version 2.0.3, using settings None
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
标签:his serve height tin develop comm nbsp wmi middle
原文地址:https://www.cnblogs.com/kaid/p/8849690.html