3.1. Setup Install Django

3.1.1. Install

$ python -m pip install django

3.1.2. Version

>>> import django
>>>
>>> django.__version__ 
'5.0.4'

3.1.3. Assignments

Code 3.92. Solution
"""
* Assignment: Django Conf Install
* Complexity: easy
* Lines of code: 1 line
* Time: 2 min

English:
    1. Install Django in the newest version

Polish:
    1. Zainstaluj Django w najnowszej wersji

Tests:
    >>> import sys; sys.tracebacklimit = 0
    >>> import django

    >>> version = tuple(int(x) for x in django.__version__.split('.'))
    >>> assert version >= (5, 0), \
    'Django version is too old. Expected at least 5.0'
"""


Code 3.93. Solution
"""
* Assignment: Django Conf Version
* Complexity: easy
* Lines of code: 2 lines
* Time: 3 min

English:
    1. Define variable `result: str` with Django version
    2. Version has to be in format `X.Y.Z`
    3. Run doctests - all must succeed

Polish:
    1. Zdefiniuj zmienną `result: str` z wersją Django
    2. Wersja musi być w formacie `X.Y.Z`
    3. Uruchom doctesty - wszystkie muszą się powieść

Tests:
    >>> import sys; sys.tracebacklimit = 0
    >>> from pprint import pprint

    >>> assert type(result) is not Ellipsis, \
    'Assign result to variable `result`'
    >>> assert type(result) is str, \
    'Variable `result` has invalid type, should be str'

    >>> result.startswith('5.0')
    True
"""

# Define variable `result: str` with Django version
# type: str
result = ...