django install on ubuntu
ubuntu djanggo 설치
djanggo 설치
apt-get install python-django
1 |
apt-get install python-django |
버전확인
django-admin –version
1 |
django-admin --version |
pip Install
apt-get install python-pip
1 |
apt-get install python-pip |
virtualenv install
pip install virtualenv
1 2 3 4 5 6 |
pip install virtualenv Downloading/unpacking virtualenv Downloading virtualenv-15.0.1-py2.py3-none-any.whl (1.8MB): 1.8MB downloaded Installing collected packages: virtualenv Successfully installed virtualenv Cleaning up... |
프로젝트 폴더생성
1 2 |
mkdir ~/project cd ~/project |
프로젝트 생성
django-admin startproject sampleproject
1 2 |
django-admin startproject sampleproject cd sampleproject |
DB 생성
python manage.py migrate
1 2 3 4 5 6 7 8 |
python manage.py migrate Operations to perform: Apply all migrations: admin, contenttypes, auth, sessions Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying sessions.0001_initial... OK |
슈퍼유저 생성
python manage.py createsuperuser
1 2 3 4 5 6 |
python manage.py createsuperuser Username (leave blank to use 'admin'): admin Email address: admin@local.lc Password: Password (again): Superuser created successfully. |
서버기동
python manage.py runserver 0.0.0.0:8000
1 2 3 4 5 6 7 8 |
python manage.py runserver 0.0.0.0:8000 Performing system checks... System check identified no issues (0 silenced). March 18, 2016 - 07:28:02 Django version 1.7.6, using settings 'sampleproject.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. |
관리자 URL (username , passowrd 는 createsuper생성에서 생성한 username,password)
http://localhost:8000/admin