Knowledge Base

How to install Django using the A2 QuickInstaller

This article describes how to use the A2 QuickInstaller to install Django on your system.

The A2 QuickInstaller is no longer supported, and is only available on older VPS hosting packages. On newer VPS hosting packages, you can use Webuzo to quickly and easily install a wide range of applications and manage your server.

To check if the A2 QuickInstaller supports this application for your Linux distribution, please see this article.

Installing Django

To install Django, follow these steps:

  1. Use SSH to log in to your system as the root user.
    To use the A2 QuickInstaller, you must log in as the root user using SSH. You cannot use the serial console in the VPS Control Panel to run the A2 QuickInstaller.
  2. To start the A2 QuickInstaller, type the following command, and then press ENTER:
    sh /usr/sbin/quickinstaller.sh
  3. Under Application Installers, type the option number for Frameworks, and then press ENTER.
  4. On the Framework Menu, type the option number for Django, and then press ENTER. The A2 QuickInstaller updates your system, and then begins the installation process.
    The installation process takes some time to complete. Do not interrupt the installation process.
  5. When installation is complete, the A2 QuickInstaller displays basic configuration information for the Django installation.

Verifying the Django installation

To verify that Django installed correctly on your system:

  1. At the command line, type the following command and then press ENTER:
    python
    

    The Python shell starts.

  2. From the Python shell, type the following commands:

    import django
    print django.get_version()
    

    The Python shell displays the Django version that is installed on your system.

Creating a test project

To create a test Django project, follow these steps:

  1. Create a default configuration for the project. To do this, type one of the following commands at the command line:
    • If you are using CentOS, type:
      django-admin.py startproject test_project
      
    • If you are using Fedora or Ubuntu, type:

      django-admin startproject test_project
      

    There is now a directory named test_project in the current directory. The following files are in the test_project directory:

    • __init__.py
    • manage.py
    • settings.py
    • urls.py
  2. To start the development server, type the following commands at the command line:

    cd test_project
    python manage.py runserver

    The development server runs on port 8000 at 127.0.0.1 (localhost).

  3. To view the project, log in to your system in a separate shell session, and then type the following command:

    lynx 127.0.0.1:8000

    You should see the following text:

    Welcome to Django
    It worked!

More Information