Personal DB/Unclassified record
Django - morning note
Ayin Kim
2020. 12. 15. 11:58
반응형
Finally, back to the track.
And found that how I generate them with a random number as well.
def add_arguments(self, parser):
parser.add_argument(
"--number", default=2, type=int, help="How many rooms you want to create"
)
On terminal,
python manage.py seed_rooms --number (input the amount I want to create, without bracket)
* Once I stuck, be sure to go back from the current position first. Not from the very beginning.
django-seed와 faker를 이용해 커스텀 명령어로 데이터 생성하기
django-admin 커맨드를 만드는 방법은 다음 포스트를 참고하자 custom django-admin commands 우리는 Django 서버를 돌리기 위 python manage.py runserver를 돌려왔다. 이제는 이러한 명령어를 직접 만들어보자...
darrengwon.tistory.com
darrengwon.tistory.com/358?category=879979