Opened 6 years ago

Last modified 5 years ago

#30479 closed Bug

Auto-reloading with StatReloader may not track changes to the main entrypoint? — at Initial Version

Reported by: Keryn Knight Owned by: nobody
Component: Utilities Version: 2.2
Severity: Release blocker Keywords: autoreload
Cc: Tom Forbes Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a bit convoluted, but here we go.

Environment (OSX 10.11):

$ python -V
Python 3.6.2
$ pip -V
pip 19.1.1
$ pip install Django==2.2.1 django-microscope==0.1.1
Requirement already satisfied: Django==2.2.1 in ./lib/python3.6/site-packages (2.2.1)
Requirement already satisfied: django-microscope==0.1.1 in ./lib/python3.6/site-packages (0.1.1)
Requirement already satisfied: sqlparse in ./lib/python3.6/site-packages (from Django==2.2.1) (0.3.0)
Requirement already satisfied: pytz in ./lib/python3.6/site-packages (from Django==2.2.1) (2019.1)
Requirement already satisfied: django-environ>=0.4.4 in ./lib/python3.6/site-packages (from django-microscope==0.1.1) (0.4.5)

Create a file, manage.py:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from microscope import run, routes


@routes.path("")
def index(request, *, x=None):
    return None


application = run(
    DEBUG=True,
    INSTALLED_APPS=(),
    ROOT_URLCONF=routes,
    ALLOWED_HOSTS=["127.0.0.1"],
    LOGGING={
        "version": 1,
        "disable_existing_loggers": False,
        "handlers": {"console": {"class": "logging.StreamHandler"}},
        "loggers": {
            "django.utils.autoreload": {
                "handlers": ["console"],
                "level": "DEBUG",
                "propagate": True,
            }
        },
    },
)

Then do:

$ python manage.py runserver 127.0.0.1:8080

and it should boot like normal. So far so good.


Steps to reproduce:

  • Edit the manage.py file. Just change the ALLOWED_IPS setting or whatever.

Under 2.1.8 (and prior), this will trigger the auto-reloading mechanism. Under 2.2.1, it won't. As far as I can tell from the django.utils.autoreload log lines, it never sees the manage.py itself.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top