fix flask_script and flask_migrate deps.
This commit is contained in:
parent
b2b97d1e46
commit
8c6a0bb55f
22
fhost.py
22
fhost.py
@ -21,7 +21,8 @@
|
||||
|
||||
from flask import Flask, abort, make_response, redirect, request, send_from_directory, url_for, Response, render_template
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
from flask_script import Manager
|
||||
from flask_migrate import Migrate, MigrateCommand
|
||||
from sqlalchemy import and_, or_
|
||||
from jinja2.exceptions import *
|
||||
from jinja2 import ChoiceLoader, FileSystemLoader
|
||||
@ -105,6 +106,9 @@ Please install python-magic.""")
|
||||
db = SQLAlchemy(app)
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
manager = Manager(app)
|
||||
manager.add_command("db", MigrateCommand)
|
||||
|
||||
class URL(db.Model):
|
||||
id = db.Column(db.Integer, primary_key = True)
|
||||
url = db.Column(db.UnicodeText, unique = True)
|
||||
@ -312,6 +316,9 @@ class File(db.Model):
|
||||
db.session.commit()
|
||||
return f, isnew
|
||||
|
||||
###
|
||||
def getpath(fn):
|
||||
return os.path.join(app.config["FHOST_STORAGE_PATH"], fn)
|
||||
|
||||
class UrlEncoder(object):
|
||||
def __init__(self,alphabet, min_length):
|
||||
@ -678,17 +685,6 @@ Please set VSCAN_SOCKET.""")
|
||||
|
||||
###
|
||||
# enable old manager cmd
|
||||
|
||||
def getpath(fn):
|
||||
return os.path.join(app.config["FHOST_STORAGE_PATH"], fn)
|
||||
|
||||
|
||||
from flask_script import Manager
|
||||
from flask_migrate import Migrate, MigrateCommand
|
||||
|
||||
manager = Manager(app)
|
||||
manager.add_command("db", MigrateCommand)
|
||||
|
||||
@manager.command
|
||||
def permadelete(name):
|
||||
id = su.debase(name)
|
||||
@ -741,4 +737,4 @@ def deladdr(a):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
manager.run()
|
||||
manager.run()
|
||||
|
@ -1,5 +1,6 @@
|
||||
click
|
||||
Flask_Migrate
|
||||
flask-migrate==2.0.0
|
||||
flask-script==2.0.5
|
||||
validators
|
||||
alembic
|
||||
requests
|
||||
|
Loading…
Reference in New Issue
Block a user