Only showing year in django admin, a YearField instead of DateField?

I found this solution which solves the whole thing quite elegantly I think (not my code): import datetime YEAR_CHOICES = [] for r in range(1980, (datetime.datetime.now().year+1)): YEAR_CHOICES.append((r,r)) year = models.IntegerField(_(‘year’), choices=YEAR_CHOICES, default=datetime.datetime.now().year) Edit the range start to extend the list 🙂

How can my django model DateField add 30 days to the provided value?

There is no need to implement custom save method. Also doing this default=datetime.now()+timedelta(days=30) is absolutely wrong! It gets evaluated when you start your instance of django. If you use apache it will probably work, because on some configurations apache revokes your django application on every request, but still you can find you self some day … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)