Skip to content
Zcentric

The old blog · Category

django

  1. Fun with Django ManyToMany Fields

    Tweet This is just another reason I find Django so easy. For example.. Say you are making a monitoring application. Now you have a bunch of servers and you have certain groups of servers. A server can belong in more …

  2. Get Django-NonRel working with VirtualEnv

    Tweet MongoDB is getting a lot of press recently. I stumbled across a pretty interesting project called Django-nonrel. This is an attempt to build non-relational databases right into mongodb. Before you could always use …

  3. WSGI Holygrail run multiple versions of Python on same webserver

    Tweet One issue hosting providers have is the issue with clients needing to run different version of python. One client might need python 2.4 and others might need 2.5. So in comes uWSGI So this blog post will go over …

  4. Django fix for ‘User’ object has no attribute ‘backend

    Tweet I was trying to auto login a user if I had their user object and was getting this error when I just called something like login(request, user) Well this is due to Django wanting to make sure you auth the user …

  5. Reason #4 on why Django is great

    Tweet Middleware! I can’t tell you how great middleware is in Django. It makes life so easy! Here is a good example. Django doesn’t handle ajax errors very good. It prints them to the client. Sure I can use …

  6. Reason #3 on why Django is great

    Tweet Making custom model fields are a great thing to save a lot of time. If you need a lot of custom validation around your modelforms and don’t want to do a lot of copy and pasting then create a custom model …

  7. Django: Custom Decorator with an Argument

    Tweet Sometimes you want to be able to create a decorator for functions in Django but have the ability to pass in an argument into the decorator. I came across this when I wanted to switch from the require_login …

  8. Reason #2 on why Django is great

    Tweet The decorators that Django has are a great time saver. There are a lot of methods in your views where you only want logged in users to see. So you can use a decorator before the function to check if they are …

  9. Reason #1 on why Django is great

    Tweet All the crazy helper function they have for models to display information in templates. Say I have a model that looks like this with a choice field (it will get rendered as a select input in html. SEX_CHOICE = ( …

All posts