Skip to content
Zcentric

The old blog · Tag

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. 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 …

  3. 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 …

  4. 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 …

  5. 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 …

  6. 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