Now let's see how to access admin interface.

1. Create a super user which can access admin interface:

python manage.py createsuperuser

2. Inside admin.py, we import the Models we have defined:

from django.contrib import admin

# Register your models here.
from .models import List, Card admin.site.register(List)
admin.site.register(Card)

---

The models:

from django.db import models
from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible
class List(models.Model):
name = models.CharField(max_length=) def __str__(self):
return "List {}".format(self.name) @python_2_unicode_compatible
class Card(models.Model):
title = models.CharField(max_length=)
description = models.TextField(blank=True)
list = models.ForeignKey(List, related_name="cards")
story_points = models.IntegerField(null=True, blank=True)
business_value = models.IntegerField(null=True, blank=True) def __str__(self):
return "Card {}".format(self.title)

Notice that if you change models.py file, you need to run migrations again:

python manage.py makemigrations

If you see the terminal warning that "You have 1 unapplied migration(s)... Run 'python manage.py mifate' to apply then."

python mange.py migrate

3. Run the server:

python manage.py runserver

Go to the url: localhost:8000/admin

最新文章

  1. 为什么js加事件时不要写括号
  2. VS2013编译python源码
  3. ArcGIS Engine中的数据访问
  4. DFS
  5. synchronized(this) 和synchronized(xxx.class)的区别和联系
  6. Searching in a rotated and sorted array
  7. (4)ARP:地址解析协议
  8. DD_belatedPNG,IE6下PNG透明解决方案
  9. 从1500万用户巅峰跌落的app,血泪回顾图片社交那些坑
  10. .Cannot create an NSPersistentStoreCoordinator with a nil model
  11. solr安装血泪史
  12. Dockerfile怎么创建镜像
  13. Dynamics CRM2013 定制你的系统登录后的首页面
  14. 2018-2019-2 20175317 实验二《Java面向对象程序设计》实验报告
  15. Javascript学习---倒计时
  16. C#计算时间差 TimeSpan
  17. T-SQL:排除阻塞(十六)
  18. Cassandra基础3
  19. Flume 安装和配置
  20. jQuery中的deferred对象和extend方法

热门文章

  1. 利用安卓手机的OTG共享有线网络
  2. 终于研究出如何设置新版paypal付款时汇率损失方的问题了
  3. 14.ZooKeeper Java API 使用样例
  4. 119.WIN32窗口原理
  5. 1.3 Quick Start中 Step 1: Download the code官网剖析(博主推荐)
  6. vue实现多语言国际化(vue-i18n),结合element ui、vue-router、echarts以及joint等。
  7. 关于js盒子模型的知识梳理
  8. POJ 2284 That Nice Euler Circuit (LA 3263 HDU 1665)
  9. (转) centos安装oracle11.2 pdksh软件包的说明
  10. 使用 JS 关闭警告框及监听自定义事件(amaze ui)