New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create db #18
Comments
I use db.create_all() via python manage.py shell |
Using db.create_all() is not the correct solution, when you do that you are bypassing the database migration support that is built into the application. The equivalent to db.create_all() when you use Flask-Migrate is this command:
Did you try that? |
Yes, I tried that:
After that I tried to add some text to form and submit but I have this error message:
|
The The correct sequence is:
Let me know if this does it. |
This sequnce doesn't work, I tried. After db.create_all() via manage.py shell - application work correct. |
@karl-kallavus I didn't checkout 8a particularly but |
Guys, no, stop. Forget about The sequence I gave you works. Do not issue Give that a try, and if that doesn't work, please paste the output of your terminal. PS: I'm in Texas right now, so it was 9am when I replied. Unfortunately my brain & body are still in West Coast time, so it felt like 7am to me ;-) |
I just mentioned |
In flasky/migrations/versions I can see only initial migration, but you added new column to db (here and in next sections of chapter 8).
|
Sorry. I hurried. 8c checkout has all needed migrations. |
@kodemi ,thanks |
I ran into the same error posted by karl-kallavus. Miguel's solution (upgrade db, then run server) worked for me. Thanks Miguel! |
I have same problem as @karl-kallavus. (I used ubuntu and python 3.4, also windows 7 and python 3.4) Then deactivated venv. created new venv, activated, installed all from requirements.txt $ python manage.py db upgrade And result is the same. I tried it on windows and linux (on different machines) Also tried deleting migrations/ and *.sqlite. UpdateTried checkout 8c. |
@Quirel just to make sure other people seeing this don't get confused, this line:
should be changed to:
|
@miguelgrinberg fixed, thank you. (It was about 4:00 am, when I wrote comment) updateI've found my mistake. P.S. @miguelgrinberg, I think that when I've cloned your repo and had the same mistake, I just started server from my repo (forget to change dir or smth else.. as I said it was about 4 am.) |
Thx, and it helps me very much. I was confused about this for several hours. |
Hello, @miguelgrinberg File "migrations/env.py", line 87, in <module>
run_migrations_online()
File "migrations/env.py", line 76, in run_migrations_online
**current_app.extensions['migrate'].configure_args)
AttributeError: '_MigrateConfig' object has no attribute 'configure_args' |
@Morriaty-The-Murderer My guess is that the version of Flask-Migrate you have in your requirements.txt file does not match the version that is in your local virtualenv. Can you check? |
@miguelgrinberg |
python manage.py db migrate |
I have a such Error. I tried to upgrade my DB by your instructions. But I does not upgrade my db its just run like as
Please, check the image I attached here. |
Dear Miguel,
thanks you for your book,
I have some troubles, I am on chapter 8a.
I can't create a db, db init, db downgrade etc - it's ok,
but when I start a server and add some text to form - I have this error:
The text was updated successfully, but these errors were encountered: