settings """ Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.9.8. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and th
Django==2.0.1 版本路由配置: 1.在manage.py同级目录下新建一个应用app1 在app1下新建urls.py文件,定义一个app1的空白路由: from django.urls import path from . import views app_name='app1' urlpatterns=[ path('',views.index,name='index') ] 2.在主模块下的urls.py包含app1的路由,使用include来包含app1的路由 from dj
运行环境: Python 3.5.2 Django 2.0.3 Django Admin中model显示为中文 定义model时,定义一个Meta对象,设置需要显示的中文名称.verbose_name为单数名称,verbose_name_plural为复数名称.因为中文没有区分单数.复数,所以都定义为一样的名称. from django.db import models class Article(models.Model): class Meta: verbose_name = '文章' ve