![]() |
![]() |
![]() |
![]() |
![]() |
VPS / VDS hosting >  Installing Django on VPS
Installing Django on a virtual server is done using a package that includes all the necessary services. Installation is performed in ssh linux console, Centos 7 is used as a server. The latest version of the package can be found on the developer's website Bitnami.
Before starting the installation, you need to make sure that there are no pre-installed services on the server, for example, to remove apache, use the command:
# yum remove httpd
We also recommend to immediately configure the firewall service:
# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
# service iptables save
# service iptables restart
Download and install the package:
# wget http://iso.ripnet.ru/vm-apps/bitnami-django-3.1.6-0-linux-x64-installer.run
# chmod +x bitnami-django-3.1.6-0-linux-x64-installer.run
# ./bitnami-django-3.1.6-0-linux-x64-installer.run
The script will offer a choice to install additional tools:
SQLite [Y/n] : Y
Select by default (Y)
MySQL [Y/n] : Y
Select by default (Y)
PostgreSQL [Y/n] : Y
Select by default (Y)
Django : Y (Cannot be edited)
Node.js [Y/n] : Y
Select by default (Y)
Is the selection above correct? [Y/n]: Y
The choice was made correctly.
Select a folder [/opt/djangostack-3.1.6-0]:
Press Enter if you want to leave the specified path as default
MySQL Server root password :
Re-enter password :
You need to set a password for the database root user
Please enter your database 'postgres' user password.
PostgreSQL postgres user password :
Re-enter password :
A password must be set for the postgres database user
Do you want to setup an initial project? [Y/n]: Y
Project Name [Project]: Test
[1] SQLite: The project will be configured to use SQLite as the database. Suitable for development and test environments.
[2] MySQL: The project will be configured to use MySQL as its database. Recommended for production environments.
[3] PostgreSQL: The project will be configured to use PostgreSQL as a database. Recommended for production environments.
Please choose an option [1] : 2
Hostname [xx.xxx.xxx.xx]:
To add a new project, use the command
# cd /opt/djangostack-3.1.6-0/apps/django/django_projects/PROJECT
# django-admin.py startproject PROJECT
Django installation complete.