Install Python versi 3
#apt-get install python3
Check Version python
#
python3 -V
install pip3
#
apt-get install -y python3-pip
check pip3 version
#
pip3 -V
install virtualenv
#pip3 install virtualenv
check version virtualenv
#
virtualenv --version
buat direkstory baru untuk nanti aplikasi berjalan
#mkdir django-apps
#
cd django-apps
membuat virtual env
#
virtualenv env
dan kemudian activate
#. env/bin/activate
(env) root@TS1:/home/snev/django-belajar#
Install django
#
pip install django
check version
#
django-admin --version
Membuat project
#
django-admin startproject testsite
#cd testsite
#cd testsite/
masuk dan edit setting.py
#nano ~/django-apps/testsite/testsite/settings.py
ALLOWED_HOSTS = ['192.168.100.6']
SAVE
cd ~/django-apps/testsite/
cara Run web service nya
#
python manage.py runserver 192.168.100.6:1818
Referensi :
https://www.digitalocean.com/community/tutorials/how-to-install-django-and-set-up-a-development-environment-on-ubuntu-16-04
No comments:
Post a Comment