motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.86k stars 649 forks source link

Development environment / live reload #2901

Open sevimuelli opened 6 months ago

sevimuelli commented 6 months ago

Hi There is not much documentation concerning development of motionEye. What is the best way to run motionEye for development? Some way to have the project open in VS Code and continuously update the changes. Ideally, I could run it inside a container. I saw that inside server.py, when starting the Tornado webserver, there is an argument "debug", which is kinda doing this. But there is no way to set this under normal operation. What is the normal approach the developer here use? Any help is appreciated.

MichaIng commented 6 months ago

Python does not seem to have a native autoreload feature, which would be required here.

I tend to just restart motionEye when testing changes:

systemctl restart motioneye
zagrim commented 5 months ago

I tend to use the following manual "reload" cycle (simplified version here, as if not using Python venv): Rebuild: rm -r build/ motioneye.egg-info/; python3 -m pip install . Start: ~/.local/bin/meyectl startserver -c path/to/my/development/config Terminate server and repeat after changes to code.