Running on DigitalOcean droplet, adress: http://206.189.12.80/
This was done following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04
sudo apt-get update sudo apt-get install python3-pip apache2 libapache2-mod-wsgi-py3 sudo pip3 install virtualenv mkdir ~/CryptoCurrencyRestAPI cd ~/CryptoCurrencyRestAPI virtualenv venv source venv/bin/activate
pip install django
then cloned the current repo (CryptoCurrencyRestAPI repo) into ~/CryptoCurrencyRestAPI
Edited the Django settings.py file: ALLOWED_HOSTS = ["206.189.12.80"] Added this to bottom of settings.py file: STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
cd ~/myproject ./manage.py makemigrations ./manage.py migrate ./manage.py createsuperuser ./manage.py collectstatic sudo ufw allow 8000 ./manage.py runserver 0.0.0.0:8000
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80> . . . (left initial code away for simplicities sake)
Alias /static /home/rik/CryptoCurrencyRestAPI/static
<Directory /home/rik/CryptoCurrencyRestAPI/static>
Require all granted
</Directory>
<Directory /home/rik/CryptoCurrencyRestAPI/CryptoCurrencyRestAPI>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess CryptoCurrencyRestAPI python-home=/home/rik/CryptoCurrencyRestAPI/venv python-path=/home/rik/CryptoCurrencyRestAPI
WSGIProcessGroup CryptoCurrencyRestAPI
WSGIScriptAlias / /home/rik/CryptoCurrencyRestAPI/CryptoCurrencyRestAPI/wsgi.py
chmod 664 ~/CryptoCurrencyRestAPI/mydatabase sudo chown :www-data ~/CryptoCurrencyRestAPI/dmydatabase sudo chown :www-data ~/CryptoCurrencyRestAPI sudo ufw delete allow 8000 sudo ufw allow 'Apache Full' sudo apache2ctl configtest (last line should read: "Syntax OK") sudo systemctl restart apache2