I'm using Django and I have a form in html which gets the data to store in the database, I would like to know how can I insert this data without using ORM, just pure SQL commands. Do I have to create a model? Does anyone have any example?
Actually Django's SQL management is very good. I don't understand why you choose use Raw SQL. However, if you still need, django allows using raw sql query.
There is two options:
Create your model and manipulate with sql queries like here: https://docs.djangoproject.com/en/3.1/topics/db/sql/
Use stored procedures in your db and call them from django: https://docs.djangoproject.com/en/3.1/topics/db/sql/#calling-stored-procedures
OR
Understand Making Queries in Django and using QuerySet API reference
1.4m articles
1.4m replys
5 comments
56.9k users