Task #5 - Production
Coding → Deploy → Code-review
Coding
Preparations
- Install Python programming language v3.8.2: https://www.python.org/downloads/
- Install Flask framework with pip: https://docs.python.org/3/installing/index.html#basic-usage
- Install PyMongo and Flask PyMongo with pip
- Install MongoDB: https://docs.mongodb.com/manual/installation/
What you already have after task #4
- Flask web application, which can authenticate user with password:
- Listen on
localhost:5000
- Render authentication form on
http://localhost:5000/
- Return static images and files on
http://localhost:5000/static/<image_name>
- Has secret page for authenticated users on
http://localhost:5000/cabinet
- Listen on
- Valid usernames and passwords are stored in MongoDB database
Basic part
- Add image upload function in cabinet
http://localhost:5000/cabinet/
- Image should be saved to
upload
folder
Optimal part
- Add file extension checks
- Add function that returns uploaded image
http://localhost:5000/upload/<image_name>.png
- Show user’s avatar in
cabinet
(you can store link to the file in cookie or database)
Challenging part
- Store the whole file in MongoDB
Deploy
- Register on GitHub: https://github.com/
- Join our organization: https://github.com/itmo-wad/
- You can create new personal repository or use repository for the previous tasks (but don’t remove old files, just append new directories)
- Commit and push your sources to GitHub. And don’t forget to describe shortly what have you done in
README.md
file. Use Markdown format: https://guides.github.com/features/mastering-markdown/
Code-review
- Communicate in Telegram chat
- Help others to complete the assignment