mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-29 18:20:53 +00:00
Plugin reload fix (#8922)
* 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:
21
tasks.py
21
tasks.py
@ -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])
|
||||
|
Reference in New Issue
Block a user