Bitnami Django Stack

    Bitnami Django Stack greatly simplify the development and deployment of Django applications. A Bitnami stack is a preconfigured environment that is available as native installers, virtual machines and cloud images.

    How do I download and install Django Stack?


    You can download Bitnami Django stack for your platform at There are installers available for Windows, OS X and Linux operating systems.

    Currently there are available different versions of Django stack, depending on the Django version.

    Bitnami Django Stack can also be deployed as virtual machines. If you are using the virtual machine, please see our Virtual Appliances documentation for instructions on logging into the machine.

    The Stacks can be also deployed as AMIs in the Amazon cloud, Azure or Google Compute Engine. Please take a look at our Amazon Cloud Images quick guide to see how to connect to the instance from your machine, our Azure Launchpad or our Google Launchpad

    Bitnami Django Stack is distributed free of charge under the Apache 2.0 license.

    Which components are installed with Django Stack?

    The Bitnami Django Stack ships the components listed below. If you want to know which specific version of each component is bundled in the stack you are downloading, check the README.txt file in the download page or in the Stack installation directory. You can also find more information about each component using the links below.

    Main components:

    Dependencies and additional components:

    • SQLite database
    • Imaging
    • easy_install
    • pip
    • OpenSSL library
    • CURL library

    What is the default installation directory?

    When using native installers the default installation directory depends on the platform and can be changed during the installation:

    win_platform.png On Windows: C:\Bitnami\djangostack-VERSION (On previous versions, the default installation directory was C:\Program Files\BitNami Django Stack)

    mac_platform.png On OS X: /Applications/djangostack-VERSION

    linux_platform.png On Linux: /home/user/djangostack-VERSION

    If you are using a virtual machine or a Cloud Images, the default installation directory is "/opt/bitnami".

    How do I start and stop the servers?

    Each Django Stack ships several servers that must be started before you will be able to work with them. By default, MySQL or PostgreSQL database and Apache servers are started after the installation.

    Graphical tool

    The native installers include a graphical tool to manage the servers easily. You can find the "manager-windows.exe", "manager-osx" or "manager-linux" tool in your installation directory. Using this tool, you can Start, Stop or Restart the servers and check the log files. You can click on the icon to start it.














    On Windows: You can also start the Manager tool from shortcuts: Start -> Program Files -> Bitnami Stack -> Manager tool

    Command line tool

    If you prefer, you can use the "" utility from the command line. This script is in the installation directory.


    On Virtual Machines and Cloud images:

    $ sudo /opt/bitnami/ start

    A native installer on Linux:

    $ cd ~/application-version
    $ ./ start



    On OS X: You can start the Manager tool from the installation directory or you can use the "" utility from a Terminal.

    host:~ user$ cd /Applications/application-version
    host:~ user$ ./ start

    How can I run a command in the Django Stack?

    All of the Native Installers for Bitnami Stacks are completely self-contained and run independently of the rest of the software or libraries installed on your system. To work correctly, certain environment variables need to be set when you want to invoke commands to access different binaries. Note that in virtual machines or Cloud Images, the environment is already loaded for the "bitnami" user automatically and the below is not necessary.

    Bitnami console is a script to load the Stack environment. This console is useful to run any command included in the Stack: python, pip, openssl, easy_install among others.

    linux_platform.png On Linux:

    $ cd ~/djangostack-version
    $ ./use_django

    win_platform.png On Windows:

    There is a shortcut in Start -> Bitnami Ruby Stack ->"Use Django"

    mac_platform.png On OS X:

    Open a Terminal and type the following:

    hostname:~ user$ cd /Applications/djangostack-version
    hostname:~ user$ ./use_django

    How to start with the sample Django project?

    Once the installation or deployment finishes, you can access the welcome page from your browser. If you have installed the stack on a local machine as a regular user, you can access it at http://localhost on Windows or http://localhost:8080 on OS X and Linux. If not, you can specify the IP address of the server where you installed the Stack.

    You can access to the demo Project at "http://localhost/Project" on Windows or "http://localhost:8080/Project" on OS X or Linux. This sample project is running with "mod_wsgi"



    The Django project files are in the following location:


    How to create a new Django project?

    To start a project with Django, it is necessary to start the Bitnami Console. If you are using a Virtual Appliance or Cloud Image, you can run the commands below directly.

    You can find the projects folder located at:

    linux_platform.png On Linux:


    win_platform.png On Windows:

    For 2000, XP and 2003 Server:

    C:\Documents and Settings\user\Bitnami DjangoStack Projects

    For Vista, 7 and 2008 Server:

    C:\Users\user\Bitnami DjangoStack Projects

    mac_platform.png On OS X:


    From a console go to your projects folder and run the following command to create a new project:                          startproject my_new_project

    If you wish to create a new applicaction inside the created project execute the following commands as well:

    cd my_new_project
    python startapp my_new_app


    You can check your Django version executing the following command:

    python -c "import django; print(django.get_version())"

    For getting started with Django, check the official Django documentation for the version that you are using.


    How to start a Django project?

    Before start to follow the steps, keep in mind that installdir is the installation directory that you configured during the installation process. If you are using a Virtual Appliance, a Cloud Image or Bitnami Cloud Hosting, the installation directory is: /opt/bitnami.

    For development tasks you can use the standalone server in Django executing the following command inside your project folder:

    python runserver ip:port

    ip and port are optional parameters. will be used by default if you don't specify any of them.

    Note that is only accessible from the local machine. If you are remotely accessing the server you should use the ip (or the server IP). Also make sure that the port is open in your firewall rules, for Bitnami Cloud hosting servers check how to access your machine documentation.


    For a production environment we recomend to configure Apache with mod_wsgi module before start serving your application. If you are using Bitnami Stacks and Virtual Appliances for Django, mod_wsgi is already installed and activated by default. 

    Django application configuration

    First, modify the WSGI application script file named '' in the 'installdir/apps/django/django_projects/my_new_project/my_new_project' folder.

    Although the exact content may be different depending on your Django version. Ensure that the content is similar to the code below and you add your project to the path with sys.path.append.

    import os
    import sys
    os.environ.setdefault("PYTHON_EGG_CACHE", "installdir/apps/django/django_projects/my_new_project/egg_cache")
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_new_project.settings")
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()
    Apache configuration
    Create the conf folder in 'installdir/apps/django/django_projects/my_new_project/'. 
    mkdir installdir/apps/django/django_projects/my_new_project/conf

    Then, create these two files:

    touch installdir/apps/django/django_projects/my_new_project/conf/httpd-prefix.conf
    touch installdir/apps/django/django_projects/my_new_project/conf/httpd-app.conf
    On Unix you can run your application with mod_wsgi in daemon mode. Add the following code in httpd-app.conf :
      WSGIDaemonProcess wsgi-djangostack processes=2 threads=15 display-name=%{GROUP}
    WSGIScriptAlias /my_new_project 'installdir/apps/django/django_projects/my_new_project/my_new_project/'
    <Directory "installdir/apps/django/django_projects/my_new_project/my_new_project/">
        WSGIProcessGroup wsgi-djangostack
        WSGIApplicationGroup %{GLOBAL}
        <IfVersion < 2.3 >
            Order allow,deny
            Allow from all
        <IfVersion >= 2.3>
            Require all granted
    On Windows the daemon mode for mod_wsgi is not support and the configuration will be slightly different:
    WSGIScriptAlias /my_new_project 'installdir/apps/django/django_projects/my_new_project/my_new_project/'
    <Directory "installdir/apps/django/django_projects/my_new_project/my_new_project/">
        WSGIApplicationGroup %{GLOBAL}
        <IfVersion < 2.3 >
            Order allow,deny
            Allow from all
        <IfVersion >= 2.3>
            Require all granted

    In 'installdir/apps/django/django_projects/my_new_project/conf/httpd-prefix.conf' add this code:

    Include "installdir/apps/django/django_projects/my_new_project/conf/httpd-app.conf"

    Finally, add the line below in 'installdir/apache2/conf/bitnami/bitnami-apps-prefix.conf':

    Include "installdir/apps/django/django_projects/my_new_project/conf/httpd-prefix.conf"

    Then restart the Apache server and visit your project at http://localhost:8080/my_new_project

    Database configuration

    If you want to configure a database for your project, you can configure the "" file with the following settings. The examples below show how to configure the database connection with a database called "djangostack":

    • MySQL
     DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'djangostack',
            'HOST': '/opt/bitnami/mysql/tmp/mysql.sock',                                                 
            'PORT': '3306',
            'USER': 'your_user',
            'PASSWORD': 'your_password'
    • PostgreSQL
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'djangostack',
            'HOST': '/opt/bitnami/postgresql',
            'PORT': '5432',
            'USER': 'your_user',
            'PASSWORD': 'your_password'
    • SQLite
     DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': '/opt/bitnami/apps/django/django_projects/Project/Project/Project.db',

    The database connection is configured to use a socket. If you are using DjangoStack on Windows, you should use 'HOST': '' .

    How to configure GeoDjango with PostGIS?

    This guide assumes that you are working with Django 1.5+ which already supports PostGIS 2.0+: GeoDjango with PostGIS quick start guide

    Tag page (Edit tags)
    • No tags
    Page statistics
    119686 view(s), 16 edit(s) and 7897 character(s)


    You must login to post a comment.