Django/Beginner: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 44: Line 44:


==References==
==References==
* [[DigitalOcean Reverse Proxy]]
* [https://www.django-rest-framework.org/tutorial/quickstart/ Django Rest Framework]
* [https://www.django-rest-framework.org/tutorial/quickstart/ Django Rest Framework]
* [https://www.python.org/downloads/release/python-360/ Download Python 3.6.0]
* [https://www.python.org/downloads/release/python-360/ Download Python 3.6.0]

Revision as of 22:27, 29 January 2019

Configuration

sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv

Virtualization

sudo su
cd /opt/django/www
python3 -m venv myenv
source myenv/bin/activate

Installation

pip install django
django-admin startproject myrpi

Settings

# nano myrpi/settings.py
ALLOWED_HOSTS = [
    'localhost',
    '192.168.1.110',
    '192.168.1.111'
]

Run Server

python manage.py migrate
python manage.py makemigrations
python manage.py runserver 192.168.1.110:8000
deactivate

Start App

python manage.py startapp myapp
ls -la myapp

References