We love designing and developing websites, but what really drives us is solving problems and cultivating strong relationships with our clients
I am so starving: Web app in python frameworks.
By : shabda
I have written the same web app in various web frameworks. Get it from Github.
Copied from the Readme.
This is a set of apps which creates the same application in various Python web micro-frameworks.
The app(s) talks to Facebook, and finds out recent people who have posted a public status with the text "so starving".
This idea came from reading Onion.
We have the same app in these frameworks.
Microframeworks:
Full stack frameworks:
If the framework included template engine and caching, that was used directly. Otherwise ...
more info..Doing things with Django models - aka - Django models tutorial
By : shabda
Django abstracts most of the actions you would be doing with the Database. What it doesn't abstracts, and doesn't try to abstract is the Database modelling part. This is a quick tutorial describing to how model your data in Django models.py, and how to access and modify them.
Consider a hypothetical HR department, which wants you to build an application to track and manage their processes. They have employees who work for a department, contractors who work for multiple department. Let's see how you you would do that in Django.
from django.db import models
class ...Tools of Pro Django developer - aka What powers dinette and almost every app we write.
By : shabda
There are some tools and apps which we use with almost all apps we write, and in particular which, we used for dinette. Here they are broken into useful during development, and (also) useful post development.
During Development
Ipython and ipdb
Ipython is a enhanced shell for python. Ipdb similarly add extra capacity to the builtin pdb debugger. It is extremely convenient to drop into a ipython shell right where a complex piece of code is being hit.
from IPython.Shell import IPShellEmbed
ipython = IPShellEmbed()
ipython()
Of course ...
more info..Python metaclasses and how Django uses them
By : shabda
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..Django for a Rails Developer
By : ashok
This is not yet another Django vs Rails blog post. It is a compilation of notes I made working with Django after having worked on Rails for years.
In this post I want to give a brief introduction to Django project layout from a Rails developer point of view, on what is there, what is not there and where to look for things. It should help a rails developer working on django be able to find the necessary files and underatnd the layout of the project files.
Once you have both the frameworks installed on your system you can create ...
more info..Writing your own template loaders
By : shabda
Django has three builtin template loaders which are used to get the templates for rendering.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
Writing your template loader is a awfuly easy. It is a callable which
- Returns a tuple of (openfile, filename) if it can find the template.
- Raise TemplateDoesNotExist if the templates cannot be found.
The simplest template loader can be
from django.template import TemplateDoesNotExist
def load_template_source(template_name, template_dirs=None):
try:
return open(template_name).read(), template_name
except IOError:
raise TemplateDoesNotExist, template_name
if you put this to your template loaders directory ...
more info..Beginning python
By : shabda
Slides and code from my talk at twincling.
Fun with none
By : rohit
(If you are in a hurry, here is the fun part.;) A few days ago, I was working with a nullable field, which wasn't behaving as I expected. So I started a shell, and see how nulls compare.
Funny, not as I expected. (Why is None < 10 True. I thought it would be either False or None or cause an Error?) So python is obviously broken, next steps, see the same thing in some other ... more info..In [1]: NoneIn [2]: None > 10Out[2]: FalseIn [3]: None < 10Out[3]: TrueIn [4]: None == NoneOut[4]: True
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..Understanding decorators
By : shabda
If you used Django for any length of time, you would have come across the
login_required decorator. You write @login_required before a view, and it
magically becomes accessible only to authenticated users.
Decorators were introduced in python 2.4. PEP 318
is the PEP describing it. At
the simplest decorators are nothing but callables returning other callables, and
the decorator syntax @decorator is nothing but foo = bar(foo), where both
bar and foo are callables.
Let us see some decorators in action.
In [1]: def good_function():
...: print 'I am a good function'
...:
...:
In [2]: def decorator(orig_func):
...: def bad_func():
...: print ...An Interview with Adrian Holovaty - Creator of Django
By : shabda
Adrian Holovaty is the co-creator of Django, author of the Django book and is currently the BDFL of Django along with Jacob Kaplan-Moss. He studied journalism at University of Missouri–Columbia and has worked with many news sites including Lawrence Journal World and Washington Post. He currently works at EveryBlock, a startup he founded.
Shabda: Would you tell a little about yourself? You majored in Journalism, how did you move to Programming?
Adrian: Sure! I have a dual background in journalism and computer science. I intended to get a degree in journalism and a minor in computer science, but things ...
more info..An Interview with Jacob Kaplan-Moss - Creator of Django
By : shabda
Jacob Kaplan-Moss is the co-creator of Django along with Adrian Holovaty, as well as the author of the Django Book. He has been involved with Django since before it was called Django. He is currently employed at Whiskey Media where his job is hacking at Django. He blogs on Jacobian.org. He graciously agreed to be interviewed at the 42topics blog.
Shabda: Would you tell a little about yourself? How did you get started with Django? What other software/applications have you worked with. (Both OSS and otherwise)?
Jacob: So a bit about me: I grew up in Silicon Valley ...
more info..Five Things I Hate About Django.
By : shabda
The five things I hate about * meme seems have died down, and memes, should not be allowed to die.
Of course I love Django, and have bet very heavily on it. But we do not know a topic, until we know it warts, so here you go. The listing is in no particular order, so sorry no numbering.
Ajax with Django is hard:
Most of the Django Community has decided that bundling Javascript helpers with a python framework is bad idea. Though I can understand the reasoning, (argued here and rebuttal), that Javascript is so basic that you can not ...
more info..New tutorial - Building a search engine with Appengine and Yahoo
By : shabda
I wrote a new tutorial on building a search engine using Appengine, and Yahoo Search API here. This uses pure Appengine API, and not Django, and is a tutorial on how to use Appengine without Django.
more info..First step to startup - Getting your pitch
By : shabda
With launch of Google Appengine, there has never been a better time to start a startup. Let not the lack of a business plan or a pitch hold you back. Go to our web 2.0 startup pitch generator, and get your own, custom, startup pitch. Hurry only 24192 available.
The original source for this was written by Nathan and was in Perl. Of course we needed a web2.0 logo for such a marvelous piece of code. This comes from web2.0 logo generator.
The source for this is available here
more info..Two Django+Appengine Tutorials
By : shabda
I have posted two Tutorials for Using Django with Appengine.
- For people who do not know Django
- For people who already know Django see what we build in this tutorial
And here a few good links about the topic.
- James Bennet tells exactly why Appengine and Django are not so good together.
- Ian Bicking has an interesting take on how Appengine can change the economics of Python hosting.
- The guys at Joyent reading my mind on why I or you can not deploy any production site on Appengine. (Hint. you mean I can never move away, without writing half my ...
Using Appengine with Django, why it is pretty much unusable
By : shabda
We are hard at work building 42topics.com, and are looking at the best places to deploy this. So when I heard about Appengine, with out of box Django support(gasp!) I was delighted. After using it for a day, and posting a tutorial, I am so disappointed.
Peeves in no particular order.
- Appengine is a very constrained environment, so out goes any chance to run background jobs.
- The ORM-API is very similar to Django, but yet the Django API is much better.
modelobj.filter('attr =', value1).filter('attr2 =', value2)ormodelobj.filter(attr = value1, attr2 = value2). Putting entity level ...
Google Appengine - First Impressions
By : shabda
Google launched their EC2 competitor, Appengine yesterday, and all hell broke loose. And in about 24 hours, the 10,000 accounts were used up. Currently it is tied to only working with python, and Django 0.96.1 works out of the box. <!- - more - ->
The Good
- Python powered. Django works out of the box.
- No sysadmining chores.
- Promise of infinite scalability with no configuration. (Ah!)
- Free for now.
The Bad
- Python powered, if you want to use ruby/java/php, sorry you are out of luck.
- Your code is tied to Google. You might be able to reuse most of ...
- How to use pep8.py to write better Django code
- Screencast: Django Tutorial Part 1
- How and why to use pyflakes to write better Python
- Getting started with South for Django DB migrations
- A brief overview of Vagrant
- Writing jQuery plugins using Coffeescript
- Behind the Scenes: Request to Response
- Using SQLite Database with Android
- Haml for Django developers
- Coffeescript for Python programmers
- rails
- django
- linkroundup
- django opinion
- opinion
- business
- API
- appengine
- python
- satire
- startup
- Uncategorized
- marketing
- personal
- rambling
- search
- interviews
- seo-interviews
- 5startupideas
- ideas
- seo
- tips
- forms
- paypal
- utilities
- datetime
- web2.0
- Amazon
- algorithms
- presentations
- products
- pinax
- satchmo
- ecommerce
- microsoft
- yahoo
- book
- tutorial
- models
- aggreagtion
- meta
- India
- apps
- about
- CSS
- Design
- wordpress
- test slug
- vim
- urls
- reviews
- javascript
- xmpp
- emacs
- Typography
- Grid Theory
- Color Theory
- iphone
- android
- titanium
- mobile applications
- CSS3
- Browser Compatibility
- mobile
- jobs
- lamson
- django setup
- files
- upload
- jsTree
- hierarchical view
- web page
- Treeview
- coffeescript
- request
- response
- South
- django south
- django migration
- --fake
- screencasts
- 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
Real time applications with Django, XMPP and StropheJS
By : Javed
TL;DR:
Introduction:
PubSub is a XMPP extension which allows publishing and subscribing to events. This is useful when you instantly want to notify many clients about something interesting happening on your server.
Quoting the authors of PubSub specs: