class used to define a class (a template from which you can create objects).
def used to define a function or method. The method is similar to a function belonging to a class.
# function def double(x): return x * 2
Think about the Django part of your question, sorry. Perhaps this should be a separate issue?
nakedfanatic
source share