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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:38:17+00:00 2026-06-05T00:38:17+00:00

Working on the Django tutorial at the moment and got this error when I

  • 0

Working on the Django tutorial at the moment and got this error when I tried:

python manage.py syncdb

Using sqlite3

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/Library/Python/2.6/site-packages/django/db/backends/__init__.py", line 306, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/Library/Python/2.6/site-packages/django/db/backends/sqlite3/base.py", line 281, in _cursor
    self._sqlite_create_connection()
  File "/Library/Python/2.6/site-packages/django/db/backends/sqlite3/base.py", line 271, in _sqlite_create_connection
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

My settings.py file reads:

        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '/Users/username/django_tutorial/mysite', 

Anyone know the problem here? it seems like I am putting in the complete file directory, but the databases still couldn’t be created? ):

  • 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-05T00:38:18+00:00Added an answer on June 5, 2026 at 12:38 am

    You should use the path to the file, including the file name:

        'NAME': '/Users/username/django_tutorial/mysite/data.sqlite', 
    

    You can also just give it the file name:

        'NAME': 'data.sqlite',
    

    In that case it will be created in the same directory than the one from which you run manage.py.

    The best practice is to pass an absolute path, but to ensure this absolute path is created relatively to the settings file. E.G:

    import os
    
    SETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))
    

    Then latter:

        'NAME': os.path.join(SETTINGS_DIR, 'data.sqlite'),
    

    Remember that the settings file is a Python file, and that you can use Python code in it.

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

Sidebar

Related Questions

I'm following the Django-CMS introductory tutorial and have got everything working up to the
I'm working through the Django tutorial and receiving the following error when I run
Hey there, Now im working this base on dmitko tutorial on extending django-registration post
Using: Ubuntu 11.04 Django 1.3 Python 2.7 Following the tutorial at Writing your first
I really love working with Django and Python, when I go back to PHP
I'm working in Django, and using urllib2 and simplejson to parse some information from
I using Django tagging project. That is was very stable project. Working on django
I've been following the Django tutorial , and so far everything's been working as
After working through the Django tutorial I'm now trying to build a very simple
I'm doing this Django tutorial https://docs.djangoproject.com/en/dev/intro/tutorial01/ and was_ published _today isn't working. Thanks for

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.