Python / Django basic setup for Centos 7
|
February 25, 2017
|
Development,
Python,
Django
Python and Django initial setup
Centos 7 Python Django
sudo yum -y update sudo reboot sudo yum -y install python-pip sudo yum -y install virtualenv mkdir <projects> cd <projects> virtual env source env/bin/activate pip install django==1.8.17
Creating a Sample Project
django-admin startproject <projectname> cd <projectname>
Migrate Project
do this right after the django-admin processpython manage.py migrate
Create superuser
Create superuser for admin sitepython manage.py createsuperuserYou will be prompted for a username, email address and password
Starting Django dev server
Start the server. Make sure you allow the port through the firewallpython manage.py runserver 0.0.0.0:8000This sets up the web site on all ips for that host on port 8000\\ Admin site is http://sitename:8000/admin \\
Create an app
python manage.py startapp [app_label]Now you can Create Home Page for Django App
Django admin site
http://<serveripaddress>:8000/admin
