Skip to content
Snippets Groups Projects
Commit c39e63e2 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

initial flask setup

parent c91c713a
Branches
Tags
No related merge requests found
/Pipfile.lock
/settings.json
...@@ -3,8 +3,19 @@ url = "https://pypi.python.org/simple" ...@@ -3,8 +3,19 @@ url = "https://pypi.python.org/simple"
verify_ssl = true verify_ssl = true
name = "pypi" name = "pypi"
[[source]]
url = "https://pypi.thecodelabs.de"
verify_ssl = true
name = "TheCodeLabs"
[requires] [requires]
python_version = "3.7" python_version = "3"
[packages] [packages]
flask = "==1.1.2"
gevent = "==20.6.1"
TheCodeLabs-BaseUtils = "*"
TheCodeLabs-FlaskUtils = "*"
python-jenkins = "==1.5.0" python-jenkins = "==1.5.0"
[dev-packages]
{
"server": {
"listen": "0.0.0.0",
"port": 10002,
"secret": "",
"useSSL": false,
"keyfile": "",
"certfile": ""
}
}
\ No newline at end of file
import os
from TheCodeLabs_BaseUtils.DefaultLogger import DefaultLogger
from TheCodeLabs_FlaskUtils.FlaskBaseApp import FlaskBaseApp
from blueprints import Routes
from logic import Constants
LOGGER = DefaultLogger().create_logger_if_not_exists(Constants.APP_NAME)
class CarrotCastleWebsite(FlaskBaseApp):
SUPPORTED_LANGUAGES = ['en', 'de']
def __init__(self, appName: str):
super().__init__(appName, os.path.dirname(__file__), LOGGER, serveRobotsTxt=True)
def _register_blueprints(self, app):
app.register_blueprint(Routes.construct_blueprint())
return app
if __name__ == '__main__':
website = CarrotCastleWebsite(Constants.APP_NAME)
website.start_server()
from flask import Blueprint, render_template
def construct_blueprint():
routes = Blueprint('routes', __name__)
@routes.route('/', methods=['GET'])
def index():
return render_template('index.html')
return routes
File moved
import os
APP_NAME = 'ProjectLeaf'
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
\ No newline at end of file
File moved
...@@ -7,7 +7,7 @@ import time ...@@ -7,7 +7,7 @@ import time
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
from Image import DebugImage, EPDImage, AbstractImage from logic.Image import DebugImage, EPDImage, AbstractImage
from libs.lib.waveshare_epd import epd4in2bc from libs.lib.waveshare_epd import epd4in2bc
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
......
body {
background-color: #212121;
margin: 0;
padding: 0;
font-family: sans-serif;
}
\ No newline at end of file
function init()
{
}
init();
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>CarrotCastle</title>
{% import 'macros.html' as macros %}
{{ macros.header() }}
</head>
<body>
<div class="main">
<div class="content">
</div>
</div>
</body>
<script type="text/javascript" src={{ url_for('static', filename='js/main.js') }}></script>
</html>
{% macro header() -%}
<meta charset="UTF-8"/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="{{ url_for('static', filename='libraries/fontawesome/css/all.min.css') }}" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{%- endmacro %}
{
"version": {
"name": "v1.0.0",
"code": 1,
"date": "05.07.20"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment