Django 5 Tests - Community Effort
app-generator opened this issue Β· comments
To be updated.
For context, I removed all references to specific versions in the requirements.txt file.
work with latest django (5) and all latests modules.
python3.12.
I also used pipenv to create and activate the virtual environment
the list of problems during installation:
1- Commande : python manage.py makemigrations
πError :
core\settings.py", line 16, in <module>
from distutils.util import strtobool
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'
πsolution: use django-environ instead of dotenv
2- : Commande : python manage.py makemigrations
π Error :
\apps\api\urls.py:8: SyntaxWarning: invalid escape sequence '\d'
re_path("sales/((?P<pk>\d+)/)?", csrf_exempt(SalesView.as_view())),
π Sollution : re_path(r"sales/((?P<pk>\d+)/)?", csrf_exempt(SalesView.as_view())),
3-: Commande : Navigate to users/user-list
π Error :
UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'django.contrib.auth.models.User'> QuerySet.
paginator = Paginator(user_list, 5)
π **Sollution :add ** .order_by('username')
to users/views.py ligne 100
π― with these modifications, everything seems to work correctly
Ty @Alphagest
All the above is noted.