Comment failed to work after deployment? #1382
Replies: 3 comments 4 replies
-
Hi, I'm not sure if there is a question there. I don't know what you are trying to do, but generally you would not run stamp to change the revision, but you would run upgrade. If you have an existing application running locally maybe you can take the db file (since you are using sqlite) and use that in the hosting? |
Beta Was this translation helpful? Give feedback.
-
You mean I can replace the current database file |
Beta Was this translation helpful? Give feedback.
-
I tried again and still met the same error |
Beta Was this translation helpful? Give feedback.
-
I have tried to deploy my personal blog on a host-free webiste called PythonAnywhere, But after deployment, I found that I can not comment and visit file html tag. I am not familiar with
alembic
, thus I come to community for help.Here is what effort I made:
At first, the question is that I can not log in after deployment on PythonAnywhere. I used
flask db migrate
on backend:I guess the problem is current migration edition is not consistent with head mirgation edition, so i did this although i don't know why two different editions happened:
I then use
flask db stamp heads
to mark the migration edition:And check it:
then run:
but it seems still not work, so i run command again:
It works and i can log in now, but unexpected things occurs: all previous user data is gone , so i registered again, but i find that i can't not comment and the error is same as the above "The administrator has been notified. Sorry for the inconvenience!" Also, i clicked the file tag, the error was same. i do not know why.
I used
cd migrations/versions
andls
to list all subfile:Compare the above with my local file, I found two extra file
e6990a7ae19f_.py
and9d026987d6f2_.py
, and the latter is the last version which produced logging problems, the former is now database stand on.I guess the problem lies in the last generated migrations file:
e6990a7ae19f_.py
, so Icat
it.Also, I checked history:
Beta Was this translation helpful? Give feedback.
All reactions