Django/Beginner: Difference between revisions
Jump to navigation
Jump to search
Line 45: | Line 45: | ||
==References== | ==References== | ||
* [https://docs.python.org/3/distutils/packageindex.html The Python Package Index (PyPI)] | * [https://docs.python.org/3/distutils/packageindex.html The Python Package Index (PyPI)] | ||
* [https://docs.python.org/3.6/distutils/setupscript.html Python Writing the Setup Script] | |||
* [https://docs.python.org/3/distutils/sourcedist.html Creating a Source Distribution] | * [https://docs.python.org/3/distutils/sourcedist.html Creating a Source Distribution] | ||
* [[DigitalOcean Reverse Proxy]] | * [[DigitalOcean Reverse Proxy]] |
Revision as of 03:00, 30 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