- Project link : https://daftcode-kvolkau.herokuapp.com/docs#/
- Course repo link : https://github.com/daftcode/daftacademy-python_levelup-spring2020
- Recruitment folder : recruitment task on dynamic programming.
The main idea of this part tasks was to write simple web app in python
and deploy it to Heroku with automatic deployment enabled.
The trickiest part was to understand, that uviciorn
for optimization purposes forks application, because web services should be stateless. In such situation global variables used for counting would be reset. As a solution was to decrease performance by blocking forking, but having only one instance of application running OR implement some kind of database with create and read functionality. I chose the second one with storage.csv
file as a database.
Note : "surename" is a misspelling in unit tests provided for us on repl.it
.
Those tasks were about understanding idea of decorators in python and creating decorators, similar to which we will use later in our web-app.
- added BasicAuth.
- added
login
andlogout
endpoints (method :POST
). - added templates : Jinja2Templates.
- added decorator
is_logged_in
checking, if request contains cookie "session_token".
- created new
fastapi
client - added example "chinook"
SQLite
database - connected to it using
sqlite3
module - performed
Create
,Read
,Update
operations on it