2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-29 18:20:53 +00:00

Plugin reload fix ()

* Add option to disable auto-reload of dev server

* Force plugin reload

* Add unit testing for plugin reload

- Requires modifications to registry.py
This commit is contained in:
Oliver
2025-01-22 16:34:13 +11:00
committed by GitHub
parent 4a9785d5e9
commit 8e8b7158b7
6 changed files with 179 additions and 15 deletions

@ -911,13 +911,28 @@ def gunicorn(c, address='0.0.0.0:8000', workers=None):
run(c, cmd, pty=True)
@task(pre=[wait], help={'address': 'Server address:port (default=127.0.0.1:8000)'})
def server(c, address='127.0.0.1:8000'):
@task(
pre=[wait],
help={
'address': 'Server address:port (default=127.0.0.1:8000)',
'no_reload': 'Do not automatically reload the server in response to code changes',
'no_threading': 'Disable multi-threading for the development server',
},
)
def server(c, address='127.0.0.1:8000', no_reload=False, no_threading=False):
"""Launch a (development) server using Django's in-built webserver.
Note: This is *not* sufficient for a production installation.
"""
manage(c, f'runserver {address}', pty=True)
cmd = f'runserver {address}'
if no_reload:
cmd += ' --noreload'
if no_threading:
cmd += ' --nothreading'
manage(c, cmd, pty=True)
@task(pre=[wait])