A
A
Alexey Mistin2015-05-05 19:39:58
Django
Alexey Mistin, 2015-05-05 19:39:58

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

1 answer(s)
A
Alexey Sergeev, 2015-05-05
@Mistin

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 question

Ask a Question

731 491 924 answers to any question