Python version 2.7
Django version 1.11
Trying to make my first Django app saving documents, here the part of models.py
class Docs(models.Model):
FacilityRef = models.ForeignKey(Facility)
Date = models.DateField(default=date.today)
Type = models.CharField(max_length=50)
Link = models.FileField(upload_to='Docs/%Y/%m/%d')
When making migration got the following error:
Date = models.DateField(default=date.today) NameError: name 'date' is not defined
Part of views.py:
from django.http import HttpResponse
import datetime
Part of models.py
from django.db import models
import datetime
Tried to insert the following strings in views.py and models.py as it mentioned in here and here it didn't help
from django.utils import timezone
from datetime import datetime
What kind of import should I do to make this function work?