<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Django Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/django/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/django/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Tue, 02 Dec 2025 14:25:09 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>Django Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/django/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>One Framework a Day keeps the Boredom Away: Django</title>
		<link>https://www.clever.cloud/blog/features/2017/10/10/1fdba-django-taiga/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Tue, 10 Oct 2017 17:15:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[1fdba]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2017/10/10/1fdba-django-taiga/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba django 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-1368x528.jpg 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it's about Django.

<span id="more-2906"></span>

In each post of this series we'll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://www.djangoproject.com/">Django</a>.

If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://gitHub.com/CleverCloud/clever-tools">Clever-Tools</a>.
<h2 id="what-is-django">What is Django?</h2>
<blockquote>Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.</blockquote>
It's also one of the most popular web frameworks, especially in the Python world. We already have a <a href="https://www.clever.cloud/developers/python/python-django-sample/">simple example</a> on how to run a Django based site in our documentation. I invite you to check it out first. Since it's so simple today I am going to use another Django based website. Lurking on GitHub I came across <a href="https://taiga.io/">Taiga</a>. It's a project management platform. It looks useful and beautiful so why not try it?
<h2 id="setup">Setup</h2>
Taiga writes in a PostgreSQL database and on a filesystem. So I know I will need an FS-Bucket add-on and a PostgreSQL add-on. It's composed of two different projects. There is the backend written in Python using Django. The other is an AngularJS frontend. Most of the work will consist of making sure this can be configured with environment variables.

To start configuring the backend we need to:
<ul>
 	<li>Clone the project: <code>git clone https://gitHub.com/taigaio/taiga-back.git</code></li>
 	<li>Get in the project: <code>cd taiga-back</code></li>
 	<li>Create our Postgres add-on: <code>clever addon create postgresql-addon --plan dev --region eu taigaPG</code></li>
 	<li>Create our FS Bucket add-on: <code>clever addon create fs-bucket --plan s --region eu taigaFS</code></li>
 	<li>Create our application: <code>clever create --type python taiga --region par</code></li>
 	<li>Link our Postgres add-on: <code>clever service link-addon taigaPG</code></li>
 	<li>Link our FS Bucket add-on: <code>clever service link-addon taigaFS</code></li>
 	<li>Define the python version to use: <code>clever env set PYTHON_VERSION 3</code></li>
 	<li>Define where to mount our FS Bucket: <code>clever env set CC_FS_BUCKET /data:`clever env | awk  -F = '/BUCKET_HOST/ { print $2}'` </code></li>
 	<li>Define the secret used by the app: <code>clever env set SECRET theveryultratopsecretkey</code></li>
 	<li>Define the frontend domain name: <code>clever env set FRONT_DOMAIN taigald.cleverapps.io"</code></li>
 	<li>Define the HTTP schema: <code>clever env set HTTP_SCHEMA https"</code></li>
 	<li>Define where to store media: <code>clever env set STORAGE_MEDIA /data/media"</code></li>
 	<li>Define where to store static files: <code>clever env set STORAGE_STATIC /data/static"</code></li>
</ul>
Now it's time to tell Taiga how to retrieve and use our environment variables. To do so we need to create a new file called <code>local.py</code> under the <code>settings</code> directory: <code>touch settings/local.py</code>

In this file we can setup everything:
<pre><code class="language-python">from .common import *
import os

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': os.getenv("POSTGRESQL_ADDON_DB"),
        'USER': os.getenv("POSTGRESQL_ADDON_USER"),
        'PASSWORD': os.getenv("POSTGRESQL_ADDON_PASSWORD"),
        'HOST': os.getenv("POSTGRESQL_ADDON_HOST"),
        'PORT': os.getenv("POSTGRESQL_ADDON_PORT"),
    }
}

MEDIA_ROOT = os.path.join(BASE_DIR, os.getenv("STORAGE_MEDIA"))
STATIC_ROOT = os.path.join(BASE_DIR, os.getenv("STORAGE_STATIC"))
MEDIA_URL = ""https://" +  os.getenv("FRONT_DOMAIN") + os.getenv("STORAGE_MEDIA")
STATIC_URL = "https://" +  os.getenv("FRONT_DOMAIN") + os.getenv("STORAGE_STATIC")
SITES["front"]["scheme"] = os.getenv("HTTP_SCHEMA")
SITES["front"]["domain"] = os.getenv("FRONT_DOMAIN")

SECRET_KEY = os.getenv("SECRET")

DEBUG = False
PUBLIC_REGISTER_ENABLED = True
</code></pre>
Taiga expects all your folders to be already created. To make sure this happens we can use a <a href="https://www.clever.cloud/developers/doc/develop/build-hooks/#hooks-types">pre-build hook</a>.
<ul>
 	<li>Create the hook script: <code>mkdir clevercloud; touch clevercloud/buildDirectories.sh &amp;&amp; chmod +x ./clevercloud/buildDirectories.sh</code></li>
 	<li>Use the following code for the shell script:
<pre><code class="language-bash">[ -d $STORAGE_STATIC ] || mkdir -p $STORAGE_STATIC
[ -d $STORAGE_MEDIA ] || mkdir -p $STORAGE_MEDIA
</code></pre>
</li>
 	<li>Define the hook: <code>clever env set CC_PRE_BUILD_HOOK ./clevercloud/buildDirectories.sh</code></li>
</ul>
Something else we need to do since there are going to be two applications is to setup a proper domain name. Here I am using <code>cleverapps.io</code>, which is automatically configured for SSL support: <code>clever domain add taigabackld.cleverapps.io</code>

You can commit all the new files in a new branch. You are now done with the minimal backend configuration.

Moving on to the frontend configuration. They have a prebuilt version of the site so that is something we can use.
<ul>
 	<li>Clone the project: <code>git clone https://gitHub.com/taigaio/taiga-front-dist.git</code></li>
 	<li>Get in the project: <code>cd taiga-back</code></li>
 	<li>Get the latest stable version: <code>git checkout stable</code></li>
 	<li>Copy the default configuration file: <code>cp dist/conf.example.json dist/conf.json</code></li>
 	<li>Change the backend URL: <code>sed -i 's,http://localhost:8000/api/v1/,http://taigabackld.cleverapps.io/api/v1/,g' dist/conf.json</code></li>
 	<li>Create the static website: <code>clever create --type static-apache taiga-front</code></li>
 	<li>Link this website to our FS Bucket addon: <code>clever service link-addon taigaFS</code></li>
 	<li>Setup its mount point: <code>clever env set CC_FS_BUCKET /dist/data:`clever env | awk  -F = '/BUCKET_HOST/ { print $2}'` </code></li>
 	<li>Add a domain name: <code>clever domain add taigald.cleverapps.io</code></li>
</ul>
Since the root of the site is the <code>dist</code> folder, we need to configure it. This can be done by creating a <code>clevercloud/php.json</code> file containing:
<pre><code class="language-json">{
  "deploy": {
    "webroot": "/dist"
  }
}
</code></pre>
Now go ahead and commit this. You are done with the configuration of this project.
<h2 id="deploy">Deploy</h2>
We have two applications to deploy. First the backend. It's a Python runtime so here's what you need to do:
<ul>
 	<li>Define the Python module we want to start: <code>clever env set CC_PYTHON_MODULE taiga.wsgi</code></li>
 	<li>Define the Python backend to use: <code>clever env set PYTHON_BACKEND gunicorn</code></li>
 	<li>Deploy the app: <code>clever deploy</code></li>
</ul>
If everything goes well you should see the logs of the application being built, then logs should show your app is ready. We then need to initialize the data. Run <code>clever ssh</code> and it will connect you to the running VM. From there, get into your application folder, for me it's <code>cd app_254da6af-3642-4c98-afd3-48e46e3adb23/</code>. Now we can use python scripts to intialize all the things:
<pre><code class="language-bash">python manage.py migrate --noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py compilemessages
python manage.py collectstatic --noinput
python manage.py sample_data
</code></pre>
Last one takes a bit of time and is not mandatory. It's some sample data if you want to try an existing install of Taiga.

Moving on to the front end part. All you need to do is run <code>clever deploy</code> and then <code>clever open</code>. You should have Taiga open in your default browser, ready for you to login with user <code>admin</code> and password <code>123123</code>.

That's it, have fun with your new project management website :)]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba django 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-django-1-1368x528.jpg 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it's about Django.

<span id="more-2906"></span>

In each post of this series we'll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://www.djangoproject.com/">Django</a>.

If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://gitHub.com/CleverCloud/clever-tools">Clever-Tools</a>.
<h2 id="what-is-django">What is Django?</h2>
<blockquote>Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.</blockquote>
It's also one of the most popular web frameworks, especially in the Python world. We already have a <a href="https://www.clever.cloud/developers/python/python-django-sample/">simple example</a> on how to run a Django based site in our documentation. I invite you to check it out first. Since it's so simple today I am going to use another Django based website. Lurking on GitHub I came across <a href="https://taiga.io/">Taiga</a>. It's a project management platform. It looks useful and beautiful so why not try it?
<h2 id="setup">Setup</h2>
Taiga writes in a PostgreSQL database and on a filesystem. So I know I will need an FS-Bucket add-on and a PostgreSQL add-on. It's composed of two different projects. There is the backend written in Python using Django. The other is an AngularJS frontend. Most of the work will consist of making sure this can be configured with environment variables.

To start configuring the backend we need to:
<ul>
 	<li>Clone the project: <code>git clone https://gitHub.com/taigaio/taiga-back.git</code></li>
 	<li>Get in the project: <code>cd taiga-back</code></li>
 	<li>Create our Postgres add-on: <code>clever addon create postgresql-addon --plan dev --region eu taigaPG</code></li>
 	<li>Create our FS Bucket add-on: <code>clever addon create fs-bucket --plan s --region eu taigaFS</code></li>
 	<li>Create our application: <code>clever create --type python taiga --region par</code></li>
 	<li>Link our Postgres add-on: <code>clever service link-addon taigaPG</code></li>
 	<li>Link our FS Bucket add-on: <code>clever service link-addon taigaFS</code></li>
 	<li>Define the python version to use: <code>clever env set PYTHON_VERSION 3</code></li>
 	<li>Define where to mount our FS Bucket: <code>clever env set CC_FS_BUCKET /data:`clever env | awk  -F = '/BUCKET_HOST/ { print $2}'` </code></li>
 	<li>Define the secret used by the app: <code>clever env set SECRET theveryultratopsecretkey</code></li>
 	<li>Define the frontend domain name: <code>clever env set FRONT_DOMAIN taigald.cleverapps.io"</code></li>
 	<li>Define the HTTP schema: <code>clever env set HTTP_SCHEMA https"</code></li>
 	<li>Define where to store media: <code>clever env set STORAGE_MEDIA /data/media"</code></li>
 	<li>Define where to store static files: <code>clever env set STORAGE_STATIC /data/static"</code></li>
</ul>
Now it's time to tell Taiga how to retrieve and use our environment variables. To do so we need to create a new file called <code>local.py</code> under the <code>settings</code> directory: <code>touch settings/local.py</code>

In this file we can setup everything:
<pre><code class="language-python">from .common import *
import os

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': os.getenv("POSTGRESQL_ADDON_DB"),
        'USER': os.getenv("POSTGRESQL_ADDON_USER"),
        'PASSWORD': os.getenv("POSTGRESQL_ADDON_PASSWORD"),
        'HOST': os.getenv("POSTGRESQL_ADDON_HOST"),
        'PORT': os.getenv("POSTGRESQL_ADDON_PORT"),
    }
}

MEDIA_ROOT = os.path.join(BASE_DIR, os.getenv("STORAGE_MEDIA"))
STATIC_ROOT = os.path.join(BASE_DIR, os.getenv("STORAGE_STATIC"))
MEDIA_URL = ""https://" +  os.getenv("FRONT_DOMAIN") + os.getenv("STORAGE_MEDIA")
STATIC_URL = "https://" +  os.getenv("FRONT_DOMAIN") + os.getenv("STORAGE_STATIC")
SITES["front"]["scheme"] = os.getenv("HTTP_SCHEMA")
SITES["front"]["domain"] = os.getenv("FRONT_DOMAIN")

SECRET_KEY = os.getenv("SECRET")

DEBUG = False
PUBLIC_REGISTER_ENABLED = True
</code></pre>
Taiga expects all your folders to be already created. To make sure this happens we can use a <a href="https://www.clever.cloud/developers/doc/develop/build-hooks/#hooks-types">pre-build hook</a>.
<ul>
 	<li>Create the hook script: <code>mkdir clevercloud; touch clevercloud/buildDirectories.sh &amp;&amp; chmod +x ./clevercloud/buildDirectories.sh</code></li>
 	<li>Use the following code for the shell script:
<pre><code class="language-bash">[ -d $STORAGE_STATIC ] || mkdir -p $STORAGE_STATIC
[ -d $STORAGE_MEDIA ] || mkdir -p $STORAGE_MEDIA
</code></pre>
</li>
 	<li>Define the hook: <code>clever env set CC_PRE_BUILD_HOOK ./clevercloud/buildDirectories.sh</code></li>
</ul>
Something else we need to do since there are going to be two applications is to setup a proper domain name. Here I am using <code>cleverapps.io</code>, which is automatically configured for SSL support: <code>clever domain add taigabackld.cleverapps.io</code>

