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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:16:22+00:00 2026-06-04T20:16:22+00:00

I tried to execute from django.db import models but it gave the following error..

  • 0

I tried to execute

from django.db import models

but it gave the following error.. 🙁

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/django/db/__init__.py", 
line 14, in <module>
if not settings.DATABASES:
File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/django/utils/functional.py",
line 276, in __getattr__
self._setup()
File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/django/conf/__init__.py", 
line 38, in _setup
raise ImportError("Settings cannot be imported, because environment variable %s is 
undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable   
DJANGO_SETTINGS_MODULE is undefined.
  • 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-04T20:16:23+00:00Added an answer on June 4, 2026 at 8:16 pm

    I’m assuming you are trying to do this import from the shell/terminal? If so you need to navigate into your Django project directory and type python manage.py shell before executing your import.

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

Sidebar

Related Questions

How can I execute max query in django 1.0 version. I tried from django.db.models
In my models.py: from django.db import models from core import tasks class Image(models.Model): image
I tried to execute scripts from [1] in model database and user-defined databases but
I tried 3 methods to call ffmpeg from python, but it always blocks and
I tried to execute the following query: RESTORE DATABASE TESTDB FROM DISK = <path
It's not the first time I have tried to execute a system command from
I keep getting this error when I tried to execute this query, although I
i tried the below program to execute on my local machine..but it doesn't work.
I tried to run the following command, in the folder of my Django project:
I tried to install Django with FastCGI but without success!. It gives me a

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.