3.4. Setup Run Server

3.4.1. Runserver

$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
January 1, 2000 - 00:00:00
Django version 5.0.4, using settings 'myproject.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Open your browser and go to the following URLs:

  • http://127.0.0.1:8000/

  • http://localhost:8000/admin/

3.4.2. IDE Run configuration

3.4.3. Run configuration

3.4.4. Debug configuration

3.4.5. Assignments

Code 3.92. Solution
# doctest: +SKIP_FILE
"""
* Assignment: Django Conf Runserver
* Complexity: easy
* Lines of code: 1 lines
* Time: 2 min

English:
    1. Run server:
        a. ip: 127.0.0.1
        b. port: 8000
    2. Open browser and goto http://127.0.0.1:8000/
    3. Run doctests - all must succeed

Polish:
    1. Uruchom serwer:
        a. ip: 127.0.0.1
        b. port: 8000
    2. Otwórz przeglądarkę i przejdź na stronę http://127.0.0.1:8000/
    3. Uruchom doctesty - wszystkie muszą się powieść

Tests:
    >>> import sys; sys.tracebacklimit = 0
    >>> from urllib.request import urlopen

    >>> response = urlopen('http://127.0.0.1:8000/')
    >>> result = response.read().decode('utf-8')
    >>> assert result is not None
"""


Code 3.93. Solution
"""
* Assignment: Django Conf RunConfiguration
* Complexity: medium
* Lines of code: 0 lines
* Time: 8 min

English:
    1. Create `Run Configuration` in your IDE:
        a. add new configuration: `Python`
        b. name: `runserver`
        c. script: `manage.py`
        d. parameters: `runserver`
        e. working directory: `myproject`
        f. environment variables: `DEBUG=True`
    2. Run `runserver` configuration
    3. Run Doctests - all must succeed

Polish:
    1. Stwórz w swoim IDE `Run Configuration`:
        a. add new configuration: `Python`
        b. name: `runserver`
        c. script: `manage.py`
        d. parameters: `runserver`
        e. working directory: `myproject`
        f. environment variables: `DEBUG=True`
    2. Uruchom konfigurację `runserver`
    3. Uruchom Doctesty - wszystkie muszą się powieść
"""