Task #4 - Database
Reading → Coding → Deploy → Code-review
Reading
- MongoDB get started: https://docs.mongodb.com/manual/tutorial/getting-started/
- Pymongo: https://api.mongodb.com/python/current/tutorial.html
- Flask pymongo: https://flask-pymongo.readthedocs.io/en/latest/
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/
Basic part
- Create 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 should be stored in MongoDB database
- You are allowed to use any JS or CSS frameworks
- You are allowed to use only Python programming language and Flask framework
- You are allowed to use only MongoDB as database
Optimal part
- Add registration function to append new users on
http://localhost:5000/register/
- You can keep usernames/passwords only in MongoDB
Challenging part
(Part for those, who already knows all that stuff)
- Implement
password change
feature - Fill database with 1 thousand, 1 million, 10 million, … users with the help of Faker library
- Add index to username and measure how response time is changed depending on the number of users. Results of the research append to the README.md file
- You can draw a graph
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/ - Also save data from MongoDB as dump or as simple JSON file in the repository
Code-review
- Communicate in Telegram chat
- Help others to complete the assignment