Only the sqlmigrate and sqlflush commands can be used when an app has migrations., sqlmigratesqlflush

Source: Internet
Author: User
Tags lenovo

Only the sqlmigrate and sqlflush commands can be used when an app has migrations., sqlmigratesqlflush

samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$ python manage.py sqlall getsshSystem check identified some issues:WARNINGS:?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.CommandError: App 'getssh' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations.samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$ mv migrations/ migrations.back/
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$
Samcao @ samcao-Lenovo-IdeaPad-Y470 :~ /Caodjango/caossh $ python manage. py SQL getsshSystem check identified some issues: WARNINGS :?: (Listen 8.w001) The standalone TEMPLATE _ * settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. you must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.BEGIN; create table 'getssh _ publisher '('id' integer AUTO_INCREMENT not null primary key, 'name' varchar (30) not null, 'address' varchar (50) not null, 'city' varchar (60) NOT NUL L, 'state _ province 'varchar (30) not null, 'country' varchar (50) not null, 'website' varchar (200) not null ); create table 'getssh _ author' ('id' integer AUTO_INCREMENT not null primary key, 'First _ name' varchar (30) not null, 'last _ name' varchar (40) not null, 'email 'varchar (254) not null); create table 'getssh _ book_authors '('id' integer AUTO_INCREMENT not null primary key, 'book _ id' integer NOT NUL L, 'author _ id' integer not null, UNIQUE ('book _ id', 'author _ id ')); alter table 'getssh _ book_authors 'add constraint 'author _ id_refs_id_20f26b36' foreign key ('author _ id') REFERENCES 'getssh _ author '('id '); create table 'getssh _ Book' ('id' integer AUTO_INCREMENT not null primary key, 'title' varchar (100) not null, 'her her _ id' integer not null, 'publication _ date' date not null); alter table 'getssh _ Book 'add constraint' her _ id_refs_id_99765d4d 'eign KEY ('her her _ id') REFERENCES 'getssh _ her' ('id '); alter table 'getssh _ book_authors 'add constraint 'book _ id_refs_id_2cfb1c02' foreign key ('book _ id') REFERENCES 'getssh _ Book' ('id'); COMMIT; samcao @ samcao-Lenovo-IdeaPad-Y470 :~ /Caodjango/caossh $View Code

The prompt is Only the sqlmigrate and sqlflush commands can be used when an app has migrations.

Delete the migrations folder under the apps directory, or rename it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.