I have created an API in latest version of Django using latest version of Tastypie. When I run the server of Django I get this error:
cant import "datetime_safe" from "django.utils"
I already have tried reinstalling the tastypie.
The datetime_safe module Tastypie is trying to access does not exist from version 5.0 of Django onwards. This is because Tastypie requires Django version 4.2 and does not support Django 5.* which you seem to have installed.
datetime_safe
You need to run this in the command line to downgrade Django to v4.2. (source: this SO post)
python -m pip install --upgrade Django==4.2.8
I hope this is helpful - please let me know if it doesn't work.
Try to install latest version of django-tastyepie from git repository
pip install git+https://github.com/django-tastypie/django-tastypie.git
The
datetime_safemodule Tastypie is trying to access does not exist from version 5.0 of Django onwards. This is because Tastypie requires Django version 4.2 and does not support Django 5.* which you seem to have installed.You need to run this in the command line to downgrade Django to v4.2. (source: this SO post)
I hope this is helpful - please let me know if it doesn't work.