반응형

장고 필드 관리 어드민 페이지

 

from django.db import models

# Create your models here.
class Quiz(models.Model):
    title = models.CharField(max_length=200)
    body = models.TextField()
    answer = models.IntegerField()

위 모델 migration 하던중 오타가 있었나보나 

다시 수정하고 migration 하니 

 

It is impossible to add a non-nullable field

 

애러

 

migrations 폴더에서 

__init__.py  파일 제외하고 모두 삭제 하면 해결 된다고 함

 

 

good

 

해결 하니..

 

웹페이지 안에서 ...

django has no column named title 오류... 

 

결국 db.sqlite3 까지 지우고 다시 마이그 하니 성공했다.

 

간편한거 같으면서 어려운 파썬 장고~  

간만에 집에서 코딩하니 재밌다..

 

축구는 새벽4시인데 버틸 수 있을런지..... 

낼 회사가서는 어쩌지 ㅠㅠ

 

2022 월드컵 한국 우승 한번 해보자 !! 기적 기적 

오늘은 브라질 이겨 주세요~ 

 

참고 사이트

https://velog.io/@won05121/Error-Table-has-no-column-named-django

반응형
반응형
from random import randint

# 랜덤하게 1~50 사이 숫자 생성
pc_choice = randint(1,50)

palying = True

# 맞출때 까지 루프
while palying:
 
  # 유저가 고른 숫자
  user_choice = int(input("choose Number "))

  # 같으면 짝짝
  if user_choice == pc_choice:
    print("you won ",pc_choice)
    palying = False
  elif user_choice > pc_choice:
    print("Lower")
  elif user_choice < pc_choice:
    print("Higher ")

반응형

+ Recent posts