Answer the question
In order to leave comments, you need to log in
How to add rows from xml document in django to db sql?
I have an xml document from someone else's site and I need to update my db
. But this is the first time I'm dealing with xml files and I don't know what models to create inside models.py, and how
to update them.
can someone explain to me how to do this
Answer the question
In order to leave comments, you need to log in
You read, look at examples of working with xml:
https://lxml.de/tutorial.html#the-parse-function
You
understand, then go to your xml file.
You try on it.
Next, you create a view in which you parse the passed xml, according to the data model, then save it.
if the xml file is large, save it on the server and process it in a separate worker/thread.
By passing the filename through the queue.
I don’t know what models to create inside models.py, and how
to update them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question