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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:56:08+00:00 2026-05-24T20:56:08+00:00

I have a django application, with a module called app Now this module has

  • 0

I have a django application, with a module called “app”
Now this module has a file called “urls.py” which has a variable called “HOME_URL“

What I’m trying to do ?

app_label = "app"
url = __import__(app_label).urls.HOME_URL
print url

That obviously doesn’t work, but I hope you got what I’m trying to do, If not please comment I will edit the question to contain more info.

  • 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-24T20:56:09+00:00Added an answer on May 24, 2026 at 8:56 pm

    You can use import_module to load a module relative to the root of a django project.

    from django.utils.importlib import import_module
    app_label = "app"
    url = import_module("%s.urls" % app_label).HOME_URL 
    

    This should work within your django project, or in ./manage.py shell.

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

Sidebar

Related Questions

I have a python/django application that runs on the google app engine. My views.py
I have a Django application. One of my models looks like this: class MyModel(models.Model):
I'm trying to deploy a django application for production on apache mod-wsgi. I have
I've deployed a django-application, which basically works fine. The only problem I have is
I have a Django application which allows different kinds of users: firms, administrators, external
I have set up a Django application that uses images. I think I have
I'm working on a blog application in Django. Naturally, I have models set up
Do the major web application frameworks (Rails, Django, etc) have libraries that provide functionality
I have written a Django app that makes use of Python threading to create
I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if

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.