Django/Beginner

From Chorke Wiki
Revision as of 00:48, 29 January 2019 by Shahed (talk | contribs) (Created page with "==Configuration== <source lang="bash"> sudo -H pip3 install --upgrade pip sudo -H pip3 install virtualenv </source> ==Virtualization== <source lang="bash"> sudo su cd /opt/dj...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

References