Why you import this? You are not using and this not works fine in models.py only in views.py