2.5. Setup Run Configuration

2.5.1. Assignments

# doctest: +SKIP_FILE

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -v myfile.py`

# %% About
# - Name: Django Setup RunConfiguration
# - Difficulty: medium
# - Lines: 0
# - Minutes: 3

# %% English
# 1. Create `Run Configuration` in your IDE:
#    - add new configuration: `Python`
#    - name: `makemigrations`
#    - script: `manage.py`
#    - parameters: `makemigrations`
#    - working directory: `myproject`
#    - environment variables: `DJANGO_DEBUG=True`
# 2. Run `makemigrations` configuration
# 3. Expected result: "No changes detected"
# 4. Run Doctests - all must succeed

# %% Polish
# 1. Stwórz w swoim IDE `Run Configuration`:
#    - add new configuration: `Python`
#    - name: `makemigrations`
#    - script: `manage.py`
#    - parameters: `makemigrations`
#    - working directory: `myproject`
#    - environment variables: `DJANGO_DEBUG=True`
# 2. Uruchom konfigurację `makemigrations`
# 3. Oczekiwany wynik: "No changes detected"
# 4. Uruchom Doctesty - wszystkie muszą się powieść

# %% Tests
"""
>>> import sys; sys.tracebacklimit = 0
>>> assert sys.version_info >= (3, 10), \
'Python 3.10+ required'
"""

...

# doctest: +SKIP_FILE

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -v myfile.py`

# %% About
# - Name: Django Setup RunConfiguration
# - Difficulty: medium
# - Lines: 0
# - Minutes: 3

# %% English
# 1. Create `Run Configuration` in your IDE:
#    - add new configuration: `Python`
#    - name: `migrate`
#    - script: `manage.py`
#    - parameters: `migrate`
#    - working directory: `myproject`
#    - environment variables: `DJANGO_DEBUG=True`
# 2. Use `copy configuration`
# 3. Run `migrate` configuration
# 4. Expected result: "No migrations to apply."
# 5. Run Doctests - all must succeed

# %% Polish
# 1. Stwórz w swoim IDE `Run Configuration`:
#    - add new configuration: `Python`
#    - name: `migrate`
#    - script: `manage.py`
#    - parameters: `migrate`
#    - working directory: `myproject`
#    - environment variables: `DJANGO_DEBUG=True`
# 2. Użyj `kopiowania konfiguracji`
# 3. Uruchom konfigurację `migrate`
# 4. Oczekiwany wynik: "No migrations to apply."
# 5. Uruchom Doctesty - wszystkie muszą się powieść

# %% Tests
"""
>>> import sys; sys.tracebacklimit = 0
>>> assert sys.version_info >= (3, 10), \
'Python 3.10+ required'
"""

...

# doctest: +SKIP_FILE

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -v myfile.py`

# %% About
# - Name: Django Setup RunConfiguration
# - Difficulty: medium
# - Lines: 0
# - Minutes: 3

# %% English
# 1. Create `Run Configuration` in your IDE:
#    - add new configuration: `Python`
#    - name: `runserver`
#    - script: `manage.py`
#    - parameters: `runserver`
#    - working directory: `myproject`
#    - environment variables: `DEBUG=True`
# 2. Run `runserver` configuration
# 3. Expected result: "Starting development server at http://localhost:8000/"
# 4. Run Doctests - all must succeed

# %% Polish
# 1. Stwórz w swoim IDE `Run Configuration`:
#    - add new configuration: `Python`
#    - name: `runserver`
#    - script: `manage.py`
#    - parameters: `runserver`
#    - working directory: `myproject`
#    - environment variables: `DEBUG=True`
# 2. Uruchom konfigurację `runserver`
# 3. Oczekiwany rezultat: "Starting development server at http://localhost:8000/"
# 4. Uruchom Doctesty - wszystkie muszą się powieść

# %% Hints
# - If port is blocked (you don't have the permission), use port 20_000

# %% Tests
"""
>>> import sys; sys.tracebacklimit = 0
>>> assert sys.version_info >= (3, 10), \
'Python 3.10+ required'
"""

...