Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4119896
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:09:01+00:00 2026-05-20T23:09:01+00:00

I have a Python CLI program, with SQL database models and want to add

  • 0

I have a Python CLI program, with SQL database models and want to add a frontend with a MVC framework (such as Django). What’s the best way to interface my program with the framework, if I’ve already defined my models?

Do I either:

  1. Rewrite the model so it’s shared by both Django and my program
  2. Write a layer that interfaces between Django and my Program
  3. Remove the model from My Program and let Django handle it

Choice #1: Shared Model

          My Program
        /      |    \
  Binaries    Model  Classes
               |
             Django
             /    \
         View     Controller

Choice #2: Create a Bridging Library

          My Program
        /      |    \
  Binaries    Model  Classes
               |
            My-Bridge
               |
             Django
             / |    \
         View  Model Controller

Choice #3: Use Django for Most Work and Remove Model from My Program

  Classes
         \
          My Program
        /      | 
  Binaries     |
               |
            My-Bridge
               |
             Django
             /   |    \
         View   Model   Controller

I’m avoiding Choice #1 (Create a Shared Model) because I don’t know how to create a shared model using Django’s ORM and SQLAlchemy.

I’m unsure about Choice #2 (Creating a Bridge) because I don’t know if this uses Django to its full extent. From the documentation, it seems as thought Django should handle the Model, given that its a MVC framework.

I’m also avoiding Choice #3 (Removing the Model from Program) because I would have to re-write all the SQLAlchemy ORM logic that uses the SQLAlchemy model in My-Program.

What do you guys think? Which choice is best given that I’ve already written the CLI version of my program?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:09:02+00:00Added an answer on May 20, 2026 at 11:09 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing cli with python version 2.4.3. i want to have the input
I have Python extension module written in C. I want to use in this
I have python/django app on Heroku (Cedar stack) and would like to make it
I have a GUI program which should also be controllable via CLI (for monitoring).
I have created a Python script that I want to run daily via a
I have python 2.7 installed in /opt/python2.7 . Now i want to install the
I am uploading a file with FTPLib in python and have a cli loadingbar
Does python have any way to easily and quickly make CLI utilities without lots
I have Python 2.7 running on Windows XP. I am trying to install Spynner
I have Python nested list that I'm trying to organize and eventually count number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.