Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Iotproject
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ANTO SAGAYA JUSTIN R
Iotproject
Commits
0fba03c8
Commit
0fba03c8
authored
10 months ago
by
ANTO SAGAYA JUSTIN R
Browse files
Options
Downloads
Patches
Plain Diff
Viewer and jinja
parent
76ef4f2d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
create venv file/create venv file.txt
+7
-1
7 additions, 1 deletion
create venv file/create venv file.txt
flask/app.py
+15
-12
15 additions, 12 deletions
flask/app.py
flask/templates/helloworld.html
+63
-0
63 additions, 0 deletions
flask/templates/helloworld.html
with
85 additions
and
13 deletions
create venv file/create venv file.txt
+
7
−
1
View file @
0fba03c8
...
...
@@ -14,4 +14,10 @@ python strip function:
Flask redirect package:
This is a basic illustration of redirection in Flask.
You can redirect to any route within your Flask application using the redirect() function.
combined with url_for() to specify the route's endpoint.
\ No newline at end of file
combined with url_for() to specify the route's endpoint.
vs code shortcuts:
Alt+up arow = move line.
ctl+shift+enter = empty line for befor line.
ctl+L = select one line.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
flask/app.py
+
15
−
12
View file @
0fba03c8
from
flask
import
Flask
from
flask
import
Flask
,
render_template
app
=
Flask
(
__name__
)
import
os
import
math
...
...
@@ -6,20 +7,21 @@ basename = '/iotcloud'
# app.debug = True ( for any debug error for True that line )
# @app.route
# 1.To Searching route ex:[172.30.0.231:7000/hello] to view your flask project.
@app.route
(
'
/hello
'
)
@app.route
(
basename
+
'
/hello
'
)
def
hello_world
():
return
"
<h1>Hello World 123<h1/>
"
@app.route
(
'
/
'
)
def
hello
():
return
"
<h1>Hello Justin Welcome<h1/>
"
d
=
{
"
username
"
:
"
justin
"
,
"
env
"
:
"
labs
"
,
"
avatar
"
:
"
https://media.licdn.com/dms/image/D5603AQGqSYfbrnkjcw/profile-displayphoto-shrink_200_200/0/1694890248719?e=1720051200&v=beta&t=M6ZsyUoBIQ8fpaswZe6aCld0oOmrala4dKPRt2m4v98
"
}
return
render_template
(
'
helloworld.html
'
,
data
=
d
)
@app.route
(
'
/whoami
'
)
@app.route
(
basename
+
'
/whoami
'
)
def
whoami
():
return
"
<h1>
"
+
os
.
popen
(
'
whoami
'
).
read
()
+
"
<h1/>
"
return
"
<h1>
"
+
os
.
popen
(
'
whoami
'
).
read
()
+
"
<h1/>
"
# @app.route:
# 1.To Searching route ex:[172.30.0.231:7000/iotcloud/whoami] to view your flask project.
# whoami:
# Lhis Linux Command To Return This System Username For Example [ justinmass2001 ].
...
...
@@ -67,4 +69,5 @@ def power ( a , b ):
if
__name__
==
'
__main__
'
:
app
.
run
(
host
=
'
0.0.0.0
'
,
port
=
'
7000
'
,
debug
=
True
)
# host = '0.0.0.0':
# your access all type of IP address to add [host = '0.0.0.0'] Running on all IP addresses
\ No newline at end of file
# your access all type of IP address to add [host = '0.0.0.0'] Running on all IP addresses
This diff is collapsed.
Click to expand it.
flask/templates/helloworld.html
0 → 100644
+
63
−
0
View file @
0fba03c8
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