Answer the question
In order to leave comments, you need to log in
How to add data to Django database?
Hello.
It's about django.
There is an empty database (models.py is described correctly).
I need to populate this database with some data through code.
How can this be done and what methods should be used?
I know how to do it through forms (through the site itself), but I don’t know how to quickly through the code.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
https://docs.djangoproject.com/en/1.8/ref/models/q... special attention to the create method. And fixtures https://docs.djangoproject.com/en/1.8/howto/initia...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question