diff --git a/Flask/1.text b/Flask/1.text new file mode 100644 index 0000000..9b6a77c --- /dev/null +++ b/Flask/1.text @@ -0,0 +1,4 @@ +import requests + +requests.post('http://localhost:5000/api/v1/users', json={}, headers={'Content-Type': 'application/json'}) +requests.get('http://localhost:5000/api/v1/users').json() \ No newline at end of file diff --git a/Flask/README.md b/Flask/README.md new file mode 100644 index 0000000..ceeb317 --- /dev/null +++ b/Flask/README.md @@ -0,0 +1 @@ +# GigaAsessor \ No newline at end of file diff --git a/Flask/__pycache__/db.cpython-38.pyc b/Flask/__pycache__/db.cpython-38.pyc new file mode 100644 index 0000000..ba7aaa8 Binary files /dev/null and b/Flask/__pycache__/db.cpython-38.pyc differ diff --git a/Flask/__pycache__/user_resources.cpython-38.pyc b/Flask/__pycache__/user_resources.cpython-38.pyc new file mode 100644 index 0000000..7bafa7c Binary files /dev/null and b/Flask/__pycache__/user_resources.cpython-38.pyc differ diff --git a/Flask/db.py b/Flask/db.py new file mode 100644 index 0000000..5247a56 --- /dev/null +++ b/Flask/db.py @@ -0,0 +1,13 @@ +import sqlite3 + +con = sqlite3.connect('db.sqlite', check_same_thread=False) + + +def db_init(path): + global con + + with con: + con.execute("""CREATE TABLE IF NOT EXISTS User ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + login TEXT + )""") diff --git a/Flask/db.sqlite b/Flask/db.sqlite new file mode 100644 index 0000000..3a090e6 Binary files /dev/null and b/Flask/db.sqlite differ diff --git a/Flask/main.py b/Flask/main.py new file mode 100644 index 0000000..4a72645 --- /dev/null +++ b/Flask/main.py @@ -0,0 +1,22 @@ +from flask import Flask, render_template +from flask_restful import Api + +from user_resources import UserListResource +from db import db_init, con + +app = Flask(__name__) +app.config['DEBUG'] = True + +api = Api(app) +api.add_resource(UserListResource, '/api/v1/users') + + +@app.route('/') +def index(): + return render_template('index.html') + + +if __name__ == '__main__': + db_init('db.sqlite') + print(con) + app.run('127.0.0.1', 5000) \ No newline at end of file diff --git a/Flask/requirements.txt b/Flask/requirements.txt new file mode 100644 index 0000000..02ee5eb --- /dev/null +++ b/Flask/requirements.txt @@ -0,0 +1,25 @@ +aniso8601==9.0.1 +blinker==1.6.2 +certifi==2023.5.7 +charset-normalizer==3.1.0 +click==8.1.3 +colorama==0.4.6 +exceptiongroup==1.1.1 +Flask==2.3.2 +Flask-RESTful==0.3.9 +idna==3.4 +importlib-metadata==6.6.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.2 +packaging==23.1 +pluggy==1.0.0 +pytest==7.3.1 +pytz==2023.3 +requests==2.30.0 +six==1.16.0 +tomli==2.0.1 +urllib3==2.0.2 +Werkzeug==2.3.3 +zipp==3.15.0 diff --git a/Flask/static/assets/background.jpg b/Flask/static/assets/background.jpg new file mode 100644 index 0000000..293a7be Binary files /dev/null and b/Flask/static/assets/background.jpg differ diff --git a/Flask/static/assets/dc.jpeg b/Flask/static/assets/dc.jpeg new file mode 100644 index 0000000..2847d1f Binary files /dev/null and b/Flask/static/assets/dc.jpeg differ diff --git a/Flask/static/assets/tg.jpeg b/Flask/static/assets/tg.jpeg new file mode 100644 index 0000000..dda7730 Binary files /dev/null and b/Flask/static/assets/tg.jpeg differ diff --git a/Flask/static/css/index.css b/Flask/static/css/index.css new file mode 100644 index 0000000..4548d2e --- /dev/null +++ b/Flask/static/css/index.css @@ -0,0 +1,18 @@ +.banner { + background: url(../assets/background.jpg); + color: white; + margin: 15px 0; +} + +.use { + color: white; +} + +.bot { + max-width: 500px; + flex-grow: 1; + outline: solid #94b9f1 2px; + + border-radius: 21px; +} + diff --git a/Flask/static/favicon.png b/Flask/static/favicon.png new file mode 100644 index 0000000..a6fc97c Binary files /dev/null and b/Flask/static/favicon.png differ diff --git a/Flask/templates/index.html b/Flask/templates/index.html new file mode 100644 index 0000000..79349ad --- /dev/null +++ b/Flask/templates/index.html @@ -0,0 +1,96 @@ + + +
+ + + +