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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:54:11+00:00 2026-06-18T05:54:11+00:00

I receive the following error when trying to run a shell command using Python

  • 0

I receive the following error when trying to run a shell command using Python Tool for Visual Studio. I have added the database to the settings file, and have been able to run the django app without errors, but when I try to add data using the shell, it throws this error:

>>> from ProjectTrackerServer.projects.models import Project
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\djangoapps\ProjectTrackerServer\ProjectTrackerServer\projects\models.py", line 1, in <module>
    from django.db import models
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 184, in inner
    self._setup()
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 40, 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-18T05:54:12+00:00Added an answer on June 18, 2026 at 5:54 am

    The error states the issue. It occurred because you forgot to supply the project setting DJANGO_SETTINGS_MODULE. You can fix it by supplying it. You need to set the DJANGO_SETTINGS_MODULE environment variable.

    When you use Django, you have to tell it which settings
    you're using. Do this by using an environment variable, 
    DJANGO_SETTINGS_MODULE.
    
    The value of DJANGO_SETTINGS_MODULE should be in 
    Python path syntax, e.g. mysite.settings. Note 
    that the settings module should be on the 
    Python import search path.
    

    https://docs.djangoproject.com/en/dev/topics/settings/

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

Sidebar

Related Questions

I receive the following error when trying to run my ASP.NET MVC application: The
When trying to run my code, I receive the following error: CS0234: The type
I receive the following error when trying to run the app on my device.
I receive the following error when trying to run the new project per the
i receive the following error when trying to implement auto-complete based on edismax type.
Using HttpClient , I receive the following error when attempting to communicate over HTTPS:
I'm trying to run the following code but unfortunately facing Error problems package jskypeexample;
I receive the following error when I try to run my code: lua:readFile.lua:7: attempt
When I run my script I receive the following error before processing all rows
I'm trying to run a test suite using rspec with the command(s) bundle exec

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.