make it better
This commit is contained in:
commit
e52c18a09c
|
@ -0,0 +1,16 @@
|
|||
# Files to ignore when adding and committing files to a repository
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# virtualenv
|
||||
.venv/
|
||||
venv/
|
||||
|
||||
# PyCharm
|
||||
.idea
|
||||
|
||||
# VS Code
|
||||
.vscode
|
|
@ -0,0 +1,3 @@
|
|||
# Forms in Flask
|
||||
|
||||
In this Flask app we will demonstrate the basics of processing forms and also using a form library called WT Forms.
|
|
@ -0,0 +1,13 @@
|
|||
from flask import Flask
|
||||
|
||||
# Config Values
|
||||
# location where file uploads will be stored
|
||||
UPLOAD_FOLDER = './app/static/uploads'
|
||||
# needed for session security, the flash() method in this case stores the message
|
||||
# in a session
|
||||
SECRET_KEY = 'Sup3r$3cretkey'
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(__name__)
|
||||
|
||||
from app import views
|
|
@ -0,0 +1,30 @@
|
|||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileField, FileRequired, FileAllowed
|
||||
from wtforms import StringField, DecimalField
|
||||
from wtforms.validators import DataRequired, Email
|
||||
|
||||
|
||||
class MyForm(FlaskForm):
|
||||
firstname = StringField('First Name', validators=[DataRequired()])
|
||||
lastname = StringField('Last Name', validators=[DataRequired()])
|
||||
email = StringField('Email', validators=[DataRequired(), Email()])
|
||||
|
||||
|
||||
class curieForm(FlaskForm):
|
||||
ligand = FileField('Ligand', validators=[
|
||||
FileRequired(),
|
||||
FileAllowed(['pdbqt', 'PDBQT only!'])
|
||||
])
|
||||
target = FileField('Receptor / Target', validators=[
|
||||
FileRequired(),
|
||||
FileAllowed(['pdbqt', 'PDBQT only!'])
|
||||
])
|
||||
description = StringField('Description',default="Curie Web Task")
|
||||
|
||||
size_x = DecimalField('Size X',default=25.0)
|
||||
size_y = DecimalField('Size Y',default=25.0)
|
||||
size_z = DecimalField('Size Z',default=25.0)
|
||||
|
||||
center_x = DecimalField('Center X',default=0)
|
||||
center_y = DecimalField('Center Y',default=0)
|
||||
center_z = DecimalField('Center Z',default=0)
|
|
@ -0,0 +1,21 @@
|
|||
:root {
|
||||
|
||||
}
|
||||
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin-bottom: 60px; /* Margin bottom by footer height */
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
REMARK Name = 338719
|
||||
REMARK 2 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_2 and C_11
|
||||
REMARK 2 A between atoms: C_7 and C_14
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 CL UNL 1 2.000 -0.825 0.000 0.00 0.00 +0.000 Cl
|
||||
ATOM 2 O UNL 1 3.732 2.175 0.000 0.00 0.00 +0.000 OA
|
||||
ATOM 3 O UNL 1 3.732 -1.825 0.000 0.00 0.00 +0.000 OA
|
||||
ATOM 4 C UNL 1 4.598 0.675 0.000 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 4.598 -0.325 0.000 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 2.866 0.675 0.000 0.00 0.00 +0.000 C
|
||||
ATOM 7 C UNL 1 3.732 1.175 0.000 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 3.732 -0.825 0.000 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 2.866 -0.325 0.000 0.00 0.00 +0.000 C
|
||||
ATOM 10 C UNL 1 5.492 -0.859 0.000 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 5.492 1.210 0.000 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 6.398 -0.345 0.000 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 2.000 1.175 0.000 0.00 0.00 +0.000 C
|
||||
ATOM 14 C UNL 1 6.398 0.696 0.000 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 15
|
||||
ATOM 15 O UNL 1 5.480 -1.859 0.000 0.00 0.00 +0.000 OA
|
||||
ATOM 16 H UNL 1 6.014 -2.175 0.000 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 15
|
||||
TORSDOF 1
|
|
@ -0,0 +1,414 @@
|
|||
MODEL 1
|
||||
REMARK VINA RESULT: -7.4 0.000 0.000
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -10.956 18.153 64.952 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -9.566 16.383 68.259 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -10.178 16.272 66.643 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -10.526 16.715 65.816 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.343 18.264 66.569 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -9.995 17.821 67.395 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -10.608 17.711 65.779 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -9.913 16.825 67.432 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -10.087 15.236 66.696 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -10.806 16.151 64.986 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -10.361 14.653 65.878 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -10.723 15.114 65.017 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -10.434 19.300 66.516 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -9.715 18.384 68.226 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -10.159 19.883 67.334 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -9.798 19.422 68.195 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -11.152 16.605 64.165 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -11.758 16.582 64.030 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -10.783 19.732 65.684 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -11.330 20.023 65.693 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -10.278 13.657 65.919 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -9.491 13.204 65.498 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -9.096 13.530 65.149 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 2
|
||||
REMARK VINA RESULT: -7.4 1.459 2.074
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -11.038 17.179 64.704 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -10.093 14.217 67.221 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -10.911 14.774 65.799 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -11.147 15.514 65.170 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.220 16.622 66.125 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -9.983 15.881 66.754 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -10.801 16.438 65.333 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -10.329 14.957 66.591 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -11.263 13.806 65.643 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -11.752 15.338 64.341 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -11.870 13.607 64.820 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -12.116 14.378 64.165 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -9.867 17.589 66.282 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -9.378 16.057 67.584 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -9.260 17.788 67.105 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -9.014 17.017 67.760 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -11.982 16.086 63.718 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -11.942 16.001 63.105 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -10.110 18.322 65.646 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -9.793 18.855 65.653 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -12.214 12.681 64.660 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -13.192 12.490 64.744 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -13.520 12.748 65.203 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 3
|
||||
REMARK VINA RESULT: -7.1 0.944 3.863
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -11.053 17.886 64.882 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -9.289 15.847 67.837 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -9.781 17.355 67.140 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -10.222 17.865 66.402 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.561 16.379 65.579 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -10.120 15.869 66.317 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -10.612 17.377 65.621 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -9.730 16.357 67.098 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -9.369 17.849 67.960 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -10.282 18.904 66.432 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -9.419 18.888 68.011 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -9.878 19.419 67.242 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -10.972 15.884 64.759 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -10.059 14.829 66.288 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -10.922 14.845 64.709 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -10.463 14.314 65.478 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -10.725 19.403 65.688 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -10.861 19.112 65.157 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -11.410 16.404 64.027 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -12.014 16.542 64.063 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -9.027 19.372 68.794 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -8.034 19.455 68.884 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -7.742 19.181 69.357 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 4
|
||||
REMARK VINA RESULT: -7.0 1.458 4.437
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -11.835 15.582 63.966 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -10.198 13.689 67.086 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -10.474 15.147 66.193 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -10.883 15.620 65.413 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -11.558 14.124 64.859 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -11.149 13.651 65.639 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -11.425 15.109 64.746 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -10.607 14.163 66.306 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -9.907 15.666 66.896 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -10.754 16.645 65.282 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -9.764 16.692 66.784 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -10.190 17.185 65.972 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -12.125 13.605 64.157 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -11.279 12.626 65.771 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -12.268 12.579 64.269 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -11.842 12.086 65.081 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -11.167 17.108 64.498 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -11.374 16.776 64.016 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -12.530 14.088 63.381 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -12.559 13.813 62.825 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -9.221 17.200 67.453 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -9.673 17.658 68.219 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -9.996 18.178 68.123 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 5
|
||||
REMARK VINA RESULT: -6.9 2.672 3.778
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -11.295 15.819 65.633 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -11.967 12.146 67.067 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -11.897 13.245 65.730 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -11.728 14.163 65.371 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -11.365 14.721 66.970 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -11.534 13.803 67.329 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -11.463 14.901 65.992 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -11.799 13.065 66.709 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -12.174 12.465 65.096 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -11.826 14.365 64.355 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -12.277 12.646 64.076 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -12.102 13.602 63.702 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -11.088 15.499 67.604 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -11.436 13.599 68.346 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -10.985 15.319 68.625 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -11.160 14.363 68.998 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -11.656 15.287 64.007 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -11.290 15.675 64.325 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -10.923 16.414 67.235 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -11.399 16.800 67.139 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -12.543 11.905 63.459 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -11.969 11.089 63.381 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -11.547 11.049 62.928 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 6
|
||||
REMARK VINA RESULT: -6.8 1.985 3.555
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -11.564 13.884 68.019 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -10.718 15.881 64.658 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -11.315 14.460 65.449 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -11.526 13.961 66.289 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.968 15.305 67.228 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -10.756 15.804 66.388 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -11.353 14.383 67.179 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -10.930 15.382 65.498 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -11.490 14.034 64.514 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -11.927 13.000 66.253 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -11.890 13.074 64.455 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -12.110 12.554 65.330 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -10.793 15.732 68.162 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -10.355 16.765 66.423 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -10.392 16.691 68.221 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -10.172 17.211 67.346 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -12.135 12.510 67.099 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -12.191 12.823 67.632 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -11.008 15.223 68.995 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -11.447 15.432 69.380 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -12.062 12.655 63.563 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -12.927 12.182 63.392 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -12.967 11.569 63.477 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 7
|
||||
REMARK VINA RESULT: -6.8 1.904 4.994
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -12.181 13.358 67.639 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -9.929 15.645 65.252 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -10.777 15.414 66.745 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -11.340 14.842 67.341 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -11.333 13.588 66.147 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -10.770 14.160 65.550 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -11.618 13.929 67.042 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -10.492 15.073 65.849 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -10.480 16.367 67.042 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -11.644 15.184 68.277 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -10.773 16.729 67.974 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -11.359 16.134 68.595 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -11.630 12.636 65.849 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -10.465 13.819 64.614 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -11.336 12.274 64.917 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -10.750 12.869 64.296 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -12.207 14.604 68.865 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -12.800 14.753 68.971 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -12.193 12.073 66.454 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -12.017 11.979 67.041 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -10.493 17.643 68.269 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -10.819 18.449 67.775 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -10.418 18.802 67.459 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 8
|
||||
REMARK VINA RESULT: -6.7 2.738 5.186
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -12.362 12.151 66.385 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -8.961 14.214 66.799 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -10.542 14.051 66.111 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -11.392 13.536 66.008 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.781 12.314 67.073 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -9.931 12.830 67.176 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -11.512 12.667 66.488 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -9.811 13.698 66.695 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -10.402 14.958 65.617 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -12.162 13.891 65.403 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -11.159 15.332 65.007 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -12.045 14.795 64.899 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -10.920 11.408 67.567 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -9.160 12.475 67.781 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -10.163 11.034 68.177 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -9.277 11.571 68.285 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -13.008 13.367 65.307 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -13.394 13.485 64.835 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -11.774 10.901 67.456 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -12.144 10.806 67.946 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -11.036 16.201 64.528 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -11.636 16.441 63.765 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -12.224 16.607 63.873 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
||||
MODEL 9
|
||||
REMARK VINA RESULT: -6.7 3.569 5.637
|
||||
REMARK Name = 10207
|
||||
REMARK 4 active torsions:
|
||||
REMARK status: ('A' for Active; 'I' for Inactive)
|
||||
REMARK 1 A between atoms: O_1 and C_13
|
||||
REMARK 2 A between atoms: O_4 and C_16
|
||||
REMARK 3 A between atoms: O_5 and C_18
|
||||
REMARK 4 A between atoms: C_14 and C_18
|
||||
REMARK x y z vdW Elec q Type
|
||||
REMARK _______ _______ _______ _____ _____ ______ ____
|
||||
ROOT
|
||||
ATOM 1 O UNL 1 -9.479 12.463 65.968 0.00 0.00 +0.000 OA
|
||||
ATOM 2 O UNL 1 -13.191 13.918 65.653 0.00 0.00 +0.000 OA
|
||||
ATOM 3 C UNL 1 -11.717 13.748 66.547 0.00 0.00 +0.000 A
|
||||
ATOM 4 C UNL 1 -10.789 13.384 66.626 0.00 0.00 +0.000 A
|
||||
ATOM 5 C UNL 1 -10.952 12.633 65.074 0.00 0.00 +0.000 A
|
||||
ATOM 6 C UNL 1 -11.880 12.996 64.995 0.00 0.00 +0.000 A
|
||||
ATOM 7 C UNL 1 -10.407 12.827 65.889 0.00 0.00 +0.000 C
|
||||
ATOM 8 C UNL 1 -12.263 13.554 65.732 0.00 0.00 +0.000 C
|
||||
ATOM 9 C UNL 1 -12.130 14.331 67.306 0.00 0.00 +0.000 A
|
||||
ATOM 10 C UNL 1 -10.210 13.578 67.469 0.00 0.00 +0.000 A
|
||||
ATOM 11 C UNL 1 -11.568 14.537 68.158 0.00 0.00 +0.000 A
|
||||
ATOM 12 C UNL 1 -10.601 14.158 68.240 0.00 0.00 +0.000 A
|
||||
ATOM 13 C UNL 1 -10.541 12.050 64.315 0.00 0.00 +0.000 A
|
||||
ATOM 14 C UNL 1 -12.461 12.803 64.152 0.00 0.00 +0.000 A
|
||||
ATOM 15 C UNL 1 -11.103 11.844 63.463 0.00 0.00 +0.000 A
|
||||
ATOM 16 C UNL 1 -12.069 12.223 63.381 0.00 0.00 +0.000 A
|
||||
ENDROOT
|
||||
BRANCH 10 17
|
||||
ATOM 17 O UNL 1 -9.283 13.209 67.537 0.00 0.00 +0.000 OA
|
||||
ATOM 18 H UNL 1 -8.796 13.594 67.544 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 10 17
|
||||
BRANCH 13 19
|
||||
ATOM 19 O UNL 1 -9.611 11.692 64.405 0.00 0.00 +0.000 OA
|
||||
ATOM 20 H UNL 1 -9.190 11.811 63.965 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 13 19
|
||||
BRANCH 11 21
|
||||
ATOM 21 C UNL 1 -11.954 15.095 68.893 0.00 0.00 +0.000 C
|
||||
BRANCH 21 22
|
||||
ATOM 22 O UNL 1 -12.181 16.055 68.724 0.00 0.00 +0.000 OA
|
||||
ATOM 23 H UNL 1 -11.729 16.478 68.689 0.00 0.00 +0.000 HD
|
||||
ENDBRANCH 21 22
|
||||
ENDBRANCH 11 21
|
||||
TORSDOF 4
|
||||
ENDMDL
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Curie Web</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<span class="navbar-brand mb-0 h1">Curie Web</span>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{{ url_for('home') }}">Home <span class="sr-only">(current)</span></a>
|
||||
</li><!--
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('basic_form') }}">Basic Form</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('wtform') }}">WTForms</a>
|
||||
</li> -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('dock_upload') }}">Dock and Report</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<header class="jumbotron jumbotron-fluid">
|
||||
<div class="container">
|
||||
<h1>Curie Web Demo</h1>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="container">
|
||||
{% block main %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
<footer class="text-muted text-center text-small">
|
||||
Copyright © 2020
|
||||
</footer>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,7 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>Description: {{ description }}</h2>
|
||||
<p>Succesfuly Submitted</p>
|
||||
<!-- <img src="{{ url_for('static', filename="uploads/" + filename) }}" /> -->
|
||||
{% endblock %}
|
|
@ -0,0 +1,53 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>Enter Your Configuration</h2>
|
||||
<form action="{{ url_for('dock_upload') }}" method="post" enctype="multipart/form-data">
|
||||
{% include 'flash_messages.html' %}
|
||||
{{ form.csrf_token }}
|
||||
<div class="form-group">
|
||||
{{ form.description.label }}
|
||||
{{ form.description(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
{{ form.size_x.label }}
|
||||
{{ form.size_x(class="form-control")}}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.size_y.label }}
|
||||
{{ form.size_y(class="form-control")}}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.size_z.label }}
|
||||
{{ form.size_z(class="form-control")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
{{ form.center_x.label }}
|
||||
{{ form.center_x(class="form-control")}}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.center_y.label }}
|
||||
{{ form.center_y(class="form-control")}}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.center_z.label }}
|
||||
{{ form.center_z(class="form-control")}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
{{ form.target.label }}
|
||||
{{ form.target(class="form-control") }}
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.ligand.label }}
|
||||
{{ form.ligand(class="form-control")}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary">Upload</button>
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -0,0 +1,7 @@
|
|||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
|
@ -0,0 +1,23 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>Basic Form in Flask</h2>
|
||||
|
||||
<form action="{{ url_for('basic_form') }}" method="post">
|
||||
{% include 'flash_messages.html' %}
|
||||
<div class="form-group">
|
||||
<label for="firstname">First Name</label>
|
||||
<input type="text" class="form-control" name="firstname" id="firstname" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastname">Last Name</label>
|
||||
<input type="text" class="form-control" name="lastname" id="lastname" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">E-mail</label>
|
||||
<input type="email" class="form-control" name="email" id="email" placeholder="jdoe@example.com" />
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>Curie Web Demo</h2>
|
||||
<p>The dock and report demo performs molecular docking using AutoDock Vina and then finds protein-ligand interactions using PLIP</p>
|
||||
<ul>
|
||||
<li><a href="{{ url_for('dock_upload') }}">Dock and Report</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
|
@ -0,0 +1,7 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>Successful Form Submission</h2>
|
||||
{% include 'flash_messages.html' %}
|
||||
<p>My name is <strong>{{ firstname + ' ' + lastname }}</strong> and my email address is <strong>{{ email }}</strong>.</p>
|
||||
{% endblock %}
|
|
@ -0,0 +1,20 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<h2>WTForms in Flask</h2>
|
||||
<p>Here we are using the Flask-WTF library to create and process a form. Flask-WTF also comes with CSRF protection and validation classes.</p>
|
||||
<form method="post" action="{{ url_for('wtform') }}">
|
||||
{% include 'flash_messages.html' %}
|
||||
{{ form.csrf_token }}
|
||||
<div class="form-group">
|
||||
{{ form.firstname.label }} {{ form.firstname(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.lastname.label }} {{ form.lastname(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.email.label }} {{ form.email(class="form-control", placeholder="jdoe@example.com") }}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -0,0 +1,122 @@
|
|||
"""
|
||||
Flask Documentation: http://flask.pocoo.org/docs/
|
||||
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
|
||||
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
|
||||
This file creates your application.
|
||||
"""
|
||||
import os
|
||||
from app import app
|
||||
from flask import render_template, request, redirect, url_for, flash, session, abort
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
# Note: that when using Flask-WTF we need to import the Form Class that we created
|
||||
# in forms.py
|
||||
from .forms import MyForm, curieForm
|
||||
|
||||
|
||||
###
|
||||
# Routing for your application.
|
||||
###
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
"""Render website's home page."""
|
||||
return render_template('home.html')
|
||||
|
||||
|
||||
@app.route('/basic-form', methods=['GET', 'POST'])
|
||||
def basic_form():
|
||||
if request.method == 'POST':
|
||||
firstname = request.form['firstname']
|
||||
lastname = request.form['lastname']
|
||||
email = request.form['email']
|
||||
|
||||
return render_template('result.html',
|
||||
firstname=firstname,
|
||||
lastname=lastname,
|
||||
email=email)
|
||||
|
||||
return render_template('form.html')
|
||||
|
||||
|
||||
@app.route('/wtform', methods=['GET', 'POST'])
|
||||
def wtform():
|
||||
myform = MyForm()
|
||||
|
||||
if request.method == 'POST':
|
||||
if myform.validate_on_submit():
|
||||
# Note the difference when retrieving form data using Flask-WTF
|
||||
# Here we use myform.firstname.data instead of request.form['firstname']
|
||||
firstname = myform.firstname.data
|
||||
lastname = myform.lastname.data
|
||||
email = myform.email.data
|
||||
|
||||
flash('You have successfully filled out the form', 'success')
|
||||
return render_template('result.html', firstname=firstname, lastname=lastname, email=email)
|
||||
|
||||
flash_errors(myform)
|
||||
return render_template('wtform.html', form=myform)
|
||||
|
||||
|
||||
@app.route('/dock', methods=['GET', 'POST'])
|
||||
def dock_upload():
|
||||
form = curieForm()
|
||||
|
||||
if request.method == 'POST' and form.validate_on_submit():
|
||||
|
||||
#photo = photoform.photo.data # we could also use request.files['photo']
|
||||
description = form.description.data
|
||||
target = form.target.data
|
||||
print(description)
|
||||
print(secure_filename(target.filename))
|
||||
target.save(os.path.join(
|
||||
app.config['UPLOAD_FOLDER'], secure_filename(target.filename)
|
||||
))
|
||||
#photo.save(os.path.join(
|
||||
# app.config['UPLOAD_FOLDER'], filename
|
||||
#))
|
||||
|
||||
return render_template('display_photo.html', filename="OwO", description=description)
|
||||
|
||||
flash_errors(form)
|
||||
return render_template('dock_upload.html', form=form)
|
||||
|
||||
###
|
||||
# The functions below should be applicable to all Flask apps.
|
||||
###
|
||||
|
||||
# Flash errors from the form if validation fails
|
||||
def flash_errors(form):
|
||||
for field, errors in form.errors.items():
|
||||
for error in errors:
|
||||
flash(u"Error in the %s field - %s" % (
|
||||
getattr(form, field).label.text,
|
||||
error
|
||||
), 'danger')
|
||||
|
||||
@app.route('/<file_name>.txt')
|
||||
def send_text_file(file_name):
|
||||
"""Send your static text file."""
|
||||
file_dot_text = file_name + '.txt'
|
||||
return app.send_static_file(file_dot_text)
|
||||
|
||||
|
||||
@app.after_request
|
||||
def add_header(response):
|
||||
"""
|
||||
Add headers to both force latest IE rendering engine or Chrome Frame,
|
||||
and also to cache the rendered page for 10 minutes.
|
||||
"""
|
||||
response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'
|
||||
response.headers['Cache-Control'] = 'public, max-age=0'
|
||||
return response
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(error):
|
||||
"""Custom 404 page."""
|
||||
return render_template('404.html'), 404
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, host="0.0.0.0", port="8080")
|
|
@ -0,0 +1,9 @@
|
|||
Click==7.0
|
||||
Flask==1.1.1
|
||||
Flask-WTF==0.14.2
|
||||
gunicorn==20.0.4
|
||||
itsdangerous==1.1.0
|
||||
Jinja2==2.11.0
|
||||
MarkupSafe==1.1.1
|
||||
Werkzeug==0.16.1
|
||||
WTForms==2.2.1
|
|
@ -0,0 +1,3 @@
|
|||
#! /usr/bin/env python
|
||||
from app import app
|
||||
app.run(debug=True, host="0.0.0.0", port=8080)
|
|
@ -0,0 +1 @@
|
|||
python-3.7.1
|
Loading…
Reference in New Issue