Skip to content

Commit 695e74a

Browse files
authored
fix: update django-sql steps (#456)
* fix: update django-sql steps Signed-off-by: Animesh Pathak <[email protected]> * fix: update django-sql steps Signed-off-by: Animesh Pathak <[email protected]> --------- Signed-off-by: Animesh Pathak <[email protected]>
1 parent bac8046 commit 695e74a

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

versioned_docs/version-2.0.0/quickstart/go-gin-redis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ docker build -t gin-app:1.0 .
6666
### Capture the test-cases-
6767

6868
```shell
69-
keploy record -c "docker run -p 3001:3001 --name RediApp --network <networkName> --name ginRedisApp gin-app:1.0"
69+
keploy record -c "docker run -p 3001:3001 --network <networkName> --name ginRedisApp gin-app:1.0"
7070
```
7171

7272
🔥**Make some API calls**. Postman, Hoppscotch or even curl - take your pick!

versioned_docs/version-2.0.0/quickstart/python-django-sql.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ We will be using Docker compose to run the application as well as Postgres on Do
5656
Start the Postgres instance using the `docker-compose` file-
5757

5858
```bash
59-
docker compose up -d
59+
docker compose up -d postgres
6060
```
6161

6262
Change the database configuration in `django_postgres/settings.py` file to:
@@ -116,7 +116,7 @@ curl --location 'http://127.0.0.1:8000/user/'
116116
**3. Make a PUT request**
117117

118118
```bash
119-
curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b045-dc74840aa82b/' \
119+
curl --location --request PUT 'http://127.0.0.1:8000/user/<USER_ID>' \
120120
--header 'Content-Type: application/json' \
121121
--data-raw ' {
122122
"name": "Jane Smith",
@@ -129,13 +129,13 @@ curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b04
129129
**4. Make a GET request**
130130

131131
```bash
132-
curl --location 'http://127.0.0.1:8000/user/c793c752-ad95-4cff-8cbe-5715a1e8a76e/'
132+
curl --location 'http://127.0.0.1:8000/user/<USER_ID>'
133133
```
134134

135135
**5. Make a DELETE request**
136136

137137
```bash
138-
curl --location --request DELETE 'http://127.0.0.1:8000/user/ee2af3fc-0503-4a6a-a452-b7d8c87a085b/'
138+
curl --location --request DELETE 'http://127.0.0.1:8000/user/<USER_ID>'
139139
```
140140

141141
Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.
@@ -265,17 +265,25 @@ We'll be running our sample application right on Linux, but just to make things
265265

266266
### 📼 Roll the Tape - Recording Time!
267267

268-
To create the required tables in the database, run:
268+
Using the docker-compose file we will start our Postgres instance:-
269269

270270
```bash
271-
python3 manage.py makemigrations
272-
python3 manage.py migrate
271+
docker compose up -d postgres
273272
```
274273

275-
Using the docker-compose file we will start our Postgres instance:-
274+
Now let's get the app up and running:
276275

277276
```bash
278-
docker compose up -d
277+
#To setup the virtual environment, run:
278+
python3 -m virtualenv venv
279+
source venv/bin/activate
280+
281+
#To install dependencies, run:
282+
pip3 install -r requirements.txt
283+
284+
# To create the required tables in the database, run:
285+
python3 manage.py makemigrations
286+
python3 manage.py migrate
279287
```
280288

281289
Ready, set, record! Here's how:
@@ -314,7 +322,7 @@ curl --location 'http://127.0.0.1:8000/user/'
314322
**3. Make a PUT request**
315323

316324
```bash
317-
curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b045-dc74840aa82b/' \
325+
curl --location --request PUT 'http://127.0.0.1:8000/user/<USER_ID>' \
318326
--header 'Content-Type: application/json' \
319327
--data-raw ' {
320328
"name": "Jane Smith",
@@ -327,13 +335,13 @@ curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b04
327335
**4. Make a GET request**
328336

329337
```bash
330-
curl --location 'http://127.0.0.1:8000/user/c793c752-ad95-4cff-8cbe-5715a1e8a76e/'
338+
curl --location 'http://127.0.0.1:8000/user/<USER_ID>'
331339
```
332340

333341
**5. Make a DELETE request**
334342

335343
```bash
336-
curl --location --request DELETE 'http://127.0.0.1:8000/user/ee2af3fc-0503-4a6a-a452-b7d8c87a085b/'
344+
curl --location --request DELETE 'http://127.0.0.1:8000/user/<USER_ID>'
337345
```
338346

339347
Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`.

0 commit comments

Comments
 (0)