为了说明它们两者的区别定义2个models class Student(models.Model): name = models.CharField('姓名', max_length=20, default='') age = models.CharField('年龄', max_length=20, default='') class Book(models.Model): student = models.ForeignKey(Student) 一.先说下django的obj.get():…
在早期的django版本中 urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^polls/', include('polls.urls', namespace="polls")), ] 而我现在使用的是django2.2.3这样写就会出现错误 'Specifying a namespace in include() without providing an app_name is not supported. Set th…