@@ -12,12 +12,11 @@ To run the Flask application, follow these steps:
12
12
cd flask-api-sqlite-db
13
13
```
14
14
15
- 1. ** Install, initialize and activate a virtualenv using:**
15
+ 1. ** Initialize and activate a virtualenv using:**
16
16
17
17
` ` ` bash
18
- pip install virtualenv
19
- python -m virtualenv venv
20
- source venv/bin/activate
18
+ python3 -m venv .venv
19
+ source .venv/bin/activate
21
20
` ` `
22
21
23
22
> ** Note** - In Windows, the ` venv` does not have a ` bin` directory. Therefore, you' d use the analogous command shown below:
@@ -26,20 +25,25 @@ To run the Flask application, follow these steps:
26
25
source venv\Scripts\activate
27
26
```
28
27
29
- 1. **Install the dependencies :**
28
+ 1. **Install the app as an editable package :**
30
29
31
30
```bash
32
- pip install -r requirements.txt
31
+ python3 -m pip install -e src
33
32
```
34
33
35
- 1. **Execute the following command in your terminal to start the flask app **
34
+ 1. **Execute the following command to add the database name and apply the migrations: **
36
35
37
36
```bash
38
37
export DATABASE_FILENAME=testdb.db
39
- export FLASK_APP=src.app
40
- export FLASK_ENV=development
41
- flask run --reload
38
+ python3 -m flask --app src.flaskapp db upgrade --directory src/flaskapp/migrations
42
39
```
40
+
41
+ 1. **Execute the following command to run the flask application:**
42
+
43
+ ```bash
44
+ python3 -m flask --app src.flaskapp run --reload
45
+ ```
46
+
43
47
### Run the tests
44
48
45
49
1. **Inside your virtual environment, execute the following command to run the tests**
0 commit comments