Create utils folder

This commit is contained in:
rubenwardy 2019-11-12 22:36:30 +00:00
parent 038ef5b739
commit 904e09f0dd
5 changed files with 7 additions and 2 deletions

View File

@ -13,7 +13,7 @@ Note: you should first read one of the guides on the [Github repo wiki](https://
FLASK_CONFIG=../config.cfg celery -A app.tasks.celery worker
# if sqlite
python setup.py -t
python utils/setup.py -t
rm db.sqlite && python setup.py -t && FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db stamp head
# Create migration

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import os, sys, datetime
import os, sys, datetime, inspect
if not "FLASK_CONFIG" in os.environ:
os.environ["FLASK_CONFIG"] = "../config.cfg"
@ -24,6 +24,11 @@ delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
create_db = not (len(sys.argv) >= 2 and sys.argv[1].strip() == "-o")
test_data = len(sys.argv) >= 2 and sys.argv[1].strip() == "-t" or not create_db
# Allow finding the `app` module
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
from app.models import *
from app.utils import make_flask_user_password