Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
90cccc20
Commit
90cccc20
authored
Aug 20, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据库连接配置防止时间过长而断开
parent
1f0a43a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
app.py
DAPlatform/app.py
+2
-2
model.py
DAPlatform/dao/model.py
+0
-1
user.py
DAPlatform/views/user.py
+16
-0
No files found.
DAPlatform/app.py
View file @
90cccc20
...
@@ -11,7 +11,6 @@ from views.imageAnnotation import image
...
@@ -11,7 +11,6 @@ from views.imageAnnotation import image
from
config.config
import
DevelopmentConfig
from
config.config
import
DevelopmentConfig
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
CORS
(
app
)
CORS
(
app
)
app
.
config
.
from_object
(
DevelopmentConfig
)
app
.
config
.
from_object
(
DevelopmentConfig
)
...
@@ -32,4 +31,4 @@ if __name__ == '__main__':
...
@@ -32,4 +31,4 @@ if __name__ == '__main__':
@app.route
(
'/'
)
@app.route
(
'/'
)
def
hello
(
name
=
None
):
def
hello
(
name
=
None
):
return
render_template
(
'index.html'
,
name
=
name
)
return
render_template
(
'index.html'
,
name
=
name
)
\ No newline at end of file
DAPlatform/dao/model.py
View file @
90cccc20
...
@@ -7,4 +7,3 @@ mysql = MySQLDatabase(
...
@@ -7,4 +7,3 @@ mysql = MySQLDatabase(
passwd
=
'123456'
,
passwd
=
'123456'
,
charset
=
'utf8'
charset
=
'utf8'
)
)
mysql
.
connect
()
DAPlatform/views/user.py
View file @
90cccc20
...
@@ -2,10 +2,24 @@ import json
...
@@ -2,10 +2,24 @@ import json
from
flask
import
Blueprint
from
flask
import
Blueprint
from
flask
import
request
from
flask
import
request
from
dao
import
User
from
dao
import
User
from
dao.model
import
mysql
user
=
Blueprint
(
"user"
,
__name__
,
url_prefix
=
"/api/user"
)
user
=
Blueprint
(
"user"
,
__name__
,
url_prefix
=
"/api/user"
)
@user.before_request
def
db_connect
():
print
(
"!"
)
mysql
.
connect
()
@user.after_request
def
db_close
(
response
):
if
not
mysql
.
is_closed
():
mysql
.
close
()
return
response
@user.route
(
"/signup"
,
methods
=
[
"Post"
])
@user.route
(
"/signup"
,
methods
=
[
"Post"
])
def
signup
():
def
signup
():
# print("signup")
# print("signup")
...
@@ -42,3 +56,5 @@ def personnal_information():
...
@@ -42,3 +56,5 @@ def personnal_information():
'data'
:
ret
.
data
'data'
:
ret
.
data
}
}
return
json
.
dumps
(
res
)
return
json
.
dumps
(
res
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment