feat(main): adds main module
This commit is contained in:
4
app/main/__init__.py
Normal file
4
app/main/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from flask import Blueprint
|
||||
|
||||
bp = Blueprint('main', __name__)
|
||||
from app.main import routes
|
||||
6
app/main/routes.py
Normal file
6
app/main/routes.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from flask import render_template
|
||||
from app.main import bp
|
||||
|
||||
@bp.route('/')
|
||||
def index():
|
||||
return render_template("index.html")
|
||||
8
app/templates/index.html
Normal file
8
app/templates/index.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
{% block title %}Home{% endblock %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<p>Hello, World!</p>
|
||||
{% endblock %}
|
||||
18
app/templates/layout.html
Normal file
18
app/templates/layout.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{% block title %}{% endblock %} - Adog a pet</title>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">{% block content %}{% endblock %}</div>
|
||||
<div id="footer">
|
||||
{% block footer %}
|
||||
© Copyright 2010 by <a href="http://domain.invalid/">you</a>.
|
||||
{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user