Init simple Flask project
This commit is contained in:
parent
c656d353ec
commit
b0567592ad
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
9
.idea/misc.xml
generated
Normal file
9
.idea/misc.xml
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.10 (HabitTracker) (2)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/HabitTracker.iml" filepath="$PROJECT_DIR$/HabitTracker.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
9
HabitTracker.iml
Normal file
9
HabitTracker.iml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.10 (HabitTracker) (2)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
16
app.py
Normal file
16
app.py
Normal file
@ -0,0 +1,16 @@
|
||||
from flask import Flask, render_template
|
||||
|
||||
# Create a new Flask instance
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
# Create a new route
|
||||
@app.route('/')
|
||||
def index():
|
||||
# return 'Hello World'
|
||||
return render_template('index.html', title='Home')
|
||||
|
||||
|
||||
# Run the application
|
||||
if __name__ == '__main__':
|
||||
app.run(port=5000, debug=True)
|
||||
7
templates/index.html
Normal file
7
templates/index.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends 'layouts/main.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Hello World!</h1>
|
||||
<h2>Welcome to FlaskApp!</h2>
|
||||
<h3>{{ utc_dt }}</h3>
|
||||
{% endblock %}
|
||||
25
templates/layouts/main.html
Normal file
25
templates/layouts/main.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ title }} - HabitTracker</title>
|
||||
<style>
|
||||
nav a {
|
||||
color: #d64161;
|
||||
font-size: 3em;
|
||||
margin-left: 50px;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="#">Test Navbar</a>
|
||||
<a href="#">Meine Stats...</a>
|
||||
</nav>
|
||||
<hr>
|
||||
<div class="content">
|
||||
{% block content %} {% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user