Hey everyone, I've tried to have a look in the sea...
# general
h
Hey everyone, I've tried to have a look in the search but couldn't find any info. Basically i want restartable=True to also restart when some of my html/css files change in my project. My project is like so:
Copy code
python_sources(name="src", skip_mypy=True)

pex_binary(
    name="web",
    entry_point="gunicorn",
    dependencies=[":src", "./templates:templates", "./static/css:css"],
    args=[
        "dh.cannery.web:create_app",
        "--access-logfile=-",
        "--bind",
        "0.0.0.0:8091",
        "--worker-class",
        "aiohttp.GunicornWebWorker",
    ],
    layout="packed",
    execution_mode="venv",
    restartable=True,
)
I'd have assumed adding dependencies for the templates and css would also watch those files. Please let me know.
h
Yes, those
dependencies
should ensure that the files targets they match cause the reloading you expect. Does this work when
.py
files are changed?
h
Yes reloading works when i change a python file although I've noticed now that when i just refresh the running application it seems to be dynaimcally reading the html and css files and therefore not needing reloading. How should i be doing things. Is this correct?
h
At a glance it looks like what you’re doing is correct, and I would expect template/css edits to cause gunicorn to restart.
If you’re not seeing that then a small-scale repo that reproduces the problem would be valuable, because, for example, I believe it works in https://github.com/pantsbuild/example-django
1
h
If I run into further issues I'll let you know for now its not so much of a problem. Thank you!
🙏 1