rmountjoy92 / DashMachine

Another web application bookmark dashboard, with fun features.
GNU General Public License v3.0
1.24k stars 119 forks source link

Setup working, after reboot No module named 'flask_caching' error showing up #137

Closed clemone210 closed 4 years ago

clemone210 commented 4 years ago

Hello,

I setup everything well on Ubuntu 18.04.04 LTS with your python installation instructions. I want to setup the script with boot.

So after a reboot the script will not work anymore. If I run python3 run.py I get the following error:

root@ubuntu-server-guacamole:/etc/DashMachineEnv/DashMachine# python3 run.py
Traceback (most recent call last):
  File "run.py", line 17, in <module>
    from dashmachine import app
  File "/etc/DashMachineEnv/DashMachine/dashmachine/__init__.py", line 4, in <module>
    from flask_caching import Cache
ModuleNotFoundError: No module named 'flask_caching'

Could you help me out?

clemone210 commented 4 years ago

I worked it out.

I created a bash script in my root directory called startup.sh First I have to activate the virtualenv and afterwards run the python script to run DashMachine. so my startup.sh file looks like this:

#!/bin/bash

cd /etc
cd DashMachineEnv
source bin/activate
cd /etc
cd DashMachineEnv
cd DashMachine
python3 run.py

I made it executable using: chmod 755 startup.sh running the command bash /startup.sh brings up DashMachine when startet manually. To autostart it at boot I used crontab. crontab -e Added following line at the bottom: @reboot sudo /bin/bash /startup.sh 1> /home/timo/log.txt 2> /home/timo/err.txt & 1> /home/timo/log.txt 2> /home/timo/err.txt is not neccessary, its just to check if there is an error.