Search code examples
cookiecutter-django

Upgrading Django version


I am trying to update the django version in requirements/base.txt from 3.0.11 to 3.1

requirements/base.txt

# Django
# ------------------------------------------------------------------------------
django==3.1  # pyup: < 3.1  # https://www.djangoproject.com/

Does upgrading Django version in the project would create a problem ?


Solution

  • Reading the official documentation it doesn't seem to have any compatibility issue. However, you have to see all the dependencies that your project uses.

    For exemple, if a requirement poll uses django and has defined its requirements.txt file as django<3.0, so you will have an error.

    In general, the best way is to create a new virtual environment and test if there are any dependency issues.

    python3 -m venv .venv
    source .venv/bin/activate
    python3 -m pip install -r requirements.txt
    python3 manage.py test
    python3 manage.py runserver