v3.0.1 update: Gunicorn and og meta tags

This commit is contained in:
Vivek Santayana 2021-11-03 10:59:14 +00:00
parent 6859b75825
commit f0286d7013
6 changed files with 32 additions and 4 deletions

View File

@ -2,4 +2,4 @@ FROM python:3.10-alpine
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["python","app.py"]
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]

View File

@ -51,10 +51,17 @@ This can be changed by amending the `docker-compose.yml` entry on `line 8` to:
## Version History
### Current Version: 3.0.0 (1 November 2021)
### Current Version: 3.0.1 (3 November 2021)
### Changelog
- Serving the web app using Gunicorn so it can handle multiple requests.
- Added OpenGraph and other social media meta tags to allow for sharing on social media.
### Past Versions
#### Version 3.0.0
- Re-built the quiz to run on the server side rather than on the client.
- Built using Python, Flask, Jinja, and html primarily.
- Changed the layout to a cleaner, more accessible and modern style using the Bootstrap CSS framework,
@ -62,8 +69,6 @@ This can be changed by amending the `docker-compose.yml` entry on `line 8` to:
- Refined the algorithm by which the Joined duplicates another playbook based on the second-highest scoring match rather than selecting a playbook entirely at random.
- Dockerised the quiz and hosting it on my web server, serving it via the front-end reverse proxy.
### Past Versions
Because I only started using Git relatively recently, I have not uploaded the code from the older versions onto the repo.
The repo starts with version 3.

View File

@ -25,6 +25,7 @@
<title>
{% block title %}{% endblock %} | Which Masks Playbook Are You? &mdash; a Personality Quiz
</title>
{% include "og-meta.html" %}
</head>
<body>

View File

@ -0,0 +1,17 @@
<meta name="description" content="A personality quiz to find out which Masks playbook you are." />
<meta property="og:locale" content="en_UK" />
<meta property="og:type" content="website" />
<meta property="og:description" content="A personality quiz to find out which Masks playbook you are." />
<meta property="og:url" content="https://masks.vsnt.uk{{ url_for(request.endpoint, **request.view_args) }}" />
<meta property="og:site_name" content="Masks Personality Quiz | V.S." />
<meta property="og:image" content="https://masks.vsnt.uk{{ url_for('static', filename='favicon.png') }}" />
<meta property="og:image:alt" content="Logo of the Masks Personality Quiz" />
<meta property="og:image:width" content="1024" />
<meta property="og:image:height" content="1024" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="A personality quiz to find out which Masks playbook you are." />
<meta name="twitter:image" content="https://masks.vsnt.uk{{ url_for('static', filename='favicon.png') }}" />
<meta name="twitter:image:alt" content="Logo of the Masks Personality Quiz" />
<meta name="twitter:creator" content="@viveksantayana" />
<meta name="twitter:site" content="@viveksantayana" />
<meta name="theme-color" content="#343a40" />

View File

@ -1,6 +1,7 @@
click==8.0.3
colorama==0.4.4
Flask==2.0.2
gunicorn==20.1.0
itsdangerous==2.0.1
Jinja2==3.0.2
MarkupSafe==2.0.1

4
wsgi.py Normal file
View File

@ -0,0 +1,4 @@
from app import app
if __name__ == '__main__':
app.run()