We are a small, intelligent App development studio. We love "Building Amazing Apps", solving problems and cultivating strong relationships with our clients.
Serving static files in Django
By : Akshar Raaj
Serving static files, especially during development, is frequently a pain point. In this post, we will discuss the various settings and directory structure and how they interact with each other. Let's start with development when you have DEBUG = True.
We will create a Django project from scratch so that we are fully aware about what file in what directory we are talking about. So, this blog post will be a little longer than it should be. We will try these things with Django 1.4, but these will work on Django 1.3 as well. I have not tested ...
more info..Understanding decorators
By : Akshar Raaj
Understanding decorators in Python
We will divide this post into two topics
- Functions are objects and they can be passed around.
- Writing few decorators
As usual, I will be trying out the code in ipython and I suggest you to do the same.
Functions can be passed around similar to any other object in Python.
If you are already familiar with this, you can skip to next section.
Let's first write a class.
>>> class A(object):
... def __init__(self, a):
... self.a = a
...
Let's create an instance of this class.
>>> obj = A(5)
>>> print obj.a
5 #output ...Metaclass in Python
By : Akshar Raaj
In this post we will be talking about Metaclass in python. If you are reading some code which uses metaclass, you will probably come across __new__. If you are not familiar with what __new__ does, i suggest you first read about __new__.
You can read about __new__ in our last to last post
Throughout this post we will be talking about new style classes. Things might differ in old-style classes.
As we go, i will be trying everything on IPython and suggest you as well to try everything on IPython.
Let's see a little bit about normal Objects in ...
more info..__new__() in python
By : Akshar Raaj
Lately I started looking into Django code and wish to write about internals of Django. I started with Django models and will be writing about it soon. For understanding how Django models work, I had to understand what metaclasses are and how metaclasses work. Metaclasses use method "__new__" and so I looked at what "__new__" does.
As __new__ is a static method, we will see a lttle bit about static methods and then __new__ in detail.
-
Understanding static methods.
-
Understanding method "__new__" of any class. We will see how to override method __new__ in a class.
Also, I will be ...
more info..Understanding '*', '*args', '**' and '**kwargs'
By : Akshar Raaj
When i started learning Python, i was very confused regarding what args, kwargs, * and ** does. And i feel there are few like me who had this confusion and problem. With this post, i intend to reduce (hopefully i can eliminate) that confusion.
Throughout this post, i will be using ipython and i suggest you to try everything on ipython as well. We will intentionally make some mistakes along the way, so that we can understand this topic better.
Let's divide our work under five sections:
- Understanding what '*' does from inside a function call.
- Understanding what '*args' mean inside a ...
Getting started with South for Django DB migrations
By : Akshar Raaj
South is a migration tool used with Django.There will be times when you would be adding fields to a model or changing the type of field (eg: Field was an IntegerField and you want to change it to FloatField). In such cases syncdb doesn't help and South comes to your rescue.
There were times when i tried "python manage.py migrate southapp", got some error and then tried "python manage.py migrate southapp 0001 --fake". In some cases, that worked. When it did not work, i tried something else and so on. There were confusions regarding what --fake ...
more info..How to use jsTree
By : Akshar Raaj
Using jsTree
Problem Statement:
To show a TreeView (hierarchical view of information) structure in a Web page.
I came across this problem when i was required to develop a web application which allows its users to store contacts and their related information(name, email, phone). The contacts would go into a folder and any folder can have any number of subfolders and any subfolder can have any number of contacts. Also, the folder structure can be nested as many levels deep as the user wants. So, how do you show the folder structure in a Web Page?
You might encounter ...
more info..Setting up your system to start with Django development on Ubuntu:
By : Akshar Raaj
1>Being a Python web framework, Django requires Python. If you are on ubuntu, you probably have python installed on your system. If you don't have it installed, give the following command from the terminal:
sudo apt-get install python
This will install Python on your machine.
2>If you will be developing a database driven web application, you need to have a database setup on your system. I feel mysql is good and will tell you about installing mysql. It is pretty easy to install and use. You need to issue the following command from terminal:
sudo apt-get install ...- Deploying django using docker
- Common testing scenarios for Django app.
- Logging in Django
- Serving static files in Django
- Two Scoops of Django: Review
- Introduction to Python Workshop on February 15th, 2013
- Easy client side form validations for Django: Django Parsley
- MoreApps - Android Library Project: Open Sourced
- Tutorial: Building a Chrome app
- Password Generator App: Open Sourced
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- November 2012
- October 2012
- September 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- October 2011
- September 2011
- July 2011
- June 2011
- April 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- June 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- November 2008
- October 2008
- June 2008
- May 2008
- April 2008
Common testing scenarios for Django app.
By : Akshar Raaj
People are often confused regarding what tests to write. Let's look into some scenarios for which tests can be written.
Setting up the project
We start a Django project inside a virtual environment. In this post we would be using django 1.4.
Let's start an app named
blog.We will have the following model in
blog/models.py:We ...
more info..