Tag Archives: virtualenv

Install and setup PostgreSQL for Django

1. Deactivate the virtualenv if there is.

pyenv deactivate

 

2. Install the required libraries.

sudo apt-get install libpq-dev python-dev

 

3. Install PostgreSQL.

sudo apt-get install postgresql postgresql-contrib

Continue reading Install and setup PostgreSQL for Django

Advertisements

Install Graphite under pyenv virtualenv on Ubuntu

It took me one and an half day to get the Graphite working…

1. Make sure you have pyenv and pyenv-virtualenv installed.

 

2. Install the following packages.

sudo apt-get install python-dev pkg-config libcairo2-dev memcached

 

3. Install Python 2.7 with enable-shared.

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.8

Continue reading Install Graphite under pyenv virtualenv on Ubuntu

Django – Setup Django REST framework

We have the Django welcome page working already.

 

I would like to create some REST services on that setup. We could make use of the Django REST framework.

Let’s keep working on our <project_root>/django_poc project to manage articles by REST. The example in this post are based on the Django REST framework quickstart tutorial. It’s good to go through all of them which could give you a more thorough idea on how the REST framework works.

1. Install the Django REST framework in your virtualenv.

pip install djangorestframework

Continue reading Django – Setup Django REST framework

Manage your Python projects with virtualenv

Last week we talked about managing multiple Pythons using pyenv.

 

But still we are lacking something like the Gemfile in Ruby for managing the version of those Python packages in a Python project. And here comes the Python virtualenv.

We can create different virtualenv on the same machine and each of them has its own Python binary, the pip package and the all other standard Python libraries needed to run the Python. In other words, each virtualenv acts like the Gemfile in a particular Python project.
Continue reading Manage your Python projects with virtualenv