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

 


This error comes because you have not imported the calling object. Please import everyting from class and try
 Ex: from MyClass import *

 


 This error may occur while creating a new project. The following can be any of the reason for this
 
  1. Check django installed properly, and check the folder site-packages in python installed folder.
  2. There can be issue with setting the PATH to the django folder and this can be solved by giving the full path
       Ex: /usr/lib/python2.7/site-packages/django/bin/django-admin.py startproject mysite
  3. This script should not execute from the python console. Go to the directory where you want to save the project then execute the command django-admin.py startproject mysite