728x90
반응형

1. System Block Struct

2. Python3.6

[root@alpha ~]# yum install centos-release-scl
[root@alpha ~]# yum install tree
[root@alpha ~]# yum install rh-python36
[root@alpha ~]# python --version
Python 2.7.5
[root@alpha ~]# scl enable rh-python36 bash
[root@alpha ~]# python --version
Python 3.6.3
[root@alpha ~]#

3. Project 생성

[www@alpha ~]$ scl enable rh-python36 bash
[www@alpha ~]$ python3 -m venv --without-pip test4
[www@alpha ~]$ source test4/bin/activate
(test4) [www@calpha ~]$ curl https://bootstrap.pypa.io/get-pip.py | python

4. Django

(test4) [www@alpha ~]$ pip -V
pip 19.0.1 from /home/www/test4/lib64/python3.6/site-packages/pip (python 3.6)
(test4) [www@alpha ~]$ pip install django
(test4) [www@alpha ~]$ python -m django --version
2.1.5
(test4) [www@alpha ~]$ django-admin startproject mydjangoapp
(test4) [www@alpha ~]$ tree  mydjangoapp/
mydjangoapp/
├── manage.py
└── mydjangoapp
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py
 
1 directory, 5 files
(test4) [www@alpha ~]$ cd mydjangoapp/
(test4) [www@alpha mydjangoapp]$ ls
manage.py  mydjangoapp
(test4) [www@alpha mydjangoapp]$ python manage.py migrate
(test4) [www@alpha mydjangoapp]$ python manage.py createsuperuser
Username (leave blank to use 'www'): admin
Email address: #이메일주소
Password:
Password (again):
Superuser created successfully.
(test4) [www@alpha mydjangoapp]$
(test4) [www@alpha mydjangoapp]$ python manage.py runserver 0.0.0.0:8000
Performing system checks...
System check identified no issues (0 silenced).
January 25, 2019 - 06:11:49
Django version 2.1.5, using settings 'mydjangoapp.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.

5. auto vir connection

[www@alpha ~]$ vi .bashrc
# .bashrc
 
 
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
 
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
 
# User specific aliases and functions
 
source test4/bin/activate

6. move vir

(test4) [www@alpha hara]$ source color-bar/bin/activate
(color-bar) [www@alpha hara]$

7. out vir

(color-bar) [www@alpha hara]$ deactivate

 

728x90
300x250

'IT > Misc Tip' 카테고리의 다른 글

DNS Lookup이나 Global Ping체크 시  (0) 2021.08.19
svn충돌 해결방법 (conflict문제)  (0) 2021.08.12
Mac에서 ansible 수행시 발생된 에러  (0) 2021.08.03
DNS 캐시 클리어  (0) 2021.07.30
Python C Import 절차  (0) 2021.07.27

+ Recent posts