Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LabelsTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Authenticating with a password
with git over http
works again
. More information
here
.
Show more breadcrumbs
MaitresNageurs
README
LabelsTower
Commits
9c9a2817
Commit
9c9a2817
authored
5 years ago
by
erichard
Browse files
Options
Downloads
Patches
Plain Diff
Tentative d'implémentation du design patern "application factory"
parent
622879ab
No related branches found
No related tags found
2 merge requests
!61
Packager labelstower
,
!60
WIP: Implement sqlalchemy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/labelsTower.py
+25
-2
25 additions, 2 deletions
app/labelsTower.py
with
25 additions
and
2 deletions
app/labelsTower.py
+
25
−
2
View file @
9c9a2817
from
flask
import
Flask
,
render_template
from
flask
import
Flask
,
render_template
from
label_system
import
sort
from
label_system
import
sort
class
CustomFlask
(
Flask
):
jinja_options
=
Flask
.
jinja_options
.
copy
()
jinja_options
.
update
(
dict
(
variable_start_string
=
'
[[
'
,
variable_end_string
=
'
]]
'
,
))
'''
class CustomFlask(Flask):
class CustomFlask(Flask):
jinja_options = Flask.jinja_options.copy()
jinja_options = Flask.jinja_options.copy()
jinja_options.update(dict(
jinja_options.update(dict(
...
@@ -21,8 +28,24 @@ text_component = {"project_name": "LabelsTower",
...
@@ -21,8 +28,24 @@ text_component = {"project_name": "LabelsTower",
@app.route(
'
/browse
'
)
@app.route(
'
/browse
'
)
def home():
def home():
return render_template(
'
browse.html
'
, txt=text_component)
return render_template(
'
browse.html
'
, txt=text_component)
if __name__ ==
'
__main__
'
:
app.run(host=
'
0.0.0.0
'
, port=80)
'''
def
create_app
():
text_component
=
{
"
project_name
"
:
"
LabelsTower
"
,
"
Element_name
"
:
"
Element(s)
"
,
"
Label
"
:
"
Label(s)
"
}
app
=
CustomFlask
(
__name__
)
@app.route
(
'
/
'
)
@app.route
(
'
/browse
'
)
def
home
():
return
render_template
(
'
browse.html
'
,
txt
=
text_component
)
app
.
register_blueprint
(
sort
,
url_prefix
=
'
/sort
'
)
return
app
if
__name__
==
'
__main__
'
:
app
.
run
(
host
=
'
0.0.0.0
'
,
port
=
80
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment