Deploy Django App in 5 Easy Steps

By : Saket Bhushan

So you just bought a new VPS, have installed Ubuntu and want to deploy your django app, GREAT!! We shall get your app, up and running in 5 easy steps, using best(arguably) of tools available. The post is targeted to audience who are new to deployment arena, but assumes you are comfortable with developing basic django apps. We shall be using gunicorn as our server and nginx nginx as our reverse proxy and static hanlder. Here we go:

1. Login and OS Updation:

$ ssh root@{your_ip}

# apt-get update

# apt-get upgrade

# apt-get dist-upgrade

# dpkg-reconfigure tzdata #choose your time zone

2 ...

more info..

Project Management Tools for Start-Ups

By : Anoop Thomas Mathew

An integral part in the success or failure, of any company is the management and communication between peers within the company as well as a well formed communication with the clients itself. 1990s was marked with the rise of tools like bugzilla, trac and a few other, which allowed developers to develop collaboratively, and more over, a bit more organized with the ticketing system. One thing to be noted is that, they did what they were supposed to do, and they still do.

As the time pass by, we got a huge number of code hosting, along with project management ...

more info..

Generating a pdf from an image using PIL and django

By : Saket Bhushan

In this post we shall be performing small image manipulation on the server side and allowing the user to download the pdf. This might be found useful if you design a quiz app and want to generate a certificate for the users. The various methods which can be followed to generate the certificate are:

  1. Have an image file to serve as a template, use css to place the username at the desired location.
  2. Have a pdf file, which can be edited to take the username of the current user if he has passed certain test.
  3. Have an image template ready ...

more info..

Dynamically attaching SITE_ID to Django Caching

By : Anoop Thomas Mathew

It would be useful and convenient, if you have an automatic way to add the SITE_ID, especially, when you have multiple sites running on the same deployment. Django provides a cache prefix function KEY_FUNCTION in settings which can be used to achieve this.

Just follow the following steps, and your cache, automatically prepends SITE_ID to the cache key, making it unique across multiple sites.

  1. Put the following into the settings file.

         CACHES = {
         'default': {
          'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
           'LOCATION': 'cache_table',
           KEY_FUNCTION = projectname.appname.modulename.functionname,
  2. Write a function to get current site id, say, get_current_site(), which returns current ...

more info..

Deploying Django apps on Heroku

By : Shabda Raaj

Read this first:

This is a great article by the Heroku. I am just filling in some more details and making this step-by-step.

  1. Get your Django project code.

  2. Create a virtualenv with a no-site-packages command

    virtualenv vent --no-site-packages
  3. Install Django, psycopg2 (postgres connector), gunicorn and any other required Django libraries.

  4. Confirm that you have all the required libraries and you can run your code locally using runserver.

  5. Create a requirement.txt by using
    pip freeze > requirements.txt
  6. Make sure you have a requirements.txt at the root of your repo. Heroku uses ...

more info..
Topics : django
© Agiliq, 2009-2012