简体   繁体   中英

Django Wagtail Pages -1

I flushed my database to reset my website in my Django Wagtail project and now I cannot add any page to my Wagtail website.
Here you can find the screenshot. There is no option to add pages. Any solutions? Or do I have to create a new project and reset everything?

页面显示-1,并且没有添加页面的选项

You don't have to create a whole new project, but I'd suggest deleting and recreating the database - the initial migrations to set up the Wagtail database tables include a few essential records (such as a root node for the page tree), and these will have been deleted when you flushed the database.

If you're running sqlite (the default for a new project), there'll be a file in the project root named db.sqlite3 , or with a name of the form [name-of-project].db - delete this file, then re-run ./manage.py migrate .

If you're using PostgreSQL, run dropdb name-of-project then createdb name-of-project (you might also need an option like -U postgres depending on how your permissions are set up), then ./manage.py migrate .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM