We are a small, intelligent App development studio. We love "Building Amazing Apps", solving problems and cultivating strong relationships with our clients.
Rails and Django commands : comparison and conversion
By : Shabda Raaj
The most commonly used Rails commands and their Django equivalents
Rails | Django
rails console | manage.py shell
rails server | manage.py runserver
rake | None
rails generate | None
rails dbconsole | manage.py dbshell
rails app_name | django-admin.py startproject/manage.py startapp
rake db:create | manage.py syncdb
The salient points to note are,
- Django has all commands via
manage.py, Rails has it broken intorailsandrake. - Overall there are more Rails+Rake commands available than Django commands
- There is no one to one mapping between Rails and Django commands. Eg. There are no equivalent to rake doc:* or rake ...
The Rails and Django models layer Rosseta stone
By : Shabda Raaj
Rails Active records and Django models are more similar than they are different. This is a quick guide to converting between Rails 3 and Django 1.2, and is available on github at http://github.com/uswaretech/Acts-as-Django
Defining models
Both Django and Rails keep the canonical database representation in ruby or python.
#Django
class Post(models.Model):
name = models.CharField(max_length = 100, )
slug = models.CharField(max_length = 100, )
body = models.TextField()
class Comments(models.Model):
post = models.ForeignKey(Post)
username = models.CharField(max_length = 100, )
comment = models.TextField()
#Rails
#db/schema.rb
ActiveRecord::Schema.define(:version => 20100319195739) do
create_table "comments", :force ...Doing things with Django forms
By : Shabda Raaj
Forms are one of the best features of Django. (After models, admin, url routing etc :) ). Here is a quick tutorial describing how to do things with Django forms.
- Basic form
Prob. You want to show a form, validate it and display it.
Ans. Create a simple form.
class UserForm(forms.Form):
username = forms.CharField()
joined_on = forms.DateField()
This wil take care that the form is displayed with two text field, and a value for them are filled in, and the second field has correct formatting for a date.
2.
Prob. Create a form which has values populated depending upon a ...
more info..Django-buzz
By : Shabda Raaj
We have updated the Django popular stories widget, which powers the widget in the side bar. It is now on Github.
Earlier the code used was hardcoded to only find Django stories, but now you can create arbitary topics from admin.
Get the code and create the widgets on your servers, (or let us know, and we will create it here if it is interesting). We created three we want to track. Databases, Python and Javascript
Databases
Python
Javascript
We build amazing web apps. Talk to us to discuss what we can do for you.
more info..Using bpython shell with django (and some Ipython features you should know)
By : lakshman
What is bpython?
bpython is a fancy interface to the Python interpreter for Unix-like operating system.
says the bpython home page. It provides syntax highlighting, auto completion, auto-indentation and such stuff.
Unlike iPython, which implements then entire shell functions and emulates the standard python shell, and adds enhancements, bpython just adds features on top of the existing python shell functionality, using the curses module.
The "killer feature" of bpython is, as you can see from the image above, the IDE like prompting of the function parameters and the doc string of the function dynamically. I have always thought, what IntellijIDEA ...
more info..Python metaclasses and how Django uses them
By : Shabda Raaj
Foss.in is without doubt India's largest FOSS technology conference. Lakshman gave a talk today on "Python metaclasses and how Django uses them". Here are the slides from that talk.
[Edit]
Some reactions,
http://twitter.com/jaideep2588/status/6295483833
http://twitter.com/kunalbharati/status/6296572939
And the talk images, http://twitpic.com/rxhn7
You should follow us on twitter and Subscribe to our blog
more info..The magic of metaclasses in Python
By : Shabda Raaj
Metaclasses are a way for you to have a class act as the template for another class. They are simlar to a classfactory,
in that they create new classes. In words of Tim Peters Metaclasses are deeper magic than 99% of people are going to need.
However, in right hands they can be a potent tool, in particular Django uses metaclasses beautifully to create very beautiful declarative models. Without further ado, here is a very simple (and very wrong) metaclass example.
class Z(type):
def __new__(cls, name, bases, attrs, ):
print cls, name, bases, attrs
class A(object):
__metaclass__ = Z ...Pycon India 2009 : A Review
By : lakshman
Pycon India concluded last weekend at Indian Institute of Science, Bangalore.
There have been so many python/django conferences recently, I have been tracking them literally all through the year. Another one, SciPy India just got announced. Week long, with sprints!
Pycon India was attended by around 350 people and had 30 talks. I have attended many conferences, but this one was different. This one was where real people, the real developers gave talks and socialized. No enterprise BS, just the real thing*.
There were a vast majority of good talks. However, I could only attend a few. Strand use ...
more info..Better Python package management using source and version control systems
By : lakshman
Thanks to awesome django community, there is plenty of open source django code around.
These packages get updated quite often and if you use it often like we do, you'd have possibly realized the need to manage these packages better.
Thankfully, all python ever needs is the source, and all you need to do is to place the source in the python path.
Most projects use Distributed Version Control Systems like Mercurial and Git, and they come locally with the entire history of the source which provides a lot of control to use any version of the code. For ...
more info..Develop Twitter API application in django and deploy on Google App Engine
By : lakshman
Twitter's robust REST API enables building of good applications that leverage its increasingly large and real-time data.
Google's cloud system App Engine not only provides a scalable platform for deploying applications, but also proves to be economically viable because of its pay per resource usage model and a large free quota.
Little wonder then, there are increasingly large number of twitter apps being deployed on App Engine.
In this post, I am going to examine how to create a simple application based on twitter's REST API and deploy it on Google App Engine. A deployed version can ...
more info..Uswaretech whitepapers
By : rama
We have released some whitepapers recently, which you can get from our whitepapers subsection
- Django and J2EE
- Challenges and solutions in Offshore software development
- Usware Technologies Value Proposition
We are going to be publishing some more whitepapers very soon, so download the whitepapers and bookmark this page.
more info..Popularising Django - Part 2
By : Shabda Raaj
If you would have read my Popularizing Django post, you might know that I consider building a killer packaged app to be the best way to popularize Django. This is a post about what that app must be.
For PHP it was Wordpress and PhpBB. Both were free, very easy to install and came with every thing packaged. If you have followed the history of either you must know that they have always been plagued by security problems. Assertion: Most users, even programmers, value ease of use and install over technical superiority. Case in point, Windows vs Linux.
For Rails ...
more info..Five things I love about Django.
By : Shabda Raaj
I posted five things I hate about Django, so as a penance, I will of course have to tell the "Five things I love about Django".
The Admin interface rocks:
I have demoed Django to a fair number of People, and when you write a few lines in models.py, and then show the auto generated Admin interface, this is a jaw-dropping moment. Happened with me every time I introduced Django to someone. In Barcamp Hyderabad 05, people could not believe this was so easy, and asked if there was some more code behind this.
Of course Admin is much ...
more info..- 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
- Todo List App: Open Sourced
- 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
Great Indian Developer Summit 2010: A Review
By : lakshman
Great Indian Developer Summit, is the India's largest developer conference, held at Bangalore, India; in its third edition this year. The conference concluded last Friday. The summit had about a 1000 visitors on the first day and a comparable number on the other days.
The conference basically caters to the enterprises, and hence their focus on the .Net, Java and Flash. There were many star speakers.
I gave a talk on django, introducing it and then explaining the standard community conventions to make good reusable applications. Django, being a social software, developed by a community, it is important to ...
more info..