diff --git a/.env b/.env index d89cb66..9046943 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -FLASK_APP=webface +FLASK_APP=webface.py FLASK_RUN_PORT=54321 -FLASK_ENV=development -#FLASK_DEBUG=1 +FLASK_DEBUG=1 diff --git a/.flaskenv b/.flaskenv index eb74e69..67e402e 100644 --- a/.flaskenv +++ b/.flaskenv @@ -1,2 +1,2 @@ -FLASK_APP=webface +FLASK_APP=webface.py FLASK_ENV=production diff --git a/.vscode/settings.json b/.vscode/settings.json index 2f97bb1..42aa686 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ "emmet.includeLanguages": { "jinja-html": "html", "vue-html": "html" - } + }, + "python.formatting.provider": "black" } \ No newline at end of file diff --git a/README.md b/README.md index 7244e12..e3d3995 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Open in Visual Studio Code](https://classroom.github.com/assets/open-in-vscode-c66648af7eb3fe8bc4f294546bfd86ef473780cde1dea487d3c4ff354943c9ae.svg)](https://classroom.github.com/online_ide?assignment_repo_id=8703051&assignment_repo_type=AssignmentRepo) +[![Open in Visual Studio Code](https://classroom.github.com/assets/open-in-vscode-c66648af7eb3fe8bc4f294546bfd86ef473780cde1dea487d3c4ff354943c9ae.svg)](https://classroom.github.com/online_ide?assignment_repo_id=8703049&assignment_repo_type=AssignmentRepo) Flask Start OneFile ========================= diff --git a/SQLlite.db b/SQLlite.db new file mode 100644 index 0000000..316cf04 Binary files /dev/null and b/SQLlite.db differ diff --git a/data.db b/data.db new file mode 100644 index 0000000..72ae65d Binary files /dev/null and b/data.db differ diff --git a/mysqlite.py b/mysqlite.py new file mode 100644 index 0000000..f0ea0a0 --- /dev/null +++ b/mysqlite.py @@ -0,0 +1,37 @@ +import sqlite3 + + +class SQLite(): + def __init__(self, file='db.sqlite3'): + self.file=file + def __enter__(self): + self.conn = sqlite3.connect(self.file) + self.conn.row_factory = sqlite3.Row + return self.conn.cursor() + def __exit__(self, type, value, traceback): + self.conn.commit() + self.conn.close() + + +if __name__ == '__main__': + with SQLite("SQLlite.db") as cur: + sql = """ +CREATE TABLE "adresy"( + "zkratka" TEXT NOT NULL, + "adresa" TEXT NOT NULL, + "user: TEXT, + PRIMARY KEY("zkratka") +); + """ + cur.execute(sql) + + sql = """ +CREATE TABLE "user"( + "login" TEXT, + "passwd" TEXT, + PRIMARY KEY("login") +); + + + """ + cur.execute(sql) \ No newline at end of file diff --git "a/static/ban\303\241n.jpeg" "b/static/ban\303\241n.jpeg" new file mode 100644 index 0000000..eeb9f93 Binary files /dev/null and "b/static/ban\303\241n.jpeg" differ diff --git a/static/pomeranc.jpeg b/static/pomeranc.jpeg new file mode 100644 index 0000000..e4f2fec Binary files /dev/null and b/static/pomeranc.jpeg differ diff --git a/static/styles.css b/static/styles.css index e4b4043..21added 100644 --- a/static/styles.css +++ b/static/styles.css @@ -1,5 +1,5 @@ body { - background-color: #eeeeee; + background-color: #ea0079; padding-left: 1em; padding-right: 1em; margin-left: 90px; @@ -8,10 +8,11 @@ body { h1, h2, h3 { clear: both; margin-top: 3em; + color: #0aec0a; } h1 a { - color: #bb8800; + color: #0aec0a; } nav ul { @@ -26,12 +27,12 @@ nav ul { } nav ul li a { display: block; - color: white; - background-color: #324b79; + color: rgb(0, 30, 255); + background-color: #7bff00; border-radius: 25px 50px 0px; padding: 1ex 2ex; } nav ul li a:hover { - color: #324b72; + color: #5e12a6; background-color: white; } nav img { @@ -45,7 +46,7 @@ footer { background-color: #ecc8f0; } .login { - display: inline-block; + display: block; float: right; width: 30%; border: orange solid 2px; @@ -59,5 +60,28 @@ footer { background-color: lightblue; } - +.flash{ + display: block; + position: absolute; + left: 30%; + top: 1ex; + width: 40%; + border: 2px orange solid; + padding: 2ex; + border-radius: 20px; + font-weight: bold; +} +.error{ + background-color: white; + color: red; +} /*# sourceMappingURL=styles.css.map */ + +.url{ + font-size: 150%; +} + +.url input{ + width: 75%; + font-size: 170%; +} \ No newline at end of file diff --git a/templates/abc.html b/templates/abc.html index 590d55d..241887c 100644 --- a/templates/abc.html +++ b/templates/abc.html @@ -1,4 +1,4 @@ -{% extends 'base.html.j2' %} +{% extends 'base.html' %} {% block obsah %} diff --git a/templates/banan.html b/templates/banan.html new file mode 100644 index 0000000..38ec8a9 --- /dev/null +++ b/templates/banan.html @@ -0,0 +1,28 @@ + +{% extends 'base.html' %} + +{%block title%}Informace{%endblock%} + +{% block obsah %} + +
BMI={{bmi}}
+ + + + + + + + +{% endblock obsah %} diff --git a/templates/base.html b/templates/base.html index 925dc41..a9b1f57 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,14 +16,33 @@+ +{% if 'uživatel' in session %} +jsi přihlášen jako Najvetší lupič +{% else %} +Jaaaaj!!! Nejsi přihlášen Přihlas se! +{% endif %} + +
+ +{% for category,message in get_flashed_messages(with_categories=true) %} ++ +{{message}} +
+{% endfor %} @@ -58,7 +77,18 @@ +