From 06f896a33a1f9cefc9e0e3e496a603056b577a50 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Thu, 10 Aug 2023 15:22:30 +0800 Subject: [PATCH] Update .gitignore --- .gitignore | 2 ++ app/Article.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f58d558..c83d46b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,14 @@ venv/ app/__init__.py app/__pycache__/ +app/.DS_Store app/sqlite_commands.py app/static/usr/*.jpg app/static/img/ app/static/frequency/frequency_*.pickle app/static/frequency/frequency.p app/wordfreqapp.db +app/db/wordfreqapp.db app/static/donate-the-author.jpg app/static/donate-the-author-hidden.jpg app/model/__pycache__/ \ No newline at end of file diff --git a/app/Article.py b/app/Article.py index b24e448..c7e87d3 100644 --- a/app/Article.py +++ b/app/Article.py @@ -10,12 +10,12 @@ from flask import Flask, request, redirect, render_template, url_for, session, a from difficulty import get_difficulty_level_for_user, text_difficulty_level, user_difficulty_level -path_prefix = '/var/www/wordfreq/wordfreq/' -path_prefix = './db/' # comment this line in deployment +path_prefix = './' +db_path_prefix = './db/' # comment this line in deployment def total_number_of_essays(): - rq = RecordQuery(path_prefix + 'wordfreqapp.db') + rq = RecordQuery(db_path_prefix + 'wordfreqapp.db') rq.instructions("SELECT * FROM article") rq.do() result = rq.get_results() @@ -33,7 +33,7 @@ def get_article_body(s): def get_today_article(user_word_list, visited_articles): - rq = RecordQuery(path_prefix + 'wordfreqapp.db') + rq = RecordQuery(db_path_prefix + 'wordfreqapp.db') if visited_articles is None: visited_articles = { "index" : 0, # 为 article_ids 的索引