Skip to content

official-documentation-samples/django does not run due to Python version mismatch #539

Open
@weslord

Description

Following the instructions in Quickstart: Compose and Django causes the app to crash with an error:

 Container django-docker-db-1  Running
Traceback (most recent call last):
  File "/usr/local/bin/django-admin", line 8, in <module>
    sys.exit(execute_from_command_line())
             ~~~~~~~~~~~~~~~~~~~~~~~~~^^

  [...lines removed for readability...]

  File "/usr/local/lib/python3.13/site-packages/django/core/management/templates.py", line 1, in <module>
    import cgi
ModuleNotFoundError: No module named 'cgi'

cgi was removed in the latest version of Python.

The example restricts Django to version 3.2:

Django>=3.0,<4.0

But uses the latest version of Python (incompatible with Django 3.2):

FROM python:3

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions