Finalize migration tool.
Retrieve comments by GET and POST
This commit is contained in:
parent
4c4ee442d3
commit
612fb85fa3
5 changed files with 53 additions and 27 deletions
|
|
@ -1,15 +1,13 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
import hashlib
|
||||
import config
|
||||
import functools
|
||||
from config import DB_URL
|
||||
from playhouse.db_url import connect
|
||||
|
||||
|
||||
def get_db():
|
||||
return connect(DB_URL)
|
||||
return connect(config.DB_URL)
|
||||
|
||||
|
||||
def provide_db(func):
|
||||
|
|
@ -21,12 +19,6 @@ def provide_db(func):
|
|||
return new_function
|
||||
|
||||
|
||||
def hash(value):
|
||||
string = '%s%s' % (value, config.SALT)
|
||||
dk = hashlib.sha256(string.encode())
|
||||
return dk.hexdigest()
|
||||
|
||||
|
||||
@provide_db
|
||||
def setup(db):
|
||||
from app.models.site import Site
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue