Skip to content

Server Troubleshooting

Luis David Licea Torres edited this page Apr 26, 2022 · 1 revision

Server Troubleshooting

These guidelines are useful for troubleshooting the server.

After pip3 install

Restart the server every time after using pip3 to install a package.

sudo service apache2 restart

After git pull

Update ownership

Change the ownership of the files that have been pulled.

sudo chown -R www-data .

This command recursively gives ownership to the Apache www-data user on the current directory and sub-directories.

Run manage.py commands

The following commands make and apply database migrations.

python3 manage.py makemigrations
python3 manage.py migrate

Additionally, collect any static files such as images and CSS files that may have been pulled.

python3 manage.py collectstatic

Environment Variables

Setup env variables such as passwords, emails, and keys by adding them to /etc/apache2/envvar.

export EMAIL="[email protected]"
export PASS="secret-password"
export KEY="secret-key"

Server Errors

Whenever server errors occur, try checking the logs on /var/log/apache2/<domain>.log.