Best Flask open-source libraries and packages

Flask retromemes app

Retromemes.net - small flask based website to view/upload memes and something else
Updated 1 year ago

Retromemes.net - small flask based website

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

How to setup this application with nginx and run?

  1. Install Python 3.x
  2. Download the project
  3. 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
  1. Download gunicorn pip install gunicorn
  2. Create wsgi.py, import the application there and paste the fragment with the application launch (ore use one from preository)
  3. 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
  1. After, execute command systemctl start flask-retromemes-app.socket
  2. After: systemctl enable flask-retromemes-app.socket A .sock file will appear.
  3. 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
  1. In nginx, create a new site based on the default one, remove try files... in location / and insert proxy_pass http://unix:*PATH_TO_SOCK* into this block

  2. service flask-retromemes-app start

  3. Profit!

Database structure

alt text

Pages of the site

Authorizarion and Registration

alt text

alt text

Memes upload page

alt text

Feed

alt text

And if there are too many memes

alt text

User's page

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

alt text

About roles

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.

alt text

alt text

alt text

Custom pages for errors (500, 404, etc)

Error 500

alt text

Error 404

alt text

Error 400

alt text

Error 403

alt image

alt image

Developed by

  1. Vadim Nechaev
  2. Vladislav Novikov
  3. Egor Pristavka

Links

  1. https://flask.palletsprojects.com/en/2.2.x/
  2. https://vk.com/whenangelsrise (https://vk.com/whenangelsrise?z=photo-162910245_456239052%2Fwall-162910245_34)
  3. https://images7.memedroid.com/images/UPLOADED903/6056582719c9c.jpeg