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 8640707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:20:44+00:00 2026-06-12T11:20:44+00:00

I have two Django Projects where I use a lot of common models. Custom

  • 0

I have two Django Projects where I use a lot of common models. Custom user classes, Algorithm classes, Product classes. The two projects are related to e-commerce, both run on different machines and serve completely different purposes.

However, considering that they have these models in “common”, I was wondering if it would be worth it to create a third, common project that serves as the “base” with the base models, and then both of these projects would import the common models from this base project.

This would also help as we can join the two different customer and product databases from both e-commerce websites into this big common database.

My questions are:
1) Does anybody have any experience with the possible overhead or can realistically estimate it? Joining the common parts of both Django projects will be necessary down the road, but I estimate there will be a lot of overhead in importing a third project (possibly in real-time).

2) What would be the best approach to importin this third project? I can think of multiple ways:

  • Creating a packaged, installable Python module such as the existing ones on the internet (setuptools, lxml, tastypie) and importing that module into both Django projects;
  • Having the project sit on a directory in a machine and importing from that path in real-time inside the Python file (have done it before, works but seems to have some overhead);

EDIT: Our common models/functionality, additionally, contain trade-secreted and patenteable content, therefore public distribution is out of the question. I am guessing the route would be to create something like a package, but not publicly distributed, only distributed and installed on the 2 specific machines.

Can anybody give some feedback on this?

Thank you

  • 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-06-12T11:20:45+00:00Added an answer on June 12, 2026 at 11:20 am

    I would separate out the common models, ect… into it’s own python package. Then each project will have this package installed, or just install the package at the system level and they both can use it. If you handle this properly you shouldn’t have to change much of your imports and you can easily update the package by pushing a new egg to the server and installing via easy_install or pip.

    This is the way that I currently have my projects setup. Common non-business logic is separated out into their own project and I create a package from this and then install and use like any other python library.

    The little bit of extra work here can save you a lot of time and allows for transparent updating of your common code between various projects as well.

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

Sidebar

Related Questions

In Django, I have two models: class Product(models.Model): name = models.CharField(max_length = 50) categories
I have two models in my Django application, for the purposes of storing search
I have two models in my Django 1.1.1 application: class UserRequest(models.Model): # blah blah
I have two models, one a vanilla Django model, another an unmanaged model wrapping
I have two distinct Django projects, which I want to run on a single
For Django 1.1. I have this in my models.py: class User(models.Model): created = models.DateTimeField(auto_now_add=True)
I have two Django model classes that are structured similar to the following: class
I have two servers - one Django, the other likely to be written in
Is is possible to programatically join two tables using Django's ORM? I have two
If I were to have two different QuerySets in Django, both representing a ManyToMany

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.