[Django]-Python Backend Logic Adding MVC Framework (Django)

3👍

I love Django but given this scenario, you could also take a look at Pylons too, since they support SQLAlchemy. Or you can still work with SQLAlchemy by importing it into your views. See this post on an example for doing that.

1👍

Let’s start by making observation that frontend which modifies data bypassing backend doesn’t sound like a good design. Having said this I don’t see any technical reason it can’t be done. We have to remember that it’s database that keeps integrity of data. That’s why you should be able to use different ORMs or one ORM with different models with the same database.

The model ORM you use definitely
dictates how the integration between
backend and frontend should be played
out.

I wouldn’t say it dictates the choice. It would be simpler to have the same ORM for both backend and frontend but that’s not a must.

0👍

I’d try to migrate much of the logic of ‘My Program’ to a module that is importable. Then, have django import this and share the settings for the database across them. It’d also be possible to have the django instance running, and doing the grunt work, and let the ‘My Program’ make remote calls to it. Granted that would probably take the most work.

0👍

Rewriting the models to conform to django’s api sounds like the least amount of work, and the most ‘correct’ way to solve your problem. Unless you’re doing some ‘advanced’ database access, Djangos ORM should be able to handle what you want to do cleanly. Using the full stack also pays dividends later when you decide you want forms wrapping your models, and all the various other bits of the framework that expect a model structure.

Leave a comment