This is the website for a group-project aimed at assessing the quality of images using the subjective (rating-based) approach.
Our website https://siqa.pythonanywhere.com is currently live and reachable.
Be VERY CAREFUL when you push anything to this repo, as the WEBHOOK THAT AUTOMATICALLY REFRESHES THE SERVER may be active at any time.
IMPORTANT NOTICE (about flask, please read it)
Flask is the Python web-framework currently being used to develop the back-end of this website. It's simple and easy to use if you know some basic Python.
(But if anyone has any better proposals for a web framework in Python or Java, please notify the rest).
Flask requires a special syntax to link static resources to html-templates.
All of the static resources are to be placed in the 'static' folder, and eventually in sub-folders.
Example (linking a css file in html):
<link href="{{url_for('static', filename='stylesheets/general.css')}}" rel="stylesheet" type="text/css">
(This will tell flask to fetch general.css in the specified location within the static folder).
Relative links to any part of this website must be specified according to the names defined in the python decorators for the methods in app.py.
Examples:
# this gets called when the homepage (plain web-address) is requested.
@app.route("/")
def on_index():
pass
# this gets called when: webaddress/take_test is requested.
@app.route("/take_test")
def on_take_test():
pass
https://flask-restful.readthedocs.io/en/latest/quickstart.html
(or Stackoverflow).
That's all, thank you for taking the time to read this!
SETTING UP A LOCAL TESTING ENVIRONMENT
...and navigate to its root directory.
...calling it '.my_env'
(For gitignore-related reasons).
$ python3 -m venv .my_env
(You'll be prompted to install the 'venv' module if you don't have it yet).
$ source ./my_env/bin/activate
If this command doesn't work try with:
$ . .my_env/bin/activate
(You should notice that the console starts displaying the virtual environment's name before your username and the dollar-sign).
... on the virtual environment you just created:
(.my_env)$ pip install -r requirements.txt
(.my_env)$ python3 -m flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Click on the link, and the homepage will be launched on your default browser.
TIPS
To avoid a lot of frustration while debugging this, please try to turn caching off on your favourite browser: