8👍
You can go around the model layer and use sql directly. However, you will have to process the tables in python, not having the advantage of using ORM objects.
https://docs.djangoproject.com/en/1.10/topics/db/sql/#executing-custom-sql-directly
2👍
As pointed out in a comment, Django provides a way to automatically generate the models from the legacy database with inspectdb
.
This guide describes the few manual steps required to “clean” the automatically generated models.
While this doesn’t directly answer the stated question of avoiding models, it does address your issue of not wanting to create them yourself, due to the large database.
- Django REST Framework – multiple models / APIs?
- Django: Reading Array of JSON objects from QueryDict
- Is it possible to use a natural key for a GenericForeignKey in Django?
- Django orm group by multiple columns
- Object of type 'TypeError' is not JSON serializable
-2👍
Data should be stored somewhere. There are a lot of ways to store data, but the most reliable one is a database (hence the name).
You could be storing data in a JSON file and save that. You could also be storing data in environment variables. You can even store data in a plain text file. All of those are NOT recommended. I would just try to use a database, any type of database (MongoDB / Postgres / MySQL, anything). That’s what it is meant for.
- How can I create a partial search filter in Django REST framework?
- Do I need to close connection in mongodb?
- What cheat sheets exist for Django?
- Django calling REST API from models or views?
- Autocomplete field in Django