diff --git a/.gitignore b/.gitignore index ed8ebf5..23ed2b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -__pycache__ \ No newline at end of file +__pycache__ +venv/ \ No newline at end of file diff --git a/README.md b/README.md index b3f45de..e8cef61 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Project based on [Virtual Air Traffic Simulation Network (VATSIM) API](https://vatsim.dev/). -Written in Python 3.7.10 + JS (JQuery framework) + Boostrap +Written in Python 3.8.18 + JS (JQuery framework) + Boostrap ## Startup For run application on your own machine, you must install docker. Then just one command in the "src" folder with the project source code: @@ -25,6 +25,20 @@ Any help with this project would be greatly appreciated. Fixes or some features VATSIM Fox is free software, open to suggestions and contributions. All the files are under the MIT License. +### How to set virtual environment + +```bash +# you must be in "src" folder before init +cd src + +python -m venv venv +.\venv\Scripts\activate + +# downloading requirements && upgrading pip +python -m pip install --upgrade pip +python -m pip install -r requirements.txt +``` + ## Feature There is small TODO list I would like to make in this project: diff --git a/setup.cfg b/setup.cfg index 16dcbf3..1d800fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,2 @@ [flake8] -exclude = .git, pycache, .env, .venv -max-line-length = 120 \ No newline at end of file +exclude = .git, pycache, .env, .venv \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile index dd45b5b..fa48558 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7.10 +FROM python:3.8.18 WORKDIR /build/ diff --git a/src/app.py b/src/app.py index 9135d1e..00d3658 100644 --- a/src/app.py +++ b/src/app.py @@ -1,5 +1,5 @@ -from flask import Flask, render_template, abort, request, jsonify import requests +from flask import Flask, render_template, abort, request, jsonify app = Flask(__name__) @@ -15,14 +15,12 @@ def index_page(): def errorhandler_page(_): return render_template("4O4.html"), 404 -# Custom wrapper to fetch VATSIM data + @app.route("/api/request") def request_handler(): - request_string = request.args.get("request_string") - - if request_string: + if request_string := request.args.get("request_string"): return requests.get(f"{VATSIM_API_URL}{request_string}").json() - + return jsonify({"result": "not found"}) diff --git a/src/templates/4O4.html b/src/templates/4O4.html index eb51781..0624252 100644 --- a/src/templates/4O4.html +++ b/src/templates/4O4.html @@ -2,11 +2,11 @@ {% block title %}404 - Not Found / VATSIM Fox{% endblock %} {% block content %}
-
-

4O4 - Page Not Found

- - - -
+
+

4O4 - Page Not Found

+ + + +
{% endblock %} \ No newline at end of file diff --git a/src/templates/include/template.html b/src/templates/include/template.html index ffc0ab8..ed73ee1 100644 --- a/src/templates/include/template.html +++ b/src/templates/include/template.html @@ -2,7 +2,7 @@ - + @@ -18,25 +18,19 @@ {% block header_css %}{% endblock %}
- 🦊 VATSIM Fox
- - {% block content %}{% endblock %}