<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Okputu Julius</title>
    <description>The latest articles on Forem by Okputu Julius (@okputu_julius).</description>
    <link>https://forem.com/okputu_julius</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F916951%2F35aa1175-71b2-4f54-9af1-fc418f7884da.jpg</url>
      <title>Forem: Okputu Julius</title>
      <link>https://forem.com/okputu_julius</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/okputu_julius"/>
    <language>en</language>
    <item>
      <title>HOW TO DEPLOY EXISTING DJANGO PROJECTS TO RENDER</title>
      <dc:creator>Okputu Julius</dc:creator>
      <pubDate>Fri, 02 Sep 2022 21:43:18 +0000</pubDate>
      <link>https://forem.com/okputu_julius/how-to-deploy-existing-django-projects-to-render-32eo</link>
      <guid>https://forem.com/okputu_julius/how-to-deploy-existing-django-projects-to-render-32eo</guid>
      <description>&lt;p&gt;In this post I would be demonstrating how to deploy an existing Django project to render, I noticed that the render documentation did not have a guide for persons with already existing projects at the time of writing this article.&lt;br&gt;
the source code is available on github&lt;a href="https://github.com/jayjaytentacion/snipets-api"&gt;here&lt;/a&gt;&lt;br&gt;
And the live site &lt;a href="https://j-snippets.onrender.com"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you hop on, make sure you have created an account on &lt;a href="https://render.com/register"&gt;render&lt;/a&gt; and have an understanding of Virtual environments and poetry, learn more about poetry &lt;a href="https://realpython.com/dependency-management-python-poetry/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1 Getting started
&lt;/h2&gt;

&lt;p&gt;Before we can proceed to deploy our application to render, we need to install poetry(a python package for managing dependencies and environments)&lt;/p&gt;

&lt;p&gt;To install poetry run the following code in the terminal:&lt;br&gt;
For Linux/macOS/gitbash&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;curl -sSL https://install.python-poetry.org | python&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For Windows in Powershell:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To verify the installation run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Update it:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry self update&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2 Deployment Setup
&lt;/h2&gt;

&lt;p&gt;The Django app I would be deploying has the following folder structure &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nFSReS9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evaui1pbhp7mhqmcj57q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nFSReS9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/evaui1pbhp7mhqmcj57q.png" alt="snippeteapi folder structure" width="226" height="335"&gt;&lt;/a&gt;&lt;br&gt;
the snippets directory is the project directory and the snippetsapi is the application directory&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a pyproject.toml file&lt;/strong&gt;&lt;br&gt;
make sure your virtual environment is activated and you're in the root of your project &lt;br&gt;
run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Fill in the prompts:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Package name &lt;span class="o"&gt;[&lt;/span&gt;snipets-api]:           &lt;span class="c"&gt;#leave blank and tap enter&lt;/span&gt;
Version &lt;span class="o"&gt;[&lt;/span&gt;0.1.0]:               &lt;span class="c"&gt;#leave blank and tap enter&lt;/span&gt;
Description &lt;span class="o"&gt;[]&lt;/span&gt;:                &lt;span class="c"&gt;#leave blank and tap enter&lt;/span&gt;
Author &lt;span class="o"&gt;[&lt;/span&gt;okputu julius &amp;lt;juliusstan10@gmail.com&amp;gt;, n to skip]:   &lt;span class="c"&gt;#leave blank and tap enter  &lt;/span&gt;
License &lt;span class="o"&gt;[]&lt;/span&gt;:  &lt;span class="c"&gt;#leave blank and tap enter&lt;/span&gt;
Compatible Python versions &lt;span class="o"&gt;[&lt;/span&gt;^3.10]:   &lt;span class="c"&gt;#leave blank and tap enter&lt;/span&gt;

Would you like to define your main dependencies interactively? &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;yes&lt;/span&gt;/no&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;yes&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; no       &lt;span class="c"&gt;#enter no&lt;/span&gt;
Would you like to define your development dependencies interactively? &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;yes&lt;/span&gt;/no&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;yes&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; no   &lt;span class="c"&gt;#enter no&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After filling all the prompts&lt;br&gt;
a file named pyproject.toml would be created at the root of your project&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pyproject.toml&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;#this  file contains details  and dependencies of the particular project&lt;/span&gt;
&lt;span class="nn"&gt;[tool.poetry]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"snipets-api"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;
&lt;span class="py"&gt;authors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"okputu julius &amp;lt;juliusstan10@gmail.com&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[tool.poetry.dependencies]&lt;/span&gt;
&lt;span class="py"&gt;python&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"^3.10"&lt;/span&gt;

&lt;span class="nn"&gt;[tool.poetry.dev-dependencies]&lt;/span&gt;

&lt;span class="nn"&gt;[build-system]&lt;/span&gt;
&lt;span class="py"&gt;requires&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;["poetry-core&amp;gt;=1.0.0"]&lt;/span&gt;
&lt;span class="py"&gt;build-backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"poetry.core.masonry.api"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Add dependencies to the pyproject.toml&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To add dependencies individually:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry add &amp;lt;package name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;if the project already has a requirements.txt file&lt;br&gt;
run the following code in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry add `cat requirements.txt`&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;note: for windows use PowerShell or gitbash&lt;/p&gt;

&lt;p&gt;A file  poetry.lock which contains details of the installed dependencies is created&lt;/p&gt;

