Part 3: 增加NOTE的編輯內文區 - amychenmit/misdj002 GitHub Wiki
Edit misdj002/note/models.py:
from django.db import models
class Note(models.Model):
subject = models.CharField(max_length=200)
detail = models.TextField(null=True, blank=True), #增加NOTE文本編輯區
def str(self):
return self.subject
確定在虛擬狀態,如果沒有要啟動:
ls -l
source ../venv/bin/activate
bq. source:運行, .. 兩個資料夾前可以找到的 venv
./manage.py makemigrations
./manage.py migrate
效果
(venv) leanneshendeMacBook-Air:misdj002 leanneshen$ ./manage.py makemigrations
Migrations for 'note':
note/migrations/0002_auto_20191009_0320.py
- Add field detail to note
- Add field seq to note
(venv) leanneshendeMacBook-Air:misdj002 leanneshen$ ./manage.py migrate
./manage.py makemigrations
Operations to perform:
Apply all migrations: admin, auth, contenttypes, note, sessions
Running migrations:
Applying note.0002_auto_20191009_0320... OK
啟動 server
./manage.py runserver
【歡呼】編輯內文區在後台可以使用!