Skip to main content

Introduction

To develop and host a Django application on Square Cloud, it’s essential to follow a structured sequence of configurations and prerequisites. This technical guide will cover the entire process, from initial setup to production deployment.

Prerequisites

  • Square Cloud Account: Register through the signup page using your email.
  • Active plan: Ensures dedicated resources and optimized performance for your application. Check our available plans and choose the most suitable for your needs.
This guide runs on the Python runtime. Tested with Django 6 on Python 3.13 in September 2026.

Create the project

You need Python and pip on your machine. If you don’t have them, download Python from the official Python website.

Installing libraries

Install Django, the Gunicorn production server and WhiteNoise, which serves your static files:

Developing project

Create a new Django project and enter its folder:
This creates manage.py and a mysite/ package with settings.py, urls.py and wsgi.py. To add a basic route, edit mysite/urls.py:
mysite/urls.py

Configuring settings for production

Never hardcode secrets in your code. In mysite/settings.py, read the secret key and the production flags from environment variables, trust your site’s HTTPS origin and enable WhiteNoise. Keep the rest of the generated settings as they are:
mysite/settings.py
Replace mysite.squareweb.app with your subdomain or custom domain. Then set these environment variables in your application, from the dashboard or with squarecloud app env set:
To run the project locally, set DJANGO_SECRET_KEY (any value) and DJANGO_DEBUG=True in your terminal, then run python manage.py runserver.
Then list your dependencies in a requirements.txt file next to manage.py. Square Cloud installs them with pip before starting the app. It must list at least:
requirements.txt

Choose a production server

Django’s built-in development server (runserver) is not suitable for production use. Use Gunicorn, a production-ready WSGI server, started by the START command below. For worker settings and other options, see the Gunicorn guide:

Gunicorn

Gunicorn is a Python WSGI HTTP server for UNIX. It’s a pre-fork worker model, which means that it forks multiple worker processes to handle requests. This makes it a great choice for running python web applications in production.

Port and host

The START command below binds Gunicorn to 0.0.0.0:80: all network interfaces, on the port Square Cloud routes to your app. Django itself has no port setting to change.

Configure Square Cloud

Create a squarecloud.app file next to manage.py:
squarecloud.app
On every start, this command:
  • collectstatic copies your static files to STATIC_ROOT, where WhiteNoise serves them.
  • migrate applies pending database migrations. It does nothing when the database is already up to date.
  • python -m gunicorn mysite.wsgi --bind 0.0.0.0:80 serves the WSGI application of the mysite project on port 80 and all network interfaces.
MAIN=manage.py selects the Python runtime. In the dashboard upload, set the same main file and start command.

What goes in the ZIP

  • manage.py and the mysite/ package, with your apps and templates.
  • requirements.txt.
  • squarecloud.app.
manage.py, requirements.txt and squarecloud.app must be at the root of the ZIP. Leave out .venv, __pycache__, staticfiles/ (rebuilt by collectstatic on every start) and your local db.sqlite3.

Deploy and verify

Via dashboard

1

Access the Upload Page

Access the upload page and upload your project zip file.
2

Configure Your Environment

After uploading your zip, you will need to configure the name, main file or runtime environment and other settings for your project.
If you are uploading a web project, make sure to select “Web Publication” and set a subdomain to your project.
3

Deploy Your Project

Finally, click on the “Deploy” button to host your project on Square Cloud.
After deployment, you can monitor your project’s status and logs from the dashboard.
Uploading application to Square Cloud
4

Confirm Your App Is Live

Your first deploy usually takes less than a minute. In the dashboard, wait for your application status to show as running and check the logs for any startup errors.
If you deployed a website or API, open https://<your-subdomain>.squareweb.app in your browser: you should see your application responding. If you deployed a bot, send it a command to confirm it is online.
App not starting? See the Troubleshooting guide for the most common causes and fixes.

Via CLI

To use this method, your project needs a configuration file named squarecloud.app at its root. It tells Square Cloud how to run your application.

Configuration file guide

Learn how to create the squarecloud.app configuration file that defines your application’s environment.
1

Install the CLI

Install the Square Cloud CLI. If you already have it, run the same command to update it:
2

Log In

Run the command below. It opens your browser: approve the login there and the CLI is ready. There is no API key to copy. For scripts and CI, see CLI authentication.
3

Upload Your Project

From your project folder, run the command below. The CLI zips the current folder, leaving out what squarecloud.ignore lists, and uploads it:
To upload a zip you created yourself, pass it with --file:
4

Confirm Your App Is Live

Your first deploy usually takes less than a minute. Check your application status and logs directly from the terminal:
If you deployed a website or API, open https://<your-subdomain>.squareweb.app in your browser: you should see your application responding. If you deployed a bot, send it a command to confirm it is online.
App not starting? See the Troubleshooting guide for the most common causes and fixes.

Common errors

Custom domain

To use a custom domain (e.g., mysite.com) instead of the default URL mysite.squareweb.app, you need the Standard plan or higher. The default URL comes from the SUBDOMAIN field in the configuration file. To connect your domain, follow how to set up your own domain.

Minimum RAM requirements

Minimum: 512MB RAM for websites and APIs, enough for a static build on the static runtime. For apps that render pages on a server (Next.js, Nuxt, Angular SSR and similar), we recommend at least 1GB RAM. For larger applications, allocate more RAM to prevent the application from running out of memory and crashing.

Could not find this site.

Check if the subdomain/domain matches what’s configured in the SUBDOMAIN field or in the custom domain settings. If you just uploaded the site, wait up to 60 seconds for Square to enable first access.

Site took too long to respond…

Your server must listen on port 80 and host 0.0.0.0. Square Cloud sets the PORT (80) and HOST (0.0.0.0) environment variables in your application: read them in your code instead of hardcoding other values. A server that listens only on localhost or 127.0.0.1 never receives requests.

KeyError: ‘DJANGO_SECRET_KEY’

The environment variable is missing. Set DJANGO_SECRET_KEY as shown in Configuring settings for production, then restart the application.

Bad Request (400)

The address you opened is not in DJANGO_ALLOWED_HOSTS. Add your subdomain or custom domain to it, then restart the application.

Next steps

Environment variables

Keep secrets and settings out of your code and read them at runtime.

Custom domain

Serve your app on your own domain, on the Standard plan and above.

Troubleshooting

Fix an app that does not start or a site that does not respond.
For more about Django, see the official Django documentation and its deployment checklist.

Contact us

If you continue facing technical difficulties, our specialized support team is available to assist you. Contact us and we’ll be happy to help you resolve any issue: support quality is a big part of why developers rate Square Cloud 4.9/5 across 402 reviews on Google and Trustpilot.