Skip to content

Commit

Permalink
change some code
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Feb 19, 2024
1 parent 84cfe96 commit 5b0e5d2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 26 deletions.
31 changes: 9 additions & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ include = ["src/feedback_linker/py.typed"]
python = ">=3.8.1,<4"
flask = ">=3.0.2"
flask-wtf = ">=1.2.1"
wtforms = "<3"
email-validator = ">=2.1.0.post1"
sqlalchemy = ">=2.0.27"
flask-sqlalchemy = ">=3.1.1"
types-wtforms = "^3.1.0.20240205"
sqlalchemy-stubs = "^0.4"


[tool.poetry.dev-dependencies]
pytest = ">=7.3.2"
Expand All @@ -48,6 +48,8 @@ mkdocstrings = ">=0.21.2"
mkdocstrings-python = ">=1.1.2"
makim = "1.13.0"
containers-sugar = "1.11.1"
types-wtforms = ">=3.1.0.20240205"
sqlalchemy-stubs = ">=0.4"

[tool.pytest.ini_options]
testpaths = [
Expand Down
2 changes: 1 addition & 1 deletion src/feedback_linker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
app = Flask(__name__)
app.config['SECRET_KEY'] = 'your_secret_key'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///feedback_linker.db'

init_app(app)


Expand Down Expand Up @@ -86,5 +87,4 @@ def submit_feedback() -> str:


if __name__ == '__main__':
db.create_all()
app.run(debug=True)
2 changes: 2 additions & 0 deletions src/feedback_linker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ class Feedback(BaseModel): # type: ignore[name-defined]
def init_app(app) -> None:
"""Initialize app for the database."""
db.init_app(app)
with app.app_context():
db.create_all()
19 changes: 18 additions & 1 deletion src/feedback_linker/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Feedback-Linker</title>
<link
href="{{ url_for('static', filename='css/bootstrap.min.css') }}"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"
integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+"
crossorigin="anonymous"
></script>
</head>
<body>
<header>
Expand Down

0 comments on commit 5b0e5d2

Please sign in to comment.