diff --git a/blog/models.py b/blog/models.py index c03ca71e..ab3b8441 100644 --- a/blog/models.py +++ b/blog/models.py @@ -134,7 +134,7 @@ def morph(self): class SteemitArticle: def __init__(self, article, url): res = requests.get(url) - html = BeautifulSoup(res.text) + html = BeautifulSoup(res.text, "lxml") uri = re.match('https://steemit.com/.+/@(.*)', url).groups()[0] content = html.body.find('script', attrs={'type': 'application/json'}).text diff --git a/core/views.py b/core/views.py index 6f7ac95f..a1d6c697 100644 --- a/core/views.py +++ b/core/views.py @@ -17,12 +17,12 @@ def home(): @app.errorhandler(NotFound) def error_404(e): - return render_template('error.html', code=404) + return render_template('error.html', code=404), 404 @app.errorhandler(Gone) def error_410(e): - return render_template('error.html', code=410) + return render_template('error.html', code=410), 410 @app.errorhandler(InternalServerError) def error_500(e): - return render_template('error.html', code=500) + return render_template('error.html', code=500), 500 diff --git a/requirements.txt b/requirements.txt index ed9f78f3..fefacef2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ Flask==1.1.1 Flask-Login==0.4.0 langdetect==1.0.7 Markdown==2.6.11 -mongoengine==0.15.3 +mongoengine==0.19.1 Pillow==6.2.1 requests==2.22.0 diff --git a/settings.test.py b/settings.test.py index f6344917..92c8d826 100644 --- a/settings.test.py +++ b/settings.test.py @@ -8,7 +8,7 @@ DATABASE = { 'db': 'neomad_test', 'username': 'root', - 'host': 'localhost' + 'host': 'localhost', 'password': '', 'port': int(os.environ.get('DB_PORT', 27017)) }