Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Django Unknown Command 'SQL'

Tags:

python

sql

django

I'm following this tutorial http://www.sitepoint.com/building-simple-rest-api-mobile-applications/

I'm trying to run SQL by

$ python manage.py sql fishes

However it says

Unknown Command: 'sql'

If I type

$ python manage.py help

I get this, and SQL doesn't appear in the list.

Available subcommands:

[auth]
    changepassword
    createsuperuser

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver

[sessions]
    clearsessions

[staticfiles]
    collectstatic
    findstatic
    runserver
like image 774
TheRapture87 Avatar asked Dec 13 '25 02:12

TheRapture87


1 Answers

Unfortunately that doesn't exist any more, however the command manage.py dbshell does.

Generally speaking however, you should try to use models, with load_data etc to preserve the data integrity (as validations etc may happen in models rather then relying on underlying data bits). Or write management commands for any clean up tasks.

like image 173
Jmons Avatar answered Dec 15 '25 16:12

Jmons



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!