Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Hosting an informational website
description: Learn about the different ways to deploy an informational website (blog, portfolio, showcase) with Scaleway.
tags: use-case informational-website website blog portfolio showcase
dates:
validation: 2025-05-15
validation: 2025-10-08
posted: 2025-05-15
---

Expand All @@ -16,6 +16,7 @@ Your informational website can be based on several different architectures, that
| Based on Object Storage | Cost-effective and highly available, suitable for static content. | Limited to serving static files, no server-side processing. |
| Based on Web Hosting | Easy to set up and manage, suitable for small to medium websites. | Less control over the environment, can be limited in terms of customization. |
| Based on Instances | Full control over the server environment, suitable for complex applications. | More complex setup and management, potentially higher costs. |
| Based on Serverless Containers | Easy to deploy, scalable performance and cost, for static and dynamic websites. | Limited control on underlying hardware. |
| Based on Elastic Metal (Aluminium) and Flexible IPs | Dedicated physical resources and high performance, suitable for demanding applications. | Higher costs, requires more technical expertise to manage. |

<Message type="note">
Expand Down Expand Up @@ -72,6 +73,18 @@ Hosting using Instances is a solution suited for users familiar with Unix operat

5. (Optional) Edit your WordPress settings to add your domain name.

## Hosting a website using Serverless Containers

