-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
I met a problem in Chapter Test Web Application,new test code of git tag 15b. #59
Comments
After I add |
Can you give me the output of |
Here it is |
Are you running the original code from this repository, or is this your own application? The virtualenv has a lot of packages that are not used by Flasky. |
Thanks for your time.I had reused virtualenv created by last project, maybe different version of flask cause this problem.
in localhost env it works perfect.But when I run it with
I found SQLAlchemy cannot auto commit .I logged sqlalchemy.engine to file I find it always call Rollback after a SELECT perform and couldn't found INSERT perform without a commit() transfer .If I added
after
it worked fine. |
Did you get any errors regarding this commit failure? |
No errors ,it also flash 'You have confirmed your account. Thanks!'
after every sql it log COMMIT.Everything goes fine.
after every sql it log ROLLBACK. I thought in gunicorn SQLALCHEMY_COMMIT_ON_TEARDOWN=True not worked. |
What's your database URL for the working and not working commits? |
Same as your demo project,Here is log:SQLALCHEMY_DATABASE_URI:sqlite:////Users/walker/Documents/python/github/flasky/data.sqlite |
Here is a part of sqlalchemy's log,only start server with gunicorn will cause this. |
@miguelgrinberg : I also ran into the same problem, and I used @alexli0707 's fix. It affected both my
at the end of my My pip freeze is: Flask-Bootstrap==3.0.3.1
Flask-HTTPAuth==2.2.0
Flask-Login==0.3.1
Flask-Mail==0.9.0
Flask-Migrate==1.1.0
Flask-Moment==0.2.1
Flask-PageDown==0.1.4
Flask-SQLAlchemy==1.0
Flask-Script==0.6.6
Flask-WTF==0.9.4
ForgeryPy==0.1
Jinja2==2.7.1
Mako==0.9.1
Markdown==2.3.1
MarkupSafe==0.18
Pygments==1.6
SQLAlchemy==0.9.9
WTForms==1.0.5
Werkzeug==0.10.4
alembic==0.6.2
argparse==1.2.1
bleach==1.4
blinker==1.3
colorama==0.2.7
coverage==3.7.1
html5lib==1.0b3
httpie==0.7.2
itsdangerous==0.23
requests==2.1.0
selenium==2.45.0
six==1.4.1
wsgiref==0.1.2 |
This is a Flask bug that has been fixed already, but won't be available until a new release is made. See the PR for the issue. |
Thanks for the information, @miguelgrinberg! |
Thank you for sharing your knowledge,I have a nice flask tutorial with your book. But I got a problem when I do the test of test_client.py. I got "RuntimeError: Application was not able to create a URL adapter for request independent URL generation. You might be able to fix this by setting the SERVER_NAME config variable." when goes in url_for('main.index). After I added SERVER_NAME='http://localhost:5000' to TestingConfig I got Page not found error.Can you help me ?tks
The text was updated successfully, but these errors were encountered: