this site was created as a study assignment for Irkutsk State University (ISU). On assignment, we had to create a website with memes. It should support uploading new memes, viewing those already uploaded as a feed, authorizing and registering new users, and also allow users to rate posts with "like" or "dislike"
THIS VERSION IS LINUX ONLY
If you need version for windows check the windows-edition
- Install
Python 3.x
- Download the project
- type in terminal/console
pip install -r requirements.txt
or
pip install Flask==1.1.4
pip install Werkzeug==1.0.1
pip install bcrypt
- Download gunicorn
pip install gunicorn
- Create
wsgi.py
, import the application there and paste the fragment with the application launch (ore use one from preository) - Execute command
sudo nano /etc/systemd/system/flask-retromemes-app.socket
and wrtie
[unit]
Description=flask-retromemes-app socket
[Socket]
ListenStream=/run/flask-retromemes-app.sock * WORKING DIRECTORY*
[Install]
WantedBy=sockets.target
- After, execute command
systemctl start flask-retromemes-app.socket
- After:
systemctl enable flask-retromemes-app.socket
A .sock file will appear. - Execute
nano /etc/systemd/system/flask-retromemes-app.service
and write:
[unit]
Description=flask-retromemes-app.service
Requirements=flask-retromemes-app.socket
After=network.target
[Service]
user=user
group=user
WorkingDirectory=/home/user/flaskapp
ExecStart=/usr/bin/gunicorn --workers 3 \
--bind unix:*PATH_TO_SOCK* wsgi:app
[Install]
WantedBy=multi-user.target
-
In nginx, create a new site based on the default one, remove
try files...
inlocation
/ and insertproxy_pass http://unix:*PATH_TO_SOCK*
into this block -
service flask-retromemes-app start
-
Profit!
User's page is the page for account's owner. There the user can look at memes uploaded by his/her hands or do some activities, if the user is an administrator
User roles can be divided into 3 groups. The first and most numerous are ordinary users. They can upload memes and delete uploaded by them ones. The second group is moderators, they can remove any memes from the site. And the third and last group, administrators. They have the same powers to delete posts as moderators, and they can also promote / demote other users, including moderators.