01 - Start
-
Clone the following repository:
git clone https://github.com/UOndro/pycon-2022.git
-
Then checkout
start
branchgit checkout start
`
We get a very basic skeleton of our application without the actual implementation. In our workshop, we will try to finish the implementation so all the cases in our assignment is covered.
Setting up the python environment
- Create python virtual environment
python3.10 -m venv venv
- Activate python virtual environment
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
QUESTION: Why is it good to create and use the virtual environment?
Click on me for the answer!
Using the virtual environment allows you to have different dependencies for each project. This means you can have different version of python packages. In addition to that, you can easily add or remove a packages without affecting other projects.
Test the application
After successfully setting your environment, you should be able to start your application.
python
app.py
QUESTION: For running our server we picked web framework Flask. Do you know any python alternatives to Flask? Does this alternative have any advantages/disadvantages compared to Flask?
Click on me for the answer!
There are many python web frameworks, e.g. FastAPI, Django, Starlette, and so on. Each of them has different advantages/disadvantages, e.g. Starlette is ideal for async programs. FastAPI also uses Starlette, but also provide more functionality. I picked flask, because we use it in Bloomreach.