hello django

1.用pycharm 创建Django 项目   hello_django

2.新建views.py 文件   写入 方法

  

def index_view(request):
return HttpResponse('hello world')

3.在 urls 中 加入 

path('hello/', views.index_view),


4. 启动
控制台输入

python3 manage.py runserver 127.0.0.1:8000


 

新建 stu 模块

1.  python3 manage.py startapp stu

2.  把stu 加入 settings.py 里面的 INSTALLED_APPS 

 

 

 


 

 

 


https://gitee.com/AngDH/hello_django.git
posted @ 2020-03-08 21:27  AngDH  阅读(126)  评论(0编辑  收藏  举报