Added starting project
This commit is contained in:
parent
22aa0df1e8
commit
fb95d9f10f
BIN
Visual Studio Code Projects/day-63-starting-files-library-project/.DS_Store
vendored
Normal file
BIN
Visual Studio Code Projects/day-63-starting-files-library-project/.DS_Store
vendored
Normal file
Binary file not shown.
@ -0,0 +1,33 @@
|
||||
from flask import Flask, render_template, request, redirect, url_for
|
||||
|
||||
'''
|
||||
Red underlines? Install the required packages first:
|
||||
Open the Terminal in PyCharm (bottom left).
|
||||
|
||||
On Windows type:
|
||||
python -m pip install -r requirements.txt
|
||||
|
||||
On MacOS type:
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
This will install the packages from requirements.txt for this project.
|
||||
'''
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
all_books = []
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
pass
|
||||
|
||||
|
||||
@app.route("/add")
|
||||
def add():
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
Flask==3.0.0
|
||||
flask_sqlalchemy==3.1.1
|
||||
SQLAlchemy==2.0.25
|
||||
@ -0,0 +1,17 @@
|
||||
# Tested on Python 3.13.1
|
||||
# =======================
|
||||
# In the terminal use:
|
||||
# pip install -r ./requirements_3.13.txt
|
||||
#
|
||||
blinker==1.9.0
|
||||
click==8.1.8
|
||||
colorama==0.4.6
|
||||
Flask==3.1.0
|
||||
Flask-SQLAlchemy==3.1.1
|
||||
greenlet==3.1.1
|
||||
itsdangerous==2.2.0
|
||||
Jinja2==3.1.5
|
||||
MarkupSafe==3.0.2
|
||||
SQLAlchemy==2.0.37
|
||||
typing_extensions==4.12.2
|
||||
Werkzeug==3.1.3
|
||||
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Add Book</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST">
|
||||
<label>Book Name</label>
|
||||
<input type="text" />
|
||||
<label>Book Author</label>
|
||||
<input type="text" />
|
||||
<label>Rating</label>
|
||||
<input type="text" />
|
||||
<button type="submit">Add Book</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Library</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>My Library</h1>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
|
||||
<a href="">Add New Book</a>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user