How to import external .json file to Django database(sqlite)?

So, what is the basic thing I can do to initialize my Django database with the data I have in external .json file.

I tried to upload through admin's page after running py manaeg.py runserver but there is no import options.

Why you would use a JSON file if you can to add a key in the database dictionary in the settings file? For the case to use a json file,

config = open('./config.json',)
data = json.load(config)

Now use the data variable in the settings database dictionary

 DATABASES = {
     "default": data 
 }
Back to Top