Quick-start guide

This chapter provides quick-start instructions in order to allow you to quickly deploy and test Django Conntrackt application.

Debian/Ubuntu

Install the required distribution packages:

sudo apt-get install python2.7 graphviz virtualenv virtualenvwrapper

Open up a new shell to make sure the virtualenvwrapper is now active.

Create the virtual environment for testing Django Conntrackt:

mkvirtualenv conntrackt

Install Django Conntrackt with its requirements:

workon conntrackt
pip install django-conntrackt

Warning

You will need to update the pip installation in your virtual environment if you get the following error while running the above command:

AttributeError: 'NoneType' object has no attribute 'skip_requirements_regex'

You can update pip to latest version with:

pip install -U pip

Start a new Django Conntrackt project:

django-admin.py startproject conntrackt_test

Edit configuration file conntrackt_test/conntrackt_test/settings.py to set-up some basic settings:

  1. Under DATABASES set parameter ENGINE to 'django.db.backends.sqlite3'.

  2. Under DATABASES set parameter NAME to 'conntrackt_test.sqlite'.

  3. Under INSTALLED_APPS uncomment the line 'django.contrib.admin'.

  4. Under INSTALLED_APPS append lines:

    'south',
    'braces',
    'conntrackt',
    
  5. Append the following lines to the end of the file:

    from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
    TEMPLATE_CONTEXT_PROCESSORS += (
        "django.core.context_processors.request",
    )
    

Edit the URL configuration file conntrackt_test/conntrackt_test/urls/.py to set-up the URLs for the admin website and Conntrackt itself:

  1. At the top of the file, add line from django.http import HttpResponseRedirect.

  2. Uncomment line from django.contrib import admin.

  3. Uncomment line admin.autodiscover().

  4. Uncomment line url(r'^admin/', include(admin.site.urls)),

  5. Under urlpatterns append lines:

    url(r'^$', lambda r : HttpResponseRedirect('conntrackt/')),
    url(r'^conntrackt/', include('conntrackt.urls')),
    

Set-up the database for the project:

cd conntrackt_test/
python manage.py syncdb
python manage.py migrate

You will be prompted to provide some additional information:

  1. When prompted to create a superuser, answer yes.
  2. Provide the desired username when prompted for it.
  3. Provide the desired e-mail address when prompted for it.
  4. Provide the desired password for created user.

After this the project is fully configured to run Django Conntrackt. Run the Django development server (good enough for testing, but don’t use it in production):

python manage.py runserver
You can now explore the functionality of Djang Conntrackt at::
http://localhost:8000/

If you have any problems getting around and understanding how the applications works, have a look at the usage guide.