diff --git a/Procfile b/Procfile index 42b486c..8001d1a 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn app.main:create_app +web: gunicorn app:app \ No newline at end of file diff --git a/app/__pycache__/funcoes.cpython-39.pyc b/app/__pycache__/funcoes.cpython-39.pyc deleted file mode 100644 index 1365b54..0000000 Binary files a/app/__pycache__/funcoes.cpython-39.pyc and /dev/null differ diff --git a/app/__pycache__/main.cpython-39.pyc b/app/__pycache__/main.cpython-39.pyc deleted file mode 100644 index f3cc8be..0000000 Binary files a/app/__pycache__/main.cpython-39.pyc and /dev/null differ diff --git a/app/main.py b/app/main.py deleted file mode 100644 index e29d760..0000000 --- a/app/main.py +++ /dev/null @@ -1,45 +0,0 @@ -from flask import Flask, render_template, redirect, url_for, request -import requests -from . import funcoes - - -def create_app(): - app = Flask(__name__) - - @app.route("/") - def index(): - return render_template('index.html') - - @app.route("/busca", methods=["GET", "POST"]) - def search(): - lista_livros = [] - if request.method == "POST": - livro = request.form["book_name"] - lista_livros = funcoes.search_book(busca=livro) - return render_template('search.html', books=lista_livros) - - @app.route("/biblioteca") - def library(): - return render_template('library.html') - - @app.route("/biblioteca/") - def add_book_library(isbn): - print(isbn) - return render_template('library.html') - - @app.route("/cadastrar") - def register(): - return "Aba cadastrar" - - @app.route("/login") - def login(): - return "Aba login" - - @app.route("/logout") - def log_out(): - return "Aba logout" - return app - -# if __name__ == "__main__": -# app.run(debug=True) - diff --git a/app/funcoes.py b/funcoes.py similarity index 100% rename from app/funcoes.py rename to funcoes.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..e980f24 --- /dev/null +++ b/main.py @@ -0,0 +1,44 @@ +from flask import Flask, render_template, redirect, url_for, request +import requests + +import funcoes + +app = Flask(__name__) + +@app.route("/") +def index(): + return render_template('index.html') + +@app.route("/busca", methods=["GET", "POST"]) +def search(): + lista_livros = [] + if request.method == "POST": + livro = request.form["book_name"] + lista_livros = funcoes.search_book(busca=livro) + return render_template('search.html', books=lista_livros) + +@app.route("/biblioteca") +def library(): + return render_template('library.html') + +@app.route("/biblioteca/") +def add_book_library(isbn): + print(isbn) + return render_template('library.html') + +@app.route("/cadastrar") +def register(): + return "Aba cadastrar" + +@app.route("/login") +def login(): + return "Aba login" + +@app.route("/logout") +def log_out(): + return "Aba logout" + + +if __name__ == "__main__": + app.run(debug=True) + diff --git a/app/parameters.py b/parameters.py similarity index 100% rename from app/parameters.py rename to parameters.py diff --git a/app/static/bootstrap/css/bootstrap.min.css b/static/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/static/bootstrap/css/bootstrap.min.css rename to static/bootstrap/css/bootstrap.min.css diff --git a/app/static/bootstrap/js/bootstrap.min.js b/static/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/static/bootstrap/js/bootstrap.min.js rename to static/bootstrap/js/bootstrap.min.js diff --git a/app/static/fonts/FontAwesome.otf b/static/fonts/FontAwesome.otf similarity index 100% rename from app/static/fonts/FontAwesome.otf rename to static/fonts/FontAwesome.otf diff --git a/app/static/fonts/font-awesome.min.css b/static/fonts/font-awesome.min.css similarity index 100% rename from app/static/fonts/font-awesome.min.css rename to static/fonts/font-awesome.min.css diff --git a/app/static/fonts/fontawesome-webfont.eot b/static/fonts/fontawesome-webfont.eot similarity index 100% rename from app/static/fonts/fontawesome-webfont.eot rename to static/fonts/fontawesome-webfont.eot diff --git a/app/static/fonts/fontawesome-webfont.svg b/static/fonts/fontawesome-webfont.svg similarity index 100% rename from app/static/fonts/fontawesome-webfont.svg rename to static/fonts/fontawesome-webfont.svg diff --git a/app/static/fonts/fontawesome-webfont.ttf b/static/fonts/fontawesome-webfont.ttf similarity index 100% rename from app/static/fonts/fontawesome-webfont.ttf rename to static/fonts/fontawesome-webfont.ttf diff --git a/app/static/fonts/fontawesome-webfont.woff b/static/fonts/fontawesome-webfont.woff similarity index 100% rename from app/static/fonts/fontawesome-webfont.woff rename to static/fonts/fontawesome-webfont.woff diff --git a/app/static/fonts/fontawesome-webfont.woff2 b/static/fonts/fontawesome-webfont.woff2 similarity index 100% rename from app/static/fonts/fontawesome-webfont.woff2 rename to static/fonts/fontawesome-webfont.woff2 diff --git a/app/static/img/background_livro.jpg b/static/img/background_livro.jpg similarity index 100% rename from app/static/img/background_livro.jpg rename to static/img/background_livro.jpg diff --git a/app/static/img/background_livro_2.jpg b/static/img/background_livro_2.jpg similarity index 100% rename from app/static/img/background_livro_2.jpg rename to static/img/background_livro_2.jpg diff --git a/app/static/img/downloads-bg.jpg b/static/img/downloads-bg.jpg similarity index 100% rename from app/static/img/downloads-bg.jpg rename to static/img/downloads-bg.jpg diff --git a/app/static/img/intro-bg.jpg b/static/img/intro-bg.jpg similarity index 100% rename from app/static/img/intro-bg.jpg rename to static/img/intro-bg.jpg diff --git a/app/static/img/pexels-wendy-van-zyl-1112048.jpg b/static/img/pexels-wendy-van-zyl-1112048.jpg similarity index 100% rename from app/static/img/pexels-wendy-van-zyl-1112048.jpg rename to static/img/pexels-wendy-van-zyl-1112048.jpg diff --git a/app/static/js/grayscale.js b/static/js/grayscale.js similarity index 100% rename from app/static/js/grayscale.js rename to static/js/grayscale.js diff --git a/app/static/style/style.css b/static/style/style.css similarity index 100% rename from app/static/style/style.css rename to static/style/style.css diff --git a/app/templates/assets/bootstrap/css/bootstrap.min.css b/templates/assets/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/templates/assets/bootstrap/css/bootstrap.min.css rename to templates/assets/bootstrap/css/bootstrap.min.css diff --git a/app/templates/assets/bootstrap/js/bootstrap.min.js b/templates/assets/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/templates/assets/bootstrap/js/bootstrap.min.js rename to templates/assets/bootstrap/js/bootstrap.min.js diff --git a/app/templates/assets/fonts/FontAwesome.otf b/templates/assets/fonts/FontAwesome.otf similarity index 100% rename from app/templates/assets/fonts/FontAwesome.otf rename to templates/assets/fonts/FontAwesome.otf diff --git a/app/templates/assets/fonts/font-awesome.min.css b/templates/assets/fonts/font-awesome.min.css similarity index 100% rename from app/templates/assets/fonts/font-awesome.min.css rename to templates/assets/fonts/font-awesome.min.css diff --git a/app/templates/assets/fonts/fontawesome-webfont.eot b/templates/assets/fonts/fontawesome-webfont.eot similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.eot rename to templates/assets/fonts/fontawesome-webfont.eot diff --git a/app/templates/assets/fonts/fontawesome-webfont.svg b/templates/assets/fonts/fontawesome-webfont.svg similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.svg rename to templates/assets/fonts/fontawesome-webfont.svg diff --git a/app/templates/assets/fonts/fontawesome-webfont.ttf b/templates/assets/fonts/fontawesome-webfont.ttf similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.ttf rename to templates/assets/fonts/fontawesome-webfont.ttf diff --git a/app/templates/assets/fonts/fontawesome-webfont.woff b/templates/assets/fonts/fontawesome-webfont.woff similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.woff rename to templates/assets/fonts/fontawesome-webfont.woff diff --git a/app/templates/assets/fonts/fontawesome-webfont.woff2 b/templates/assets/fonts/fontawesome-webfont.woff2 similarity index 100% rename from app/templates/assets/fonts/fontawesome-webfont.woff2 rename to templates/assets/fonts/fontawesome-webfont.woff2 diff --git a/app/templates/assets/img/background_livro.jpg b/templates/assets/img/background_livro.jpg similarity index 100% rename from app/templates/assets/img/background_livro.jpg rename to templates/assets/img/background_livro.jpg diff --git a/app/templates/assets/img/background_livro_2.jpg b/templates/assets/img/background_livro_2.jpg similarity index 100% rename from app/templates/assets/img/background_livro_2.jpg rename to templates/assets/img/background_livro_2.jpg diff --git a/app/templates/assets/img/downloads-bg.jpg b/templates/assets/img/downloads-bg.jpg similarity index 100% rename from app/templates/assets/img/downloads-bg.jpg rename to templates/assets/img/downloads-bg.jpg diff --git a/app/templates/assets/img/intro-bg.jpg b/templates/assets/img/intro-bg.jpg similarity index 100% rename from app/templates/assets/img/intro-bg.jpg rename to templates/assets/img/intro-bg.jpg diff --git a/app/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg b/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg similarity index 100% rename from app/templates/assets/img/pexels-wendy-van-zyl-1112048.jpg rename to templates/assets/img/pexels-wendy-van-zyl-1112048.jpg diff --git a/app/templates/assets/js/grayscale.js b/templates/assets/js/grayscale.js similarity index 100% rename from app/templates/assets/js/grayscale.js rename to templates/assets/js/grayscale.js diff --git a/app/templates/home_page.html b/templates/home_page.html similarity index 100% rename from app/templates/home_page.html rename to templates/home_page.html diff --git a/app/templates/index.html b/templates/index.html similarity index 100% rename from app/templates/index.html rename to templates/index.html diff --git a/app/templates/library.html b/templates/library.html similarity index 100% rename from app/templates/library.html rename to templates/library.html diff --git a/app/templates/search.html b/templates/search.html similarity index 100% rename from app/templates/search.html rename to templates/search.html