1. [Register a domain name](/domains-and-dns/quickstart/#how-to-register-an-internal-domain/). Scaleway Domains and DNS allows you to manage and register your internal and external domains and configure and manage their DNS zones.

2. Containerize your application, then build and [push its image to the Scaleway Container Registry](/serverless-containers/how-to/build-push-container-image/).

3. [Deploy a Serverless Container](/serverless-containers/how-to/deploy-container/) based on your app image.

4. [Add a custom domain to your container](/serverless-containers/how-to/add-a-custom-domain-to-a-container/).

Refer to the [Containers use cases page](/serverless-containers/reference-content/use-cases/) for more information on the different apps you can deploy using Serverless Containers.

## Hosting a website using Elastic Metal (Aluminium)

Elastic Metal (Aluminium) is an expert-level solution for users who require full control over the infrastructure. It provides optimal performance by leveraging the dedicated hardware resources at a cost lower than equivalent instances. You can install any operating system and applications you need, but you are responsible for maintaining your entire software stack.
Expand Down
16 changes: 16 additions & 0 deletions pages/use-cases/application-hosting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ Looking to deploy a web application? Scaleway offers scalable and secure hosting
url="/tutorials/deploy-saas-application/"
/>
</Grid>
<Grid>
<SummaryCard
title="Hosting a Next.js web app with Serverless Containers"
icon="book-open-outline"
description="Quickly deploy a basic Next.js app with Serverless Containers."
label="Read more"
url="/tutorials/hosting-nextjs-webapp-serverless-containers/"
/>
<SummaryCard
title="Deploying and host a Django web app with Serverless Containers"
icon="book-open-outline"
description="Easily deploy and scale containerized Django apps."
label="Read more"
url="/tutorials/hosting-django-webapp-serverless-containers/"
/>
</Grid>

## Related tutorials

Expand Down
14 changes: 7 additions & 7 deletions pages/use-cases/deploy-external-software/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ description: Discover how to deploy and manage external software with Scaleway's
Need to deploy and manage external software on your cloud infrastructure? Scaleway provides the tools and services to help you deploy, manage, and scale external software efficiently.

<Grid>
<SummaryCard
title="Deploying Open WebUI with Scaleway's Generative APIs"
icon="info"
description="Deploy a powerful web-based AI user interface with Serverless Containers."
label="Read more"
url="/tutorials/deploy-openwebui-with-generative-apis/"
/>
<SummaryCard
title="Deploying Chatwoot on Scaleway General Purpose Instances"
icon="rocket"
description="With Chatwoot, businesses can set up multiple communication channels, integrate them into their websites or applications, and engage with customers in real-time."
label="Read more"
url="/tutorials/deploy-chatwoot-self-care/"
/>
<SummaryCard
title="Creating a Valheim server with Scaleway"
icon="info"
description="Learn how to create your own Valheim gaming server with Scaleway Instances."
label="Read more"
url="/tutorials/create-valheim-server/"
/>
</Grid>

## Related tutorials
Expand Down
7 changes: 7 additions & 0 deletions pages/use-cases/website-hosting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ Need to deploy a simple or complex website? Scaleway provides the tools and infr
label="Read more"
url="/tutorials/wordpress-instantapp/"
/>
<SummaryCard
title="Deploy and host a website with Serverless Containers"
icon="book-open-outline"
description="Easily deploy and scale containerized static websites."
label="Read more"
url="/tutorials/hosting-static-websites-serverless-containers/"
/>
</Grid>

## Related tutorials
Expand Down
159 changes: 159 additions & 0 deletions tutorials/hosting-django-webapp-serverless-containers/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
title: Hosting a Django web app with Serverless Containers
description: This page provides guidelines on how to host and deploy dynamic Django web applications using Scaleway Serverless Containers
tags: deploy host website webapp python django containerize application docker dockerfile
products:
- containers
- container-registry
dates:
validation: 2025-10-06
posted: 2025-10-06
validation_frequency: 12
difficulty: beginner
usecase:
- application-hosting
- deploy-external-software
- website-hosting
ecosystem:
- third-party
---

import Requirements from '@macros/iam/requirements.mdx'

[Django](https://www.djangoproject.com/) is a robust Python framework designed for rapid development of secure and maintainable web applications. Hosting Django on [Scaleway Serverless Containers](/serverless-containers/) provides automatic scaling, simplified deployment, and reduced infrastructure management. This deployment method allows your application to efficiently handle varying workloads, optimize resource usage, and focus on writing code and delivering features rather than maintaining servers.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- Installed [Docker](https://docs.docker.com/get-started/get-docker/) or [Docker Engine](https://docs.docker.com/engine/install/)
- [Created a Scaleway Container Registry namespace](/container-registry/how-to/create-namespace/) and [logged into it](/container-registry/how-to/connect-docker-cli/)

## Create and host a basic Django web application

To host a [Django](https://www.djangoproject.com/) web application on **Scaleway Serverless Containers**, you need to create a Django project, define your views and URLs, and containerize it using a production-ready `Dockerfile`. The container will run a WSGI server (like Gunicorn) to serve your app. After building the image locally, push it to the [Scaleway Container Registry](/container-registry/) and deploy it via [Scaleway Serverless Containers](/serverless-containers/).

### Create your app and test it locally

1. In a terminal, create a new directory and navigate into it:
```bash
mkdir my-django-app
cd my-django-app
```

2. Create a virtual environment and install Django:

<Tabs id="python-venv">
<TabsTab label="Linux/macOS">
```bash
python3 -m venv venv
source venv/bin/activate
pip install django gunicorn
```
</TabsTab>
<TabsTab label="Windows">
```bash
python -m venv venv
venv\Scripts\activate
pip install django gunicorn
```
</TabsTab>
</Tabs>

3. Start a new Django project:
```bash
django-admin startproject myproject .
```

4. Verify the project structure:
```
my-django-app/
├── myproject/
│ ├── __init__.py
│ ├── settings.py # Configuration
│ ├── urls.py # URL routing
│ └── wsgi.py # WSGI application entry point
├── manage.py # CLI for Django commands
└── venv/ # Virtual environment (excluded from Docker)
```

5. Create a `requirements.txt` file and add the following code to it:
```txt
Django==5.1.*
gunicorn==21.2.*
```

6. Run the following command to test the app locally:
```bash
python manage.py runserver
```
Visit [http://localhost:8000](http://localhost:8000) to see the default Django welcome page.

### Build the app image and push it to Scaleway Container Registry

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/).

1. Create a `Dockerfile` at the root of your Django app:
```dockerfile
# Use a lightweight Python image
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

# Expose port
EXPOSE 8000

# Run Gunicorn as the entrypoint
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "myproject.wsgi:application"]
```

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:

```py
ALLOWED_HOSTS = [
'.fr-par.scw.cloud',
'.nl-ams.scw.cloud',
'.pl-waw.scw.cloud'
]
```

3. Build, tag, and push the image to Scaleway Container Registry:
```bash
docker build \
--platform linux/amd64 \
--push \
-t <CONTAINER_REGISTRY_ENDPOINT>/my-django-app:latest .
```
<Message type="note">
You can find your Container Registry endpoint in the **Overview** tab of your Container Registry namespace in the [Scaleway console](https://console.scaleway.com/registry/namespaces).
</Message>

### Deploy your app using Serverless Containers

1. [Deploy a Serverless Container](/serverless-containers/how-to/deploy-container/) with the following settings:
- **Registry**: Scaleway Container Registry
- **Registry namespace**: The namespace where you pushed your image
- **Container port**: `8000` as it is the [port](/serverless-containers/reference-content/port-parameter-variable/) exposed in the dockerfile.
- **Resources**: `500 mVCPU` and `512 MB` memory
- **Autoscaling**: Set minimum scale to `1` to avoid [cold starts](/serverless-containers/concepts/#cold-start) (optional)

Deployment may take up to a minute.

2. Once the container is **ready**, click the **container endpoint** in the **Overview** tab. Your Django app will be live and accessible to anyone with the link.

## Going further

- You can deploy an existing Django project by building and pushing its container image as shown above.
- [Add a custom domain](/serverless-containers/how-to/add-a-custom-domain-to-a-container/) to your deployed app.
Loading