&lt;p&gt;&lt;em&gt;poetry.lock&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[[package]]
name = "asgiref"
version = "3.5.2"
description = "ASGI specs, helper code, and adapters"
category = "main"
optional = false
python-versions = "&amp;gt;=3.7"

[package.extras]
tests = ["mypy (&amp;gt;=0.800)", "pytest", "pytest-asyncio"]

[[package]]
name = "certifi"
version = "2022.6.15"
description = "Python package for providing Mozilla's CA Bundle."
category = "main"
optional = false
python-versions = "&amp;gt;=3.6"
......
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set Environment Vars and Add Build script&lt;/strong&gt;&lt;br&gt;
Navigate to your settings.py and add the following :&lt;/p&gt;

&lt;p&gt;Don't forget to import os at the beginning of the file&lt;/p&gt;

&lt;p&gt;&lt;em&gt;settings.py&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="n"&gt;ALLOWED_HOSTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'*'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;SECRET_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'SECRET_KEY'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'your secret key'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;DEBUG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'DEBUG'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;cast&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file build.sh at the root of your project, this would contain the commands that build the app&lt;/p&gt;

&lt;p&gt;&lt;em&gt;build.sh&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="c"&gt;# exit on error&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; errexit

poetry &lt;span class="nb"&gt;install

&lt;/span&gt;python manage.py collectstatic &lt;span class="nt"&gt;--no-input&lt;/span&gt;
python manage.py migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;make sure the script is executable before checking it into git&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;chmod a+x build.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;we're going to run our project using gunicorn, add the dependency to your project&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;code&gt;poetry add gunicorn&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure database and static Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add the following packages&lt;/p&gt;

&lt;p&gt;&lt;em&gt;shell&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;poetry add dj-database-url psycopg2-binary &lt;span class="c"&gt;#for database config&lt;/span&gt;
poetry add &lt;span class="s1"&gt;'whitenoise   #for static files config
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the top of the settings.py file import dj-database-url &lt;br&gt;
update the databases dictionary with the snippet below and add the WhiteNoise middleware just after SecurityMiddleware&lt;/p&gt;

&lt;p&gt;&lt;em&gt;settings.py&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;dj_database_url&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="n"&gt;DATABASES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dj_database_url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;        &lt;span class="c1"&gt;# Feel free to alter this value to suit your needs.        default='',        conn_max_age=600    )}
&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="n"&gt;MIDDLEWARE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;'django.middleware.security.SecurityMiddleware'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'whitenoise.middleware.WhiteNoiseMiddleware'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="c1"&gt;#new
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in the section where static files are configured,make the following modifications&lt;/p&gt;

&lt;p&gt;&lt;em&gt;settings.py&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0.6/howto/static-files/
&lt;/span&gt;
&lt;span class="c1"&gt;# This setting tells Django at which URL static files are going to be served to the user.
# Here, they will be accessible at your-domain.onrender.com/static/...
&lt;/span&gt;&lt;span class="n"&gt;STATIC_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'/static/'&lt;/span&gt;
&lt;span class="c1"&gt;# Following settings only make sense in production and may break development environments.
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;DEBUG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="c1"&gt;# Tell Django to copy statics to the `static files` directory
&lt;/span&gt;    &lt;span class="c1"&gt;# in your application directory on Render.
&lt;/span&gt;    &lt;span class="n"&gt;STATIC_ROOT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BASE_DIR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'staticfiles'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# Turn on the WhiteNoise storage backend that takes care of compressing static files
&lt;/span&gt;    &lt;span class="c1"&gt;# and creating unique names for each version so they can safely be cached forever.
&lt;/span&gt;    &lt;span class="n"&gt;STATICFILES_STORAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'whitenoise.storage.CompressedManifestStaticFilesStorage'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;push the project to any online version control(GitHub/GitLab)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 Deploying To Render
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Render database and web service setup&lt;/strong&gt;&lt;br&gt;
go to your render dashboard and click on new Postgresql&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PY3YKFh---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kofuqg5jrnyljpahiqr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PY3YKFh---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kofuqg5jrnyljpahiqr9.png" alt="db" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;put in details for your new database and after that copy the internal database url &lt;/p&gt;

&lt;p&gt;Go to your render dashboard and click on new web service, and connect the repository you want to deploy(be sure to give render permission to access it),after that, you'll be asked to put in configuration details for your app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3zUhTrwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wza9h9v6m7rvpkvldgf5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3zUhTrwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wza9h9v6m7rvpkvldgf5.png" alt="1" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
put in a unique name for your service &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sYgtSZ6u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmpjugg4454wbogtashc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sYgtSZ6u--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmpjugg4454wbogtashc.png" alt="2" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
Set the build command to&lt;/p&gt;

&lt;p&gt;&lt;code&gt;./build.sh&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and the start command to&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gunicorn &amp;lt;your-project-directory&amp;gt;.wsgi:application&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--72rZJgU3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ye4mmsmpjsblan09gpme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--72rZJgU3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ye4mmsmpjsblan09gpme.png" alt="3" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
Under Advanced set the following Environment variables&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DATABASE_URL : The internal database URL for the database you created above&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SECRET_KEY : Click Generate to get a secure random value&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;PYTHON_VERSION : the python version of your project eg 3.10.6&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WEB_CONCURRENCY : 4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's it, click Create web service for your application to be deployed on render, after the build finishes your app would be available at .onrender.com&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>cloud</category>
      <category>render</category>
    </item>
  </channel>
</rss>
