The AttributeError: 'method_descriptor' object has no attribute 'today' error typically occurs when you are trying to access the today attribute of an object and the object does not have this attribute.
The today attribute is typically a method or property of the datetime module in Python, which is part of the Python standard library. It returns the current date as a datetime object.
Here is an example of how to use the today method in the datetime module to get the current date:
Copy code
import datetime
today = datetime.date.today()
print(today) # Output: 2022-12-19
If you are getting the AttributeError: 'method_descriptor' object has no attribute 'today' error, it is likely that you are trying to access the today attribute of a different object or module that does not have this attribute.
To fix this error, make sure that you are using the correct object or module and that you are accessing the today attribute correctly.
If you are unsure what object or module you are using, you can use the type function to check the type of the object.
For example:
Copy code
import datetime
obj = datetime.date
print(type(obj)) # Output: <class 'type'>
If the type of the object is not datetime.date, you will need to use a different object or module to access the today attribute.