How to launch a Django 2 project with the CLI


View full screen


Django is a web-application framework written in Python.

Django applications can be initialized to run on quickly using the CLI.

First, you can use the CLI command platform create to create a new project, specifying the region, plan size, number of development environments, and storage you want for the project. The project will be created in just a few seconds, and the CLI will provide a project ID you can now use to interact with it.

Next, you can use the CLI command platform environment:init along with the project ID to initialize the project with an existing Django repository, such as one of our Django templates. So long as the repository contains configuration files, it will then build and deploy the site. First, will run through the build hook of the application's file, which defines its build process, by first downloading all of its dependencies defined in the Pipfile.lock. Once completed, will validate domains for the environment, and issue new Let's Encrypt certificates for them if not present or if they will soon expire. Then the environment is created and deployed.

Finally, you can verify that the Django application deployed successfully by visiting the site using the CLI command platform url.

The command will open a new browser window, and you will see that your Django site is now ready.

Build your greatest ever app
Get started for free