diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | pyproject.toml | 6 | ||||
| -rw-r--r-- | tests/conftest.py | 4 | ||||
| -rw-r--r-- | tests/test_auth.py | 2 | ||||
| -rw-r--r-- | tests/test_blog.py | 2 | ||||
| -rw-r--r-- | tests/test_db.py | 4 | ||||
| -rw-r--r-- | tests/test_factory.py | 2 | ||||
| -rw-r--r-- | ustayml/__init__.py (renamed from flaskr/__init__.py) | 2 | ||||
| -rw-r--r-- | ustayml/db.py (renamed from flaskr/db.py) | 0 | ||||
| -rw-r--r-- | ustayml/schema.sql (renamed from flaskr/schema.sql) | 0 | ||||
| -rw-r--r-- | ustayml/static/favicon.ico (renamed from flaskr/static/favicon.ico) | bin | 1001 -> 1001 bytes | |||
| -rw-r--r-- | ustayml/static/img/flask-powered.png (renamed from flaskr/static/img/flask-powered.png) | bin | 4890 -> 4890 bytes | |||
| -rw-r--r-- | ustayml/static/logo_pucp.svg | 11 | ||||
| -rw-r--r-- | ustayml/static/style.css (renamed from flaskr/static/style.css) | 0 | ||||
| -rw-r--r-- | ustayml/templates/auth/login.html (renamed from flaskr/templates/auth/login.html) | 0 | ||||
| -rw-r--r-- | ustayml/templates/auth/register.html (renamed from flaskr/templates/auth/register.html) | 0 | ||||
| -rw-r--r-- | ustayml/templates/base.html (renamed from flaskr/templates/base.html) | 4 | ||||
| -rw-r--r-- | ustayml/templates/blog/create.html (renamed from flaskr/templates/blog/create.html) | 0 | ||||
| -rw-r--r-- | ustayml/templates/blog/index.html (renamed from flaskr/templates/blog/index.html) | 0 | ||||
| -rw-r--r-- | ustayml/templates/blog/update.html (renamed from flaskr/templates/blog/update.html) | 0 | ||||
| -rw-r--r-- | ustayml/views/auth.py (renamed from flaskr/views/auth.py) | 2 | ||||
| -rw-r--r-- | ustayml/views/blog.py (renamed from flaskr/views/blog.py) | 4 | ||||
| -rw-r--r-- | ustayml/views/dashboard.py | 0 |
23 files changed, 28 insertions, 17 deletions
@@ -11,7 +11,7 @@ python -m venv .venv source .venv/bin/activate pip install -r requirements.txt -flask --app flaskr run --debug +flask --app ustayml run --debug ``` ## Build diff --git a/pyproject.toml b/pyproject.toml index 5156197..e5df87f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "flaskr" +name = "ustayml" version = "1.0.0" -description = "The basic blog app built in the Flask tutorial." +description = "thesis project website" dependencies = [ "flask", ] @@ -15,4 +15,4 @@ testpaths = ["tests"] [tool.coverage.run] branch = true -source = ["flaskr"]
\ No newline at end of file +source = ["ustayml"]
\ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index 6a2d0a6..505c83d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,8 +10,8 @@ import os import tempfile import pytest -from flaskr import create_app -from flaskr.db import get_db, init_db +from ustayml import create_app +from ustayml.db import get_db, init_db with open(os.path.join(os.path.dirname(__file__), 'data.sql'), 'rb') as f: _data_sql = f.read().decode('utf8') diff --git a/tests/test_auth.py b/tests/test_auth.py index 401b61f..6684f43 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,6 +1,6 @@ import pytest from flask import g, session -from flaskr.db import get_db +from ustayml.db import get_db def test_register(client, app): diff --git a/tests/test_blog.py b/tests/test_blog.py index 75f67a5..06b6437 100644 --- a/tests/test_blog.py +++ b/tests/test_blog.py @@ -1,5 +1,5 @@ import pytest -from flaskr.db import get_db +from ustayml.db import get_db def test_index(client, auth): diff --git a/tests/test_db.py b/tests/test_db.py index 6ac4635..4e2f103 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -1,7 +1,7 @@ import sqlite3 import pytest -from flaskr.db import get_db +from ustayml.db import get_db def test_get_close_db(app): @@ -27,7 +27,7 @@ def test_init_db_command(runner, monkeypatch): def fake_init_db(): Recorder.called = True - monkeypatch.setattr('flaskr.db.init_db', fake_init_db) + monkeypatch.setattr('ustayml.db.init_db', fake_init_db) result = runner.invoke(args=['init-db']) assert 'Initialized' in result.output assert Recorder.called
\ No newline at end of file diff --git a/tests/test_factory.py b/tests/test_factory.py index 024c19a..edc973c 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -1,4 +1,4 @@ -from flaskr import create_app +from ustayml import create_app def test_config(): diff --git a/flaskr/__init__.py b/ustayml/__init__.py index 25c2682..1c411e7 100644 --- a/flaskr/__init__.py +++ b/ustayml/__init__.py @@ -10,7 +10,7 @@ def create_app(test_config=None): # Config app.config.from_mapping( SECRET_KEY='dev', - DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'), + DATABASE=os.path.join(app.instance_path, 'ustayml.sqlite'), ) if test_config is None: diff --git a/flaskr/db.py b/ustayml/db.py index eb4e8b4..eb4e8b4 100644 --- a/flaskr/db.py +++ b/ustayml/db.py diff --git a/flaskr/schema.sql b/ustayml/schema.sql index be76d7e..be76d7e 100644 --- a/flaskr/schema.sql +++ b/ustayml/schema.sql diff --git a/flaskr/static/favicon.ico b/ustayml/static/favicon.ico Binary files differindex aecf115..aecf115 100644 --- a/flaskr/static/favicon.ico +++ b/ustayml/static/favicon.ico diff --git a/flaskr/static/img/flask-powered.png b/ustayml/static/img/flask-powered.png Binary files differindex 9d20f17..9d20f17 100644 --- a/flaskr/static/img/flask-powered.png +++ b/ustayml/static/img/flask-powered.png diff --git a/ustayml/static/logo_pucp.svg b/ustayml/static/logo_pucp.svg new file mode 100644 index 0000000..8ffb164 --- /dev/null +++ b/ustayml/static/logo_pucp.svg @@ -0,0 +1,11 @@ +<svg width="183" height="60" viewBox="0 0 183 60" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M58.5557 29.999C58.5557 35.6481 56.8806 41.1703 53.7421 45.8673C50.6037 50.5643 46.1429 54.2252 40.9238 56.387C35.7048 58.5488 29.9619 59.1145 24.4214 58.0124C18.8808 56.9103 13.7916 54.19 9.79707 50.1955C5.80258 46.201 3.0823 41.1118 1.98022 35.5712C0.878146 30.0307 1.44377 24.2878 3.60557 19.0688C5.76737 13.8497 9.42826 9.38893 14.1253 6.25048C18.8223 3.11203 24.3445 1.43689 29.9936 1.43689C33.7444 1.43689 37.4585 2.17567 40.9238 3.61105C44.3891 5.04644 47.5378 7.15031 50.19 9.80255C52.8423 12.4548 54.9462 15.6035 56.3815 19.0688C57.8169 22.5341 58.5557 26.2482 58.5557 29.999" fill="#042354"/> +<path d="M29.9968 7.02445e-07C24.0633 0.000642676 18.2633 1.76074 13.3302 5.05771C8.39709 8.35469 4.55242 13.0405 2.28238 18.5225C0.0123498 24.0045 -0.581098 30.0366 0.577088 35.8559C1.73527 41.6752 4.59307 47.0204 8.7891 51.2155C12.9851 55.4106 18.3309 58.2672 24.1505 59.4242C29.97 60.5811 36.002 59.9863 41.4835 57.7151C46.965 55.4439 51.65 51.5982 54.9459 46.6644C58.2418 41.7306 60.0006 35.9302 60 29.9967C60 26.057 59.2239 22.1558 57.716 18.516C56.2081 14.8762 53.998 11.5691 51.2119 8.78355C48.4257 5.99801 45.1181 3.7886 41.478 2.2815C37.8379 0.774408 33.9365 -0.000851878 29.9968 7.02445e-07V7.02445e-07ZM30.8341 57.3418C17.1146 58.2246 6.88089 47.6663 4.73549 41.1814C4.80365 41.1295 4.9562 41.0386 4.9562 41.0386C8.27005 40.1006 11.4833 41.7884 15.1282 44.8523C17.7637 47.0691 23.0218 53.1418 29.4677 56.0565C29.9538 56.33 30.4645 56.5571 30.9932 56.7348C30.9932 56.8095 30.8731 57.186 30.8341 57.3418V57.3418ZM40.5258 55.3002C40.0779 55.4657 36.7251 56.5336 34.1188 55.8098C33.619 55.6637 33.1451 55.5079 32.655 55.3294C29.0847 54.0084 25.7968 51.8241 22.6842 49.3995C18.7634 46.3388 15.9039 42.3758 10.6362 39.8961C10.6714 39.8106 10.6964 39.7213 10.7108 39.63C13.6319 39.974 17.3061 40.3343 22.1292 43.2911C23.9922 44.4304 31.6358 48.9386 32.655 49.4385C34.7191 50.4401 36.8607 51.2737 39.0587 51.9312C40.302 52.2913 41.5658 52.5764 42.8432 52.7848C42.8432 52.7848 43.8689 52.9114 44.1805 52.9406L44.3784 53.408C43.1467 54.132 41.8634 54.7645 40.5388 55.3002H40.5258ZM49.8702 49.1334C46.8517 51.7299 42.5576 51.1717 39.6235 50.4706C35.1282 49.3865 27.9552 45.3229 26.0727 44.0798C26.1181 44.0279 26.2382 43.8526 26.2837 43.8039C29.789 45.06 43.9305 48.6141 53.1159 43.9435C53.184 44.0149 53.2457 44.0928 53.3106 44.161C53.3755 44.2291 53.5443 44.3849 53.6157 44.4531C52.5317 46.138 51.2766 47.7065 49.8702 49.1334V49.1334ZM48.1532 43.7715C48.5352 43.3878 48.8258 42.9229 49.0036 42.4115L50.3018 38.3771H48.2863C46.6926 40.7952 42.8627 40.4284 39.6884 38.4583C34.6933 35.3457 31.2301 33.4339 28.7796 33.2879C28.4544 33.2681 28.1279 33.2833 27.8059 33.3333V33.3333C28.1889 37.1632 28.9419 39.5391 29.3671 40.6297C29.4629 40.8742 29.5713 41.1136 29.6917 41.347L29.2113 41.2398C29.0766 41.0691 28.9509 40.8914 28.8348 40.7076C28.2408 39.7988 27.0659 37.6891 26.1344 34.0798C25.4141 34.6539 24.9328 35.4752 24.7842 36.3843C24.7555 36.6505 24.7415 36.9182 24.742 37.186L25.7579 39.5618L27.0821 42.6485C26.6115 42.4732 26.0143 42.2233 25.3262 41.9409C20.6232 39.9935 11.0841 36.0273 3.85266 39.3995C2.4829 35.5859 1.96373 31.5188 2.33155 27.4833C2.69937 23.4479 3.94526 19.5417 5.98192 16.0385C8.01858 12.5353 10.7967 9.51994 14.1216 7.20367C17.4466 4.8874 21.2378 3.32629 25.2297 2.62976C29.2216 1.93322 33.3175 2.11811 37.2304 3.17147C41.1432 4.22482 44.7784 6.12116 47.8811 8.72757C50.9839 11.334 53.479 14.5874 55.1918 18.2598C56.9045 21.9323 57.7934 25.9348 57.7962 29.987C57.7962 32.4927 57.2769 36.1149 56.8225 37.2314C55.3035 40.6751 52.1454 42.7231 48.1402 43.7455" fill="white"/> +<path d="M44.8976 26.747C45.2362 24.522 45.9693 22.3754 47.0625 20.4081C44.5278 18.9083 41.6467 18.0934 38.702 18.0433C35.7573 17.9933 32.8502 18.7098 30.266 20.1225C29.8242 20.9348 29.4487 21.7814 29.143 22.6541V22.6541V22.6833C28.1501 22.9558 27.1926 23.3436 26.29 23.8388C25.3281 25.298 24.7951 26.9979 24.7514 28.7451C24.7078 30.4922 25.1554 32.2166 26.0433 33.722L25.7967 32.216C26.5695 31.7195 27.4752 31.4704 28.3932 31.5019C31.0871 31.5019 34.7743 33.0988 38.734 35.981C38.7015 35.8966 38.6691 35.8122 38.6399 35.7278C37.2465 31.8743 37.3624 27.6363 38.9645 23.8648C37.6285 23.1283 36.1742 22.6307 34.6671 22.3945L34.7321 22.1868C36.5552 22.3309 38.3418 22.7762 40.0193 23.5045C38.85 26.965 38.9165 30.7238 40.2076 34.1407C42.624 35.0634 44.7905 36.5397 46.5334 38.4509L46.7606 38.3503C44.9424 34.7734 44.2909 30.7166 44.8976 26.7502" fill="white"/> +<path d="M17.1118 20.8371C17.2903 22.7585 17.6149 26.0302 17.6149 26.0302H18.1926C18.1926 26.0302 18.5172 22.7423 18.7087 20.8371C18.8158 19.6751 19.2767 19.1623 20.1043 18.961C20.7729 18.7923 22.8956 18.5002 22.8956 18.5002V17.9484C21.9128 17.8525 20.9372 17.6943 19.9745 17.4745C19.6439 17.4032 19.3408 17.2383 19.1014 16.9994C18.862 16.7606 18.6964 16.4579 18.6243 16.1275C18.4263 15.3875 18.1764 13.0798 18.1764 13.0798H17.6343C17.5296 14.1029 17.3736 15.1201 17.1669 16.1275C17.098 16.4583 16.9342 16.7618 16.6955 17.001C16.4569 17.2402 16.1538 17.4047 15.8232 17.4745C15.1157 17.7114 12.9021 17.9484 12.9021 17.9484V18.5002C12.9021 18.5002 15.0086 18.8052 15.6934 18.974C16.5211 19.1753 16.9917 19.6881 17.102 20.85" fill="white"/> +<path d="M39.6948 15.3484L39.2209 17.4257C37.7959 16.2273 36.0254 15.5154 34.1674 15.3939L34.0895 15.0888C34.9798 14.6938 35.9499 14.5116 36.9228 14.5566C37.8958 14.6017 38.8448 14.8728 39.6948 15.3484" fill="white"/> +<path d="M85.55 15.4857C88.6745 15.4857 91.2245 16.4324 93.2001 18.3257C95.1475 20.2179 96.1504 22.6035 96.1504 25.4857C96.1504 28.3679 95.1572 30.76 93.1839 32.6587C91.2105 34.5574 88.6691 35.4954 85.55 35.4954H80.4445V44.0608H72.7035V15.4987L85.55 15.4857ZM80.4445 22.438V28.5626H85.1248C85.5522 28.569 85.9767 28.4908 86.3738 28.3326C86.771 28.1744 87.1329 27.9393 87.439 27.6409C87.7391 27.3709 87.9792 27.0408 88.1435 26.672C88.3078 26.3032 88.3927 25.904 88.3927 25.5003C88.3927 25.0966 88.3078 24.6974 88.1435 24.3286C87.9792 23.9598 87.7391 23.6298 87.439 23.3598C87.134 23.0598 86.7722 22.8238 86.3748 22.6655C85.9774 22.5072 85.5524 22.4299 85.1248 22.438H80.4445Z" fill="white"/> +<path d="M115.725 36.2939C116.241 35.7524 116.645 35.1143 116.913 34.4164C117.182 33.7186 117.31 32.9745 117.29 32.227V15.4857H125.041V32.227C125.041 35.8168 123.811 38.8158 121.337 41.2468C118.864 43.6779 115.748 44.882 111.99 44.882C108.231 44.882 105.119 43.6649 102.645 41.2468C100.172 38.8288 98.9387 35.8168 98.9387 32.227V15.4857H106.686V32.227C106.649 33.7369 107.213 35.1997 108.254 36.2939C108.728 36.8123 109.304 37.2263 109.947 37.5095C110.59 37.7928 111.284 37.9391 111.986 37.9391C112.689 37.9391 113.383 37.7928 114.026 37.5095C114.669 37.2263 115.245 36.8123 115.719 36.2939" fill="white"/> +<path d="M137.894 35.6154C138.657 36.3817 139.569 36.9835 140.574 37.3838C141.579 37.784 142.655 37.9742 143.736 37.9426C145.156 37.9512 146.56 37.6383 147.842 37.0273C149.14 36.4139 150.059 35.8037 150.633 35.174L151.497 34.2587L155.972 39.163C155.83 39.3822 155.674 39.5925 155.505 39.7927C155.06 40.2818 154.583 40.7405 154.077 41.1656C153.319 41.8223 152.502 42.4069 151.636 42.9118C150.547 43.5026 149.391 43.9603 148.192 44.275C146.742 44.6815 145.242 44.8857 143.736 44.8819C139.3 44.8819 135.536 43.3954 132.444 40.4223C129.352 37.4493 127.811 33.8996 127.819 29.7732C127.819 25.6382 129.36 22.0874 132.441 19.1208C135.522 16.1542 139.286 14.6688 143.733 14.6645C145.21 14.6558 146.68 14.8546 148.102 15.2552C149.299 15.5771 150.448 16.0597 151.516 16.6898C152.337 17.1946 153.122 17.7553 153.866 18.3678C154.401 18.7912 154.888 19.2711 155.32 19.7992L155.771 20.3834L151.068 25.2844C150.99 25.1708 150.89 25.0377 150.744 24.8722C150.458 24.5615 150.153 24.2688 149.832 23.9958C149.362 23.5856 148.86 23.2153 148.329 22.8891C146.926 22.0817 145.341 21.6449 143.723 21.62C142.644 21.5925 141.57 21.7844 140.566 22.184C139.563 22.5836 138.652 23.1827 137.887 23.945C137.122 24.7072 136.519 25.6167 136.116 26.6185C135.713 27.6203 135.517 28.6935 135.541 29.7732C135.512 30.8553 135.706 31.9318 136.109 32.9365C136.512 33.9412 137.116 34.8528 137.884 35.6154" fill="white"/> +<path d="M171.437 15.4857C174.579 15.4857 177.13 16.4324 179.091 18.3257C181.064 20.2179 182.041 22.6035 182.041 25.4857C182.041 28.3679 181.067 30.76 179.084 32.6587C177.101 34.5574 174.573 35.4954 171.437 35.4954H166.338V44.0608H158.584V15.4987L171.437 15.4857ZM166.338 22.438V28.5626H171.025C171.452 28.5696 171.876 28.4917 172.273 28.3335C172.67 28.1752 173.031 27.9398 173.336 27.6409C173.638 27.372 173.88 27.0423 174.045 26.6733C174.211 26.3044 174.296 25.9047 174.296 25.5003C174.296 25.096 174.211 24.6962 174.045 24.3273C173.88 23.9584 173.638 23.6287 173.336 23.3598C173.032 23.0602 172.67 22.8244 172.274 22.6661C171.877 22.5079 171.452 22.4303 171.025 22.438H166.338Z" fill="white"/> +</svg>
\ No newline at end of file diff --git a/flaskr/static/style.css b/ustayml/static/style.css index 1a73cc5..1a73cc5 100644 --- a/flaskr/static/style.css +++ b/ustayml/static/style.css diff --git a/flaskr/templates/auth/login.html b/ustayml/templates/auth/login.html index b7dd5dc..b7dd5dc 100644 --- a/flaskr/templates/auth/login.html +++ b/ustayml/templates/auth/login.html diff --git a/flaskr/templates/auth/register.html b/ustayml/templates/auth/register.html index a3c73cc..a3c73cc 100644 --- a/flaskr/templates/auth/register.html +++ b/ustayml/templates/auth/register.html diff --git a/flaskr/templates/base.html b/ustayml/templates/base.html index 6ea4864..1b2c384 100644 --- a/flaskr/templates/base.html +++ b/ustayml/templates/base.html @@ -1,9 +1,9 @@ <!doctype html> -<title>{% block title %}{% endblock %} - Flaskr</title> +<title>{% block title %}{% endblock %} - u-stayML</title> <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> <nav> - <h1><a href="{{ url_for('index') }}">Flaskr</a></h1> + <h1><a href="{{ url_for('index') }}">u-stayML</a></h1> <ul> {% if g.user %} <li><span>{{ g.user['username'] }}</span> diff --git a/flaskr/templates/blog/create.html b/ustayml/templates/blog/create.html index 88e31e4..88e31e4 100644 --- a/flaskr/templates/blog/create.html +++ b/ustayml/templates/blog/create.html diff --git a/flaskr/templates/blog/index.html b/ustayml/templates/blog/index.html index 0fb2e80..0fb2e80 100644 --- a/flaskr/templates/blog/index.html +++ b/ustayml/templates/blog/index.html diff --git a/flaskr/templates/blog/update.html b/ustayml/templates/blog/update.html index 7420f57..7420f57 100644 --- a/flaskr/templates/blog/update.html +++ b/ustayml/templates/blog/update.html diff --git a/flaskr/views/auth.py b/ustayml/views/auth.py index 2dc32af..92710a1 100644 --- a/flaskr/views/auth.py +++ b/ustayml/views/auth.py @@ -6,7 +6,7 @@ from flask import ( Blueprint, flash, g, redirect, render_template, request, session, url_for ) from werkzeug.security import check_password_hash, generate_password_hash -from flaskr.db import get_db +from ustayml.db import get_db bp = Blueprint('auth', __name__, url_prefix='/auth') diff --git a/flaskr/views/blog.py b/ustayml/views/blog.py index 6f728ea..57ba4ba 100644 --- a/flaskr/views/blog.py +++ b/ustayml/views/blog.py @@ -3,8 +3,8 @@ from flask import ( ) from werkzeug.exceptions import abort -from flaskr.views.auth import login_required -from flaskr.db import get_db +from ustayml.views.auth import login_required +from ustayml.db import get_db # NOTE: no URL prefix bp = Blueprint('blog', __name__) diff --git a/ustayml/views/dashboard.py b/ustayml/views/dashboard.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ustayml/views/dashboard.py |
