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

  • Home
  • SEARCH
  • 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 8463847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:34:05+00:00 2026-06-10T14:34:05+00:00

My question is rather difficult to wrap in words, but let’s try: I reckon

  • 0

My question is rather difficult to wrap in words, but let’s try:

I reckon it’s easier to explain my problem with a chart demonstrating my django project structure:

Project1 ——– /Project1

                        settings.py
                        urls.py
                        models.py
                        views.py
            manage.py

            /App1
                        urls.py
                        models.py
                        views.py

Now, in my views.py in App1, how could I do “project1.models import *” without hard coding “project1”? Instead, I would need to have a dynamic name of the main project (project1 in this case).

My goal is that I could use this same structure also in my next project with as little changes in the code as possible. In this case, at the moment I would need to change that one line in my App1 views to whatever is the name of my project.

Thanks!

  • 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-10T14:34:06+00:00Added an answer on June 10, 2026 at 2:34 pm

    You can use relative imports:

    from ..models import *
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Difficult to try and phrase this question, but I will try my best. Basically,
This question is quite difficult to describe in words, so let me know if
Excuse if this is more a file format conversion question rather than programming, but
The question is rather straightforward but not answered by searching. How do I determine
My question is rather simple. Let's suppose I'm executing the algorithm A star (search
my question is rather simple, if you have an pure virtual class (interface) but
My question might sound rather strange, but still I didn't find any reference and
I think its a rather simple question but I couldn't really find an answer
Rather silly question, but I can't seem to find the answer in the docs
This is a difficult question to articulate, but I'll give it my best: Basically

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.