Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 5 Tests - Community Effort #30

Open
app-generator opened this issue Dec 16, 2023 · 2 comments
Open

Django 5 Tests - Community Effort #30

app-generator opened this issue Dec 16, 2023 · 2 comments

Comments

@app-generator
Copy link
Owner

To be updated.

@Alphagest
Copy link

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

@app-generator
Copy link
Owner Author

Ty @Alphagest

All the above is noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants