> ## Documentation Index
> Fetch the complete documentation index at: https://www.aptible.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a Python + Django Template

> Deploy a starter template Python app using the Django framework on Aptible

> [card] [Deploy Now](https://app.aptible.com/create)

> [card] [GitHub Repo](https://github.com/aptible/template-django)

> [card] [View Example](https://app-52709.on-aptible.com/)

# Overview

This guide will walk you through the process of launching a [Python](https://www.python.org/) app using the [Django](https://www.djangoproject.com/) framework.

# Deploy Template

> [!NOTE]
>
> Prerequisite: Ensure you have [Git](https://git-scm.com/downloads) installed.

Using the [Deploy Code](https://app.aptible.com/create) tool in the Aptible Dashboard, you can deploy the **Django Template**. The tool will guide you through the following:

**1. Deploy with Git Push**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django1.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=0e18c03c0590c5f184cfa9065828e978)

**2. Add an SSH key**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django2.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=dded35dce07acbc81b922f4e2792662b) If you have not done so already, you will be prompted to set up an [SSH key](https://www.aptible.com/docs/core-concepts/security-compliance/authentication/ssh-keys.md#ssh-keys).

**3. Environment Setup**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django3.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=805399b4dc39e1380ee75cc3cc1c729f) Select your [stack](https://www.aptible.com/docs/core-concepts/architecture/stacks.md) to deploy your resources. This will determine what region your resources are deployed to. Then, the name the [environment](https://www.aptible.com/docs/core-concepts/architecture/environments.md) your resources will be grouped into.

**4. Prepare the template**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django4.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=af86bae61187b7b4fff5036daace7dfd) Select **Django Template** for deployment, and follow command-line instructions.

**5. Fill environment variables and deploy!**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django5.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=2f3e10f543ef01d7eeeca62429e26755) Aptible will automatically fill this template's required databases, services, and app's configuration with environment variable keys for you to fill with values. Once complete, save and deploy the code!

Aptible will stream the logs to you in live time: ![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django6.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=66d30a7afbd6ac1184fb365bbcf7465a)

**6. Expose your app to the internet**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django7.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=ab2ff50e4cf3501be1046d294dca3b28) Now that your code is deployed, it's time to expose your app to the internet. Select the service that needs an [endpoint](https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/overview.md), and Aptible will automatically provision a managed endpoint.

**7. View your deployed app**

![](https://mintcdn.com/aptible/2c_c-XH-dAzVOaDu/images/django8.png?fit=max\&auto=format\&n=2c_c-XH-dAzVOaDu\&q=85\&s=ad5683908065e1d28b20bf1fd9abf54c)

# Continue your journey

> [card] [Deploy custom code](https://www.aptible.com/docs/custom-code-quickstart.md)
>
> Read our guide for deploying custom code on Aptible.
