Skip to content

Commit

Permalink
fix: update django-sql steps (#456)
Browse files Browse the repository at this point in the history
* fix: update django-sql steps

Signed-off-by: Animesh Pathak <kurosakiichigo.songoku@gmail.com>

* fix: update django-sql steps

Signed-off-by: Animesh Pathak <kurosakiichigo.songoku@gmail.com>

---------

Signed-off-by: Animesh Pathak <kurosakiichigo.songoku@gmail.com>
  • Loading branch information
Sonichigo authored Sep 4, 2024
1 parent bac8046 commit 695e74a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion versioned_docs/version-2.0.0/quickstart/go-gin-redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ docker build -t gin-app:1.0 .
### Capture the test-cases-

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

🔥**Make some API calls**. Postman, Hoppscotch or even curl - take your pick!
Expand Down
32 changes: 20 additions & 12 deletions versioned_docs/version-2.0.0/quickstart/python-django-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ We will be using Docker compose to run the application as well as Postgres on Do
Start the Postgres instance using the `docker-compose` file-

```bash
docker compose up -d
docker compose up -d postgres
```

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

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

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

**5. Make a DELETE request**

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

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`.
Expand Down Expand Up @@ -265,17 +265,25 @@ We'll be running our sample application right on Linux, but just to make things

### 📼 Roll the Tape - Recording Time!

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

```bash
python3 manage.py makemigrations
python3 manage.py migrate
docker compose up -d postgres
```

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

```bash
docker compose up -d
#To setup the virtual environment, run:
python3 -m virtualenv venv
source venv/bin/activate
#To install dependencies, run:
pip3 install -r requirements.txt
# To create the required tables in the database, run:
python3 manage.py makemigrations
python3 manage.py migrate
```

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

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

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

**5. Make a DELETE request**

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

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`.
Expand Down

0 comments on commit 695e74a

Please sign in to comment.