To show the field name instead of Model object, define the below function in your model class

def __unicode__(self):
        return  u'%s' % (self.name)

where 'name' is one of the class attribute

 


While trying the django http://127.0.0.1:8000/admin/ url you may get the the Exception "Site matching query does not exist"

    I got it fixed by removing the django.contrib.sites from settings.py file.

 

Compile all django or python files

Posted In: . By Webdevelopmentlogics


python -m compileall path/to/project

 

How to find the django version

Posted In: . By Webdevelopmentlogics


First we need to enter into the python promt.
Then
>> import django
>> django.get_version()

 


It's because the verification missing in the form and need to add {% csrf_token %} inside form tag