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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:52:53+00:00 2026-05-28T07:52:53+00:00

This is pretty much Python, but asking from a Django user. Suppose this is

  • 0

This is pretty much Python, but asking from a Django user.

Suppose this is how Django apps are layout:

Webclient

  • apps
    • myapp#1
      • library
        • library.py
    • myapp#2
      • views.py
    • myapp#3

If I am working with views.py, and I want to import library.py, which one seems better?

from webclient.apps.myapp.library import LibraryClass
from webclient.apps.myapp.library.library import LibraryClass

I am using PyCharm, and either way doesn’t complain about “unresolved references”.
Is it better to import very speifically. Is second import method more likely to avoid name collison, if possible at all (say /library/ has several .py files)?

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-05-28T07:52:54+00:00Added an answer on May 28, 2026 at 7:52 am

    You should always import names from where they’re defined. That way if webclient.apps.myapp.library should stop importing LibraryClass one day, you won’t break the other imports.

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

Sidebar

Related Questions

This is pretty much a duplicate question but instead of using Castle Dynamic Proxy
This is a pretty-much theoretical question, but.. How much of an operating system could
Pretty much the same as this question. But I can't seem to get this
This pretty much has me defeated. On XP and earlier versions of Windows you
this pretty much is the thing. When in tinymce I press anything that is
This is pretty much the same problem i have, except with very different code:
I think this is pretty much the simplest case for mapping a Map (that
I'm having some weird issues with Xcode, and this is pretty much impossible to
This question is pretty much the same as this .Net question exept for java.
I am pretty much new in this. I know Remoting, HTTPService and WebService. I

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.