Skip to main content
9 events
when toggle format what by license comment
yesterday comment added Abdul Aziz Barkat Are you trying to register a SQLAlchemy model to Django's admin site, maybe that Base variable? That won't work, the admin site isn't designed for that, it's designed for Django models.
S yesterday history suggested CommunityBot CC BY-SA 4.0
Format code, minor grammar
yesterday review Suggested edits
S yesterday
Feb 8, 2022 at 18:59 comment added Justin Benfit Thank you! I am thinking that I just need to figure out a way to convert the response into json as I think django prefers that. I will check out the article. Thanks again. This has been very helpful!
Feb 8, 2022 at 17:44 comment added Jimmy Pells This may be a helpful tutorial for you explaining how to retrieve data from an API and insert it into your database using Django's ORM medium.com/@chilinski.a/…
Feb 8, 2022 at 17:39 comment added Jimmy Pells Usually developers will not use 2 different ORMs (Django vs. sqlalchemy) in the same application. I presume you are querying an API and importing data into a database that you control. The way you are querying this API sounds like you are loading the data into a Pandas DataFrame which does provide a method to insert into sqlalchemy. If the benefits of using Pandas and sqlalchemy outweigh the benefits of Django you might consider using Flask instead, but I suspect you are going to find it easier to query your API and import it using Django's ORM.
Feb 8, 2022 at 17:17 comment added Justin Benfit @JimmyPells, Thank you for responding! I was under the impression when I first started the project that I needed to write the data from the api call to a dataframe in order to be able to insert it to db and I didn't think that django orm was able to parse a dataframe. I guess I probably need to figure out a way to have the custom command class run the api call then feed django the data in a way it can ingest it.
Feb 8, 2022 at 17:07 comment added Jimmy Pells I am confused why you need to use sqlalchemy. If you need to manage the external database (API) by performing migrations on it using alembic, it would be easier to ditch sqlalchemy/alembic and use django to manage the external database (API).
Feb 8, 2022 at 16:15 history asked Justin Benfit CC BY-SA 4.0