close

[Solved] python – django: why am I getting this error: AttributeError: ‘method_descriptor’ object has no attribute ‘today’?

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error python – django: why am I getting this error: AttributeError: ‘method_descriptor’ object has no attribute ‘today’? in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How python – django: why am I getting this error: AttributeError: ‘method_descriptor’ object has no attribute ‘today’ Error Occurs?

Today I get the following error python – django: why am I getting this error: AttributeError: ‘method_descriptor’ object has no attribute ‘today’? in python.

How To Solve python – django: why am I getting this error: AttributeError: ‘method_descriptor’ object has no attribute ‘today’ Error ?

  1. How To Solve python – django: why am I getting this error: AttributeError: 'method_descriptor' object has no attribute 'today' Error ?

    To Solve python – django: why am I getting this error: AttributeError: 'method_descriptor' object has no attribute 'today' Error “date” is a class on the datetime module, but it is also a method on the “datetime.datetime” class.

  2. python – django: why am I getting this error: AttributeError: 'method_descriptor' object has no attribute 'today'?

    To Solve python – django: why am I getting this error: AttributeError: 'method_descriptor' object has no attribute 'today' Error “date” is a class on the datetime module, but it is also a method on the “datetime.datetime” class.

Solution 1

The top answer is correct, but if you don’t want to import all of datetime you can write

from datetime import date

and then replace

datetime.date.today()

with

date.today()

Solution 2

You probably want “import datetime”, not “from datetime import datetime”.

“date” is a class on the datetime module, but it is also a method on the “datetime.datetime” class.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read