G
G
Grigory Kalyashov2015-01-06 13:30:51
Django
Grigory Kalyashov, 2015-01-06 13:30:51

How to fix error while working with Django in Pycharm?

How to fix a database error?
When I run the syncdb command , this is what happens:

"C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\bin\runnerw.exe" C:\Python26\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\helpers\pycharm\django_manage.py" syncdb C:/Users/ТВ/PycharmProjects/djblog
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 3.4.1\helpers\pycharm\django_manage.py", line 23, in <module>
    run_module(manage_file, None, '__main__', True)
  File "C:\Python26\lib\runpy.py", line 136, in run_module
    fname, loader, pkg_name)
  File "C:\Python26\lib\runpy.py", line 54, in _run_module_code
    mod_loader, pkg_name)
  File "C:\Python26\lib\runpy.py", line 34, in _run_code
    exec code in run_globals
  File "C:\Users\��\PycharmProjects\djblog\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python26\lib\site-packages\django\core\management\base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Python26\lib\site-packages\django\core\management\base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "C:\Python26\lib\site-packages\django\core\management\base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "C:\Python26\lib\site-packages\django\core\management\commands\syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 160, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 132, in _cursor
    self.ensure_connection()
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 127, in ensure_connection
    self.connect()
  File "C:\Python26\lib\site-packages\django\db\utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 127, in ensure_connection
    self.connect()
  File "C:\Python26\lib\site-packages\django\db\backends\__init__.py", line 115, in connect
    self.connection = self.get_new_connection(conn_params)
  File "C:\Python26\lib\site-packages\django\db\backends\sqlite3\base.py", line 346, in get_new_connection
    conn = Database.connect(**conn_params)
django.db.utils.OperationalError: unable to open database file

Although the database file is in its place in the project folder. What's wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grigory Kalyashov, 2015-01-06
@kalyashov

I fixed everything, just in the path to the project folder there was a folder with Cyrillic, stuffed it into the root of the disk and everything is fine)

R
raiboon, 2015-01-06
@raiboon

You don't need to create it. Delete and execute...
Which synсdb? makemigrations && migrate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question