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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:44:43+00:00 2026-05-14T15:44:43+00:00

I’ve set up a new project, and populated it with simple models. (Essentially I’m

  • 0

I’ve set up a new project, and populated it with simple models. (Essentially I’m following the tut.)

When I run python manage.py shell on the command line, it works fine:

>python manage.py shell

Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from mysite.myapp.models import School
>>> School.objects.all()
[]

Works great. Then, I try to do the same thing in Eclipse (using a Django project that is composed of the same files.)

Right click on mysite project >>
Django >> Shell with Django
environment

This is the output from the PyDev Console:

>>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
C:\Python26\python.exe 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
>>> 
>>> from django.core import management;import mysite.settings as settings;management.setup_environ(settings)
'path\\to\\mysite'
>>> from mysite.myapp.models import School
>>> School.objects.all()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Python26\lib\site-packages\django\db\models\query.py", line 68, in __repr__
    data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "C:\Python26\lib\site-packages\django\db\models\query.py", line 83, in __len__
    self._result_cache.extend(list(self._iter))
  File "C:\Python26\lib\site-packages\django\db\models\query.py", line 238, in iterator
    for row in self.query.results_iter():
  File "C:\Python26\lib\site-packages\django\db\models\sql\query.py", line 287, in results_iter
    for rows in self.execute_sql(MULTI):
  File "C:\Python26\lib\site-packages\django\db\models\sql\query.py", line 2368, in execute_sql
    cursor = self.connection.cursor()
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 81, in cursor
    cursor = self._cursor()
  File "C:\Python26\lib\site-packages\django\db\backends\sqlite3\base.py", line 170, in _cursor
    self.connection = Database.connect(**kwargs)
OperationalError: unable to open database file

What am I doing wrong here?

  • 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-14T15:44:43+00:00Added an answer on May 14, 2026 at 3:44 pm

    The error is about not being open the database file. So I’d guess that the path to the database in your settings.py is a relative path, and PyDev starts the shell with a different current directory than you normally use.

    If this is the case, change the DATABASE_NAME setting to an absolute path and it should work.

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

Sidebar

Related Questions

No related questions found

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.