A installation guide for getting Django setup on Digital Ocean
-
Sign up for a Digital Ocean account Affiliate | Non-Affiliate
-
Login
-
Create Droplet
-
Under
DistributionsselectDebianversion8.6x64or newer. -
Choose a size in your budget
-
Choose a
datacenter regionlikely one close to your target audience -
Leave out SSH Key unless you know how to create one.
-
Finalize and create: 1 Droplet is fine
-
Let Droplet finish initializing
-
Check email for the following (unless you setup an SSH Key on step #7):
Droplet Name: <droplet_name>
IP Address: <ip_address>
Username: <username>
Password: <password>
-
In terminal(PuTTY if on Windows) and enter:
# format ssh root@<ip_address> #example: ssh root@104.131.146.34 -
You should see a message like:
The authenticity of host '104.131.146.34 (104.131.146.34)' can't be established.
ECDSA key fingerprint is SHA256:Dg4o2zcwBMMx72IJEgdhJm/iDWtoQzWVmSuRV8B4db4.
Are you sure you want to continue connecting (yes/no)?
Type yes then hit enter
-
It should ask for your
<password>, we recevied in our email (unless you setup an SSH Key) -
It will ask for your
<password>again so you can reset it. Set a<new_password>and then confirm it. From now on, use this<new_password>withssh root@<ip_address>to acccess yourDroplet.
Setup Local Django Project here
Setup your Debian System for Django + Apache here
-
Open an FTP Client (like Transmit or Cyberduck)
-
SFTP into your
<ip_address>usingrootand yourpassword -
Navigate to
/var/www/venv -
Replace
srcwith yoursrc -
Navigate to
src/<your-project>/settings/and removelocal.py -
Open Terminal/PuTTY
-
SSH into your
<ip_address>likessh root@<ip_address> -
Update Apache2 to your project's name/settings if needed.
-
Run the following:
cd /var/www/venv/ source bin/activate cd src python manage.py makemigrations python manage.py migrate -
Restart apache
sudo service apache2 restart -
Navigate to your
<ip_address>(or domain name) in your browser.