Skip to content

Commit 6c746f4

Browse files
committed
feat(srv): update
1 parent 7a83e6e commit 6c746f4

File tree

3 files changed

+18
-5
lines changed
  • tutorials
    • hosting-django-webapp-serverless-containers
    • hosting-go-gin-webapp-serverless-containers
    • hosting-nextjs-webapp-serverless-containers

3 files changed

+18
-5
lines changed

tutorials/hosting-django-webapp-serverless-containers/index.mdx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ To host a [Django](https://www.djangoproject.com/) web application on **Scaleway
7575
└── venv/ # Virtual environment (excluded from Docker)
7676
```
7777

78-
5. Create a `requirements.txt` file:
78+
5. Create a `requirements.txt` file and add the following code to it:
7979
```txt
8080
Django==5.1.*
8181
gunicorn==21.2.*
8282
```
8383

84-
6. Test the app locally:
84+
6. Run the following command to test the app locally:
8585
```bash
8686
python manage.py runserver
8787
```
@@ -91,7 +91,7 @@ To host a [Django](https://www.djangoproject.com/) web application on **Scaleway
9191

9292
Before building and pushing your image, ensure you have [created a Scaleway Container Registry namespace](/container-registry/how-to/create-namespace/), and [logged into it with the Docker CLI](/container-registry/how-to/connect-docker-cli/)
9393

94-
1. Create a `Dockerfile` at the root of your project:
94+
1. Create a `Dockerfile` at the root of your Django app:
9595
```dockerfile
9696
# Use a lightweight Python image
9797
FROM python:3.11-slim
@@ -117,7 +117,17 @@ Before building and pushing your image, ensure you have [created a Scaleway Cont
117117
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "myproject.wsgi:application"]
118118
```
119119

120-
2. Build, tag, and push the image to Scaleway Container Registry:
120+
2. Edit the `settings.py` file of your project with the code below to allow the Scaleway endpoint corresponding to your region, and remove unwanted endpoints:
121+
122+
```py
123+
ALLOWED_HOSTS = [
124+
'.fr-par.scw.cloud',
125+
'.nl-ams.scw.cloud',
126+
'.pl-waw.scw.cloud'
127+
]
128+
```
129+
130+
3. Build, tag, and push the image to Scaleway Container Registry:
121131
```bash
122132
docker build \
123133
--platform linux/amd64 \

tutorials/hosting-go-gin-webapp-serverless-containers/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ usecase:
1717
ecosystem:
1818
- third-party
1919
---
20+
2021
import Requirements from '@macros/iam/requirements.mdx'
22+
2123
<Requirements />
24+
2225
- A Scaleway account logged into the [console](https://console.scaleway.com)
2326
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
2427
- Installed [Docker](https://docs.docker.com/get-started/get-docker/) or [Docker Engine](https://docs.docker.com/engine/install/)
2528
- [Created a Scaleway Container Registry namespace](/container-registry/how-to/create-namespace/) and [logged into it](/container-registry/how-to/connect-docker-cli/)
26-
```
29+
2730

2831
## Create and host a basic Go Gin web application
2932

File renamed without changes.

0 commit comments

Comments
 (0)