B
B
Bjornie2017-08-10 13:06:38
Django
Bjornie, 2017-08-10 13:06:38

How to import a list of data (countries) into a sqlite table in Django?

There is a list of countries to be loaded into the current sqlite database. These countries have their own model, but adding manually is very time consuming. Can you tell me how to do it automatically?
I did something similar on the basis of MySQL, manually writing a table into the model, but it's not clear how to do this with sqlite

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Astrohas, 2017-08-10
@Astrohas

How is the list of countries stored? If line by line in some file, then you can read it in python manage.py shellpassing while saving.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question