Installing Django on Ubuntu memo

| Comments

Here are a few notes and links after moving to the new Ubuntu server on linode.com.

Some steps for security: My First 5 Minutes On A Server

Install packages:

apt-get install apache2 libapache2-mod-wsgi
apt-get install postgresql postgresql-server-dev-9.1 python-dev
apt-get install mysql-server mysql-common mysql-client libmysqlclient-dev 
apt-get install git git-core

Setup virtualenv:

apt-get install python-setuptools
apt-get install python-pip
pip install virtualenv
virtualenv --no-site-packages /path/to/venv

Install PIL in virtualenv:

apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
pip install PIL

StackOverflow Charts

| Comments

A month ago I began to participate in StackOverflow process. So I was interested to collect some statistics data and find where am I in this game. StackOverflow has a good API with limits for 300 requests/days for anonymous user and 10 000 requests/day for authorized. I created a simple bot on python, collected data to MongoDb and built these charts. With 10 000 requests and page size 100 I got users from highest reputation (524k) to 269. So I built these charts starting from reputation of 300.

The number of users with reputation > 300 is 96 654. And total number of users is about 1 375 000. So the percent of active users is about 7%.

My version of django boilerplate

| Comments

django_boilerplate - it’s a template to fast start new Django project.

Based on:

Used apps:

It also includes example app with List, Create, Update, Delete views.

Install

pip install -r requirements.txt
python manage.py syncdb

A simple CRUD app with Django and Mongoengine

| Comments

There are several possibilities to use MongoDB in Django:

Django MongoDB uses django-nonrel, which is a fork based on Django 1.3.
I don’t like this idea, because now Django 1.5 is ready to out. Beetween Mongoengine and MongoKit, I like more Mongoengine. There are several comparative articles:

So I created a simple CRUD app using Mongoengine.

« 14/14