You can commit all the new files in a new branch. You are now done with the minimal backend configuration.

Moving on to the frontend configuration. They have a prebuilt version of the site so that is something we can use.
<ul>
 	<li>Clone the project: <code>git clone https://gitHub.com/taigaio/taiga-front-dist.git</code></li>
 	<li>Get in the project: <code>cd taiga-back</code></li>
 	<li>Get the latest stable version: <code>git checkout stable</code></li>
 	<li>Copy the default configuration file: <code>cp dist/conf.example.json dist/conf.json</code></li>
 	<li>Change the backend URL: <code>sed -i 's,http://localhost:8000/api/v1/,http://taigabackld.cleverapps.io/api/v1/,g' dist/conf.json</code></li>
 	<li>Create the static website: <code>clever create --type static-apache taiga-front</code></li>
 	<li>Link this website to our FS Bucket addon: <code>clever service link-addon taigaFS</code></li>
 	<li>Setup its mount point: <code>clever env set CC_FS_BUCKET /dist/data:`clever env | awk  -F = '/BUCKET_HOST/ { print $2}'` </code></li>
 	<li>Add a domain name: <code>clever domain add taigald.cleverapps.io</code></li>
</ul>
Since the root of the site is the <code>dist</code> folder, we need to configure it. This can be done by creating a <code>clevercloud/php.json</code> file containing:
<pre><code class="language-json">{
  "deploy": {
    "webroot": "/dist"
  }
}
</code></pre>
Now go ahead and commit this. You are done with the configuration of this project.
<h2 id="deploy">Deploy</h2>
We have two applications to deploy. First the backend. It's a Python runtime so here's what you need to do:
<ul>
 	<li>Define the Python module we want to start: <code>clever env set CC_PYTHON_MODULE taiga.wsgi</code></li>
 	<li>Define the Python backend to use: <code>clever env set PYTHON_BACKEND gunicorn</code></li>
 	<li>Deploy the app: <code>clever deploy</code></li>
</ul>
If everything goes well you should see the logs of the application being built, then logs should show your app is ready. We then need to initialize the data. Run <code>clever ssh</code> and it will connect you to the running VM. From there, get into your application folder, for me it's <code>cd app_254da6af-3642-4c98-afd3-48e46e3adb23/</code>. Now we can use python scripts to intialize all the things:
<pre><code class="language-bash">python manage.py migrate --noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py compilemessages
python manage.py collectstatic --noinput
python manage.py sample_data
</code></pre>
Last one takes a bit of time and is not mandatory. It's some sample data if you want to try an existing install of Taiga.

Moving on to the front end part. All you need to do is run <code>clever deploy</code> and then <code>clever open</code>. You should have Taiga open in your default browser, ready for you to login with user <code>admin</code> and password <code>123123</code>.

That's it, have fun with your new project management website :)]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python now in beta &#8211; Available soon</title>
		<link>https://www.clever.cloud/blog/features/2013/03/26/django-on-clever-cloud/</link>
		
		<dc:creator><![CDATA[Clément Nivolle]]></dc:creator>
		<pubDate>Tue, 26 Mar 2013 00:00:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2013/03/26/django-on-clever-cloud/</guid>

					<description><![CDATA[We&#39;re pleased to announce the support of Python on Clever Cloud. The Django framework is supported as well. Here&#39;s a demo. Python is a programming language that lets you work more quickly and integrate your systems more effectively. Django (aka The Web framework for perfectionists with deadlines) is a high-level Python Web framework that encourages [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>We&#39;re pleased to announce the support of Python on Clever Cloud. The Django framework is supported as well. <a href="http://python-django.cleverapps.io/" rel="noopener noreferrer" target="_blank">Here&#39;s a demo</a>.</p>
<div class="center" style="margin: 0 auto 20px; width: 300px"><a href="https://www.youtube.com/watch?v=IAooXLAPoBQ" rel="noopener noreferrer" target="_blank" title="The D is silent"><img decoding="async" alt="django roles"  src="https://www2.cleverapps.io/app/uploads/2021/08/django-logo-positive.png"/></a></div>
<p><span id="more-2841"></span><br />
Python is a programming language that lets you work more quickly and integrate your systems more effectively.</p>
<p>Django (aka <em>The Web framework for perfectionists with deadlines</em>) is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.</p>
<p>Still in beta, this feature will be available this month, for everyone.</p>
<p>If you want to be part of the beta-users, please contact us to <a href="mailto:support@clever-cloud.com">mailto:support@clever-cloud.com</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
