Django - too many options when lanuching dbshell sqlite3

I have django 1.2.3.0 Final and I'm using Python 2.7

In my setup, I have "sqlite3" populated for DATABASE_ENGINE. I can work with sqlite3 (at the djano manage.py shell level) until I was informed that I need to access

python manage.py dbshell

At first I got the error "sqlite3 is not recognized ..." Then I read the topics and I found that this can be solved by downloading the exe file and setting the environment variable path in Windows (I'm XP Pro)

Instead, I used this approach http://groups.google.com/group/django-users/msg/cf0665c227030ae2 ?

Now when I access python manage.py dbshell , I get

C:\Documents and Settings\JohnWong\workspace\mysite\mysite>python
manage.py dbsh
ell
sqlite3: Error: too many options: "Settings\JohnWong\workspace\mysite
\sqlite.db"

Use -help for a list of options.

--database = name_of_my_db

.

+3
2

.

0

( django 1.3.1) , , sqlite3, db sqlite. :

django.db.backends.sqlite3/client.py

class DatabaseClient(BaseDatabaseClient):
        executable_name = 'sqlite3'

        def runshell(self):
            args = [self.executable_name,
                    '"' + self.connection.settings_dict['NAME'] + '"'] # JA HACK 
            if os.name == 'nt':
                sys.exit(os.system(" ".join(args)))
            else:
                os.execvp(self.executable_name, args)

( Windows - os.name 'nt').

+2

Source: https://habr.com/ru/post/1771021/


All Articles