mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-20 21:11:26 +01:00
Create utils folder
This commit is contained in:
parent
038ef5b739
commit
904e09f0dd
@ -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
|
FLASK_CONFIG=../config.cfg celery -A app.tasks.celery worker
|
||||||
|
|
||||||
# if sqlite
|
# 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
|
rm db.sqlite && python setup.py -t && FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py flask db stamp head
|
||||||
|
|
||||||
# Create migration
|
# Create migration
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# 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:
|
if not "FLASK_CONFIG" in os.environ:
|
||||||
os.environ["FLASK_CONFIG"] = "../config.cfg"
|
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")
|
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
|
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.models import *
|
||||||
from app.utils import make_flask_user_password
|
from app.utils import make_flask_user_password
|
||||||
|
|
Loading…
Reference in New Issue
Block a user