Integrate Django with Apache

Introduction

As production run of a Django application, we can use tradition web server tools such as apache, IIS, etc. For example, I will show you to setup django running under apache as below.

Step 1 Install wsgi

Suppose you have already installed python, django, apache, then you need to install wsgi by running command:

sudo apt-get install libapache2-mod-wsgi

Step 2

Edit /etc/apache2/sites-available/000-default.conf as below:

<VirtualHost *:80>
        ServerName www.goldman168.no-ip.org
        #ServerAllas www.localhost
        ServerAdmin goldman.au168@gmail.com

        DocumentRoot /var/www/html/django-survey-master/
        WSGIScriptAlias / /var/www/html/django-survey-master/survey/wsgi.py

        Errorlog /var/www/logs/error.log
        CustomLog /var/www/logs/custom.log combined
</VirtualHost>

Step 3.

Edit /etc/apache2/apache.conf to add the following line to the end:

WSGIPythonPath /var/www/html/django-survey-master

Step 4.

Restart apache service by running command:  /etc/init.d/apache2 restart

Step 5.

Now, you do not need to run the django command (python manage.py runserver) to start the django application, you can browse the django application with link http://localhost/ via apache.

Setup a Survey Web Site with Python & Django

Introduction

This document shows how to setup a survey web site using python 2.7 and django 1.4. We do not need to use web server software such as IIS or Apache while python can start web server service itself. This survey web site can run under window and linux env provide that it has python. I will show its setup steps as below.

Step 1.

Download the program source code “django-survey-master.zip” from web site https://github.com/jessykate/djngo-survey and unzip it to a computer with python 2.7.

Step 2.

Under the django-survey-master directory, run the command $ pip install -r requirements.txt to install django.

Step 3.

Setup the survey database as command $ python manage.py syncdb , which you need to input a username and password.

Step 4.

Start the survey server as command $ python manage.py runserver ,as below screen dump:

survey1

Step 5.

Setup a survey as below screen dump with link http://127.0.0.1:8000/admin :

survey3

survey4

Step 6.

Browse the survey web site to fill-in a survey as below link http://127.0.0.1:8000 :

survey2

survey5

Bonus of a problem solving

Problem 1: The Survey web site is with link localhost:8000 and 127.0.0.1:8000 in its computer and that works fine. However, it cannot be accessed from other computer in the same network.

Solution 1: Start the Web Site Server with its own ip address, such as $ python manage.py runserver 192.168.5.105:8000; then other computers in the same network can access it with link http://192.168.5.105:8000.

Problem 2: If you have problem of running http://127.0.0.1:8000/admin, it comes out a error message “Admin Site: TemplateDoesNotExist at /admin/ …”

Solution 2: Force to re-download django with command:

pip install -r requirements.txt --ignore-installed --force-reinstall --upgrade --no-cache-dir

Comparison Video Conference Software (WebEx, TrueConf, AnyMeeting, GoToWebinar, Skype)

Introduction

I compared several web base webinars and video conference tools, anymeeting, GoToWebinar, Webex, TrueConf, Skype, with their screen dump example as below.

VC-Software

Testing

I tested WebEx between HK & PRC, which we can have meeting with video, audio, screen sharing. However, the video display is not stable as below screen dump because of low bandwidth.

WebEx1

I found another VC Tools, called TrueConf from http://trueconf.com/ . I tested its performance of cam video, voice, share picture file between HK & PRC, and I found it was better than WebEx on Cam display because it will not show a blank screen while it display a Cam picture during low bandwidth network. However, when sharing desktop, its screen was bad.

TrueConf1

TrueConf desktop sharing had latency problem as below:

TrueConf2

GoToWebinar is a webinar tools for presentation, but not a video conf tools. We can share video only from host to client, but no display from client to host.

GoToWebinar

The audio from AnyMeeting is bad, so that it is not a good choice, neither. Although the audio from WebEx is good, using the voice through WebEx consumes more bandwidth and it affects the video display.

AnyMeeting

Base on my experience in past, Skype is a good tool for audio communication, but not good from video. I always use it for audio conf, so that I did not test it this time.

I rate my testing result as below table:

 WebEx  GoToWebinar  AnyMeeting  Skype TrueConf
Audio  5  5 3  5 4
Video  3  4 4  2 3
Chat  5  5 5  5 5
Desktop/File Sharing  4  4 4  2 3
User Friendly 4 5 4  5 5
Usage Cost $99/month $99/month $78/month Free Free
Remark Sharing video only from host to client, but no display from client to host. I estimated the score of Skype base on my experience in past. I do not test it this time.

Note:  I estimate the score from range 1 to 5 where 1 for bad, and 5 for excellent.

Conclusion

WebEx is the best among other VC software but its video function sometimes has problem. Although WebEx have intermittent problem on camera video, its desktop sharing screen still can work during low network bandwidth. Hence, WebEx is the best VC solution from our testing.