일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- Dependency
- html cell
- html
- html cell size
- Spring
- Django 특정 값 가져오기
- DI
- table tag
- Django column 값 가져오기
- Dependency Injection
- Django
- table cell size
- Today
- Total
emluy 개발 일기
Django DB 초기화 본문
0. 프로젝트 root 위치에서 다음과 같이 터미널 입력
:migrations 폴더에서 init.py 빼고 삭제 해주는 작업
$ find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
$ find . -path "*/migrations/*.pyc" -delete
1. db.sqlite3 파일 삭제
2. 터미널에 다음과 같이 입력
1) django 다시 설치
: 가상환경 접속 후 장고 버전 확인
$ python -m django --version
2) django 강제 reinstall 하기
: 1번에서 확인한 장고 버전으로 다시 강제 설치
$ pip install --upgrade --force-reinstall Django==3.0.5
3) makemigrations 와 migrate 다시하기
$ python manage.py makemigrations
$ python manage.py migrate
이 때, 다음과 같이 오류 난다면?
No module named 'django.db.migrations.migration'
-> django 다시 깔기
참고
stackoverflow.com/questions/43527907/updating-django-error-no-module-named-migration
Updating Django - error: 'No module named migration'
I'm upgrading my Django App from Django 1.5.5 tot 1.9, Django-cms from 2.4.3 to 3.3 (and all corresponding packages). After I've plowed through all the errors of depreciated functions I now stumbl...
stackoverflow.com
파이썬 Django DB 초기화
Django로 개발을 하다보면 DB 초기화를 종종 해야 할 경우가 있습니다. migration 하다가 DB가 꼬이는 경우 에러가 빈번하게 발생될 수 있기 때문에 어떻게 초기화 하는지에 대하여 한번 알아보겠습니
softwaree.tistory.com
'웹 개발 > Django' 카테고리의 다른 글
Django - request.GET[] 과 request.GET.get()의 차이 (1) | 2020.06.18 |
---|---|
Django 특정 인스턴스의 특정 column값 가져오기 (0) | 2020.06.10 |
Django 검색기능 (2) | 2020.05.25 |
Django에 excel 파일 업로드 (0) | 2020.05.20 |
Django 웹 13 - Class CRUD (수정중) (0) | 2020.05.19 |