-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ Thumbs.db | |
*venv* | ||
|
||
.flaskenv | ||
mail_config.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from flask import render_template | ||
from app import app, db | ||
|
||
|
||
@app.errorhandler(404) | ||
def not_found_error(error): | ||
return render_template("404.html"), 404 | ||
|
||
|
||
@app.errorhandler(500) | ||
def internal_error(error): | ||
db.session.rollback() | ||
return render_template("500.html"), 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h1>File Not Found</h1> | ||
<p><a href="{{ url_for('index') }}">Back</a></p> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h1>An unexpected error has occurred</h1> | ||
<p>The administrator has been notified. Sorry for the inconvenience!</p> | ||
<p><a href="{{ url_for('index') }}">Back</a></p> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
2023-05-03 14:42:48,422 INFO: Microblog startup [in /home/lubianat/Documents/random/flask_tutorial/app/__init__.py:50] | ||
2023-05-03 14:43:04,661 ERROR: Exception on /edit_profile [POST] [in /home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask/app.py:1744] | ||
Traceback (most recent call last): | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context | ||
self.dialect.do_execute( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 748, in do_execute | ||
cursor.execute(statement, parameters) | ||
sqlite3.IntegrityError: UNIQUE constraint failed: user.username | ||
|
||
The above exception was the direct cause of the following exception: | ||
|
||
Traceback (most recent call last): | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app | ||
response = self.full_dispatch_request() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request | ||
rv = self.handle_user_exception(e) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request | ||
rv = self.dispatch_request() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request | ||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/flask_login/utils.py", line 290, in decorated_view | ||
return current_app.ensure_sync(func)(*args, **kwargs) | ||
File "/home/lubianat/Documents/random/flask_tutorial/app/routes.py", line 27, in edit_profile | ||
db.session.commit() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/scoping.py", line 553, in commit | ||
return self._proxied.commit() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1903, in commit | ||
trans.commit(_to_root=True) | ||
File "<string>", line 2, in commit | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go | ||
ret_value = fn(self, *arg, **kw) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1218, in commit | ||
self._prepare_impl() | ||
File "<string>", line 2, in _prepare_impl | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go | ||
ret_value = fn(self, *arg, **kw) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1193, in _prepare_impl | ||
self.session.flush() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 4155, in flush | ||
self._flush(objects) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 4292, in _flush | ||
transaction.rollback(_capture_exception=True) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__ | ||
raise exc_value.with_traceback(exc_tb) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 4252, in _flush | ||
flush_context.execute() | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 467, in execute | ||
rec.execute(self) | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 644, in execute | ||
util.preloaded.orm_persistence.save_obj( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 85, in save_obj | ||
_emit_update_statements( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 890, in _emit_update_statements | ||
c = connection.execute( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1414, in execute | ||
return meth( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 486, in _execute_on_connection | ||
return connection._execute_clauseelement( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement | ||
ret = self._execute_context( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1842, in _execute_context | ||
return self._exec_single_context( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1983, in _exec_single_context | ||
self._handle_dbapi_exception( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2326, in _handle_dbapi_exception | ||
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context | ||
self.dialect.do_execute( | ||
File "/home/lubianat/Documents/random/flask_tutorial/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 748, in do_execute | ||
cursor.execute(statement, parameters) | ||
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: user.username | ||
[SQL: UPDATE user SET username=?, about_me=? WHERE user.id = ?] | ||
[parameters: ('susan', 'a', 2)] | ||
(Background on this error at: https://sqlalche.me/e/20/gkpj) | ||
2023-05-03 14:45:41,536 INFO: Microblog startup [in /home/lubianat/Documents/random/flask_tutorial/app/__init__.py:50] |