[플라스크 db 생성과정] ImportError: cannot import name 'textarea' from 'app'
![[플라스크 db 생성과정] ImportError: cannot import name 'textarea' from 'app'](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1712057841934%2F9e774ec6-0406-4f52-bf6a-f5a56f787d8b.png&w=3840&q=75)
# db 정보
class board(db.Model):
id = db.Column(db.Integer, primary_key=True)
user = db.Column(db.String, nullable=False)
title = db.Column(db.String, nullable=False)
content = db.Column(db.String, nullable=False)
date = db.Column(db.String, nullable=False)
class textarea(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, nullable=False)
comment = db.Column(db.String, nullable=False)
comment_date = db.Column(db.String, nullable=False)
db를 추가하고 테이블에 올리려고 하니까
ImportError: cannot import name 'textarea' from 'app'오류가 나왔다.
shell은 데이터를 실시간으로 받아오지 못하기 때문에 나중에 들어온 textarea를 임포트 해주려면
간단하게 shell을 command+d로 나가기 하고 다시 flask shell을 해서 값을 추가해 주면 된다.
flask shell
from app import db, 테이블명
db.create_all()




