S
S
sportik1742020-12-11 19:21:01
Django
sportik174, 2020-12-11 19:21:01

How to create an object with save() method in Django?

Good day! Here is a question.
I have a python parser that parses products, and I have a Django application.
We need the parser to parse the products and store them in the Django database.
I found this information in the documentation. But I still don't understand how to use it. In which file should this be written, etc.
5fd39bca7f601494224945.png
Tried like this. Created a test.py file in the application directory.
The contents of the file
5fd39de061b4d364899696.png
I tried to run the python test.py command. But I got an error,
5fd39c591fd70749409781.png

please help me

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sportik174, 2020-12-16
@sportik174

Solved the issue through the function in views

A
Aaaisgood, 2020-12-11
@Aaaisgood

The space must be removed between the dot and models in the import

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question