Django
Instructions for connecting your Django apps and deploying them on ToyStack
Step 1: Ensure your app is Dockerised
# Use an official Python runtime as a parent image
FROM python:3.12
# Set environment variables for Python
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory to /code
WORKDIR /code
# Copy only the requirements file
COPY requirements.txt /code/
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /code
COPY . /code/
# Expose the port that the app will run on
EXPOSE 8000
# Run the application
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]Step 2: Import your Git repository
Step 3: Input environment variables
Step 4: Choose a plan

Step 5: Deploy
Last updated