From cd6c0b1c4de65222d54c5aeeec1ea224d8982396 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Fri, 5 Apr 2024 17:12:29 +0200 Subject: [PATCH] Create folder isbn_sort --- init.sh | 2 +- app.py => isbn_sort/__init__.py | 4 ++-- book.py => isbn_sort/book.py | 0 isbn_db.py => isbn_sort/isbn_db.py | 2 +- schema.sql => isbn_sort/schema.sql | 0 {static => isbn_sort/static}/main.js | 0 {static => isbn_sort/static}/style.css | 0 {templates => isbn_sort/templates}/base.html | 0 {templates => isbn_sort/templates}/index.html | 0 requirements.txt | 3 ++- wsgi.py | 5 +++++ 11 files changed, 11 insertions(+), 5 deletions(-) rename app.py => isbn_sort/__init__.py (98%) rename book.py => isbn_sort/book.py (100%) rename isbn_db.py => isbn_sort/isbn_db.py (99%) rename schema.sql => isbn_sort/schema.sql (100%) rename {static => isbn_sort/static}/main.js (100%) rename {static => isbn_sort/static}/style.css (100%) rename {templates => isbn_sort/templates}/base.html (100%) rename {templates => isbn_sort/templates}/index.html (100%) create mode 100644 wsgi.py diff --git a/init.sh b/init.sh index a1b7f24..2546f81 100755 --- a/init.sh +++ b/init.sh @@ -11,4 +11,4 @@ if [ $? -eq 0 ]; then mv "data/$DATABASE" data/books-backup.db fi -sqlite3 "data/$DATABASE" < schema.sql \ No newline at end of file +sqlite3 "data/$DATABASE" < isbn_sort/schema.sql \ No newline at end of file diff --git a/app.py b/isbn_sort/__init__.py similarity index 98% rename from app.py rename to isbn_sort/__init__.py index a33d785..80f2457 100644 --- a/app.py +++ b/isbn_sort/__init__.py @@ -2,8 +2,8 @@ from flask import Flask, render_template, redirect, request, g, flash import secrets import json -from book import Book -import isbn_db +from .book import Book +from . import isbn_db, sse app = Flask(__name__) diff --git a/book.py b/isbn_sort/book.py similarity index 100% rename from book.py rename to isbn_sort/book.py diff --git a/isbn_db.py b/isbn_sort/isbn_db.py similarity index 99% rename from isbn_db.py rename to isbn_sort/isbn_db.py index 4dcce3e..95c67bc 100644 --- a/isbn_db.py +++ b/isbn_sort/isbn_db.py @@ -2,7 +2,7 @@ from flask import current_app from flask import g import sqlite3 -from book import Book +from .book import Book def get_db(): """Connect to the application's configured database. The connection diff --git a/schema.sql b/isbn_sort/schema.sql similarity index 100% rename from schema.sql rename to isbn_sort/schema.sql diff --git a/static/main.js b/isbn_sort/static/main.js similarity index 100% rename from static/main.js rename to isbn_sort/static/main.js diff --git a/static/style.css b/isbn_sort/static/style.css similarity index 100% rename from static/style.css rename to isbn_sort/static/style.css diff --git a/templates/base.html b/isbn_sort/templates/base.html similarity index 100% rename from templates/base.html rename to isbn_sort/templates/base.html diff --git a/templates/index.html b/isbn_sort/templates/index.html similarity index 100% rename from templates/index.html rename to isbn_sort/templates/index.html diff --git a/requirements.txt b/requirements.txt index 8ab6294..5eaf725 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -flask \ No newline at end of file +flask +requests \ No newline at end of file diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..2749a5b --- /dev/null +++ b/wsgi.py @@ -0,0 +1,5 @@ +#!/usr/bin/python3 +from isbn_sort import app + +if __name__ == "__main__": + app.run()