일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- intelmac
- 거래사기
- XSS
- 변태는
- CryptoJS
- 보이스피싱 #대검찰청 #명의도용 #비밀번호 #계좌번호 #공공기관 #가짜검찰청
- react
- 안전결제
- 중고나라
- Malware Sample
- Frida
- Sequoia
- 허리디스크
- CJ대한통운 #쿠팡 #통관번호오류 #통관고유번호오류 #안주원팀장 #모건인베스트
- 로맨스스캠
- shell_gpt
- 척추관협착증
- MongoDB #NoSQL #CreateUser #DropUser #mongod #mognod.conf
- 네이버카페
- 취약점
- open redirect
- self-signed
- esbuild
- NUGU
- ssrf
- 채팅환전사기
- speed-measure-webpack-plugin
- 모의해킹
- 많다..
- ue4dumper
- Today
- Total
annyoung
django standard install.. 본문
I have to development about web project..
html and php is old.. so, i decided to use django!! django is so useful and quick and idk about web programming. but this is so good idea about using python
django division project and application. project's big notion, application's into project's small notion.
so we building about standard setting in django.
* [important] ah, django must installed!! *
1. we bulding about django project (big notion)
nopsled@localhost:/var/www (=`ω´=)$ django-admin.py startproject project
nopsled@localhost:/var/www (=`ω´=)$ ls
?/ project/ _________.php* index.php p2p_crawler.tar.gz phpmyadmin/ test@.php
nopsled@localhost:/var/www (=`ω´=)$
# we created project!!
2. confirm running django server.
nopsled@localhost:/var/www/project (=`ω´=)$ python manage.py runserver 8000
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
October 13, 2015 - 00:25:50
Django version 1.8.5, using settings 'project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[13/Oct/2015 00:26:08] "GET / HTTP/1.1" 200 1767
3. if you want using database with mysql, modify database in settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test', # if you custom database in mysql, modify path.
'USER': 'root', # set your mysql user
'PASSWORD': '???????', # set your mysql password
'HOST':'127.0.0.1', # if you want remote connect, modify it!
'PORT':'3306', # if you modified mysql default port, modify it too.
}
}
4. we use django migrate for database.
nopsled@localhost:/var/www/project (=`ω´=)$ python manage.py migrate
>> ERROR : django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
# but error with MySQLdb is not defined.. we have to use wget and install it.
# or another cause error, using python manage.py syndb
nopsled@localhost:/var/www/SeoulMetro/db (=`ω´=)$ wget https://github.com/farcepest/MySQLdb1/archive/master.zip
# unzip it and use "python setup.py build;sudo python setup.py install" in command line
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
# if you error in mac osx, using export path.
5. and create with django application (small notion)
nopsled@localhost:/var/www/project (=`ω´=)$ python manage.py startapp application
nopsled@localhost:/var/www/SeoulMetro (=`ω´=)$ ls
project/ db/ db.sqlite3 manage.py* application/
THE END.... T.T
'프로그래밍' 카테고리의 다른 글
python 윈도우 한글문제 (0) | 2016.04.26 |
---|---|
python unicode unescape (html unescape) (0) | 2015.11.07 |
Convert Facebook username to id (0) | 2015.04.12 |
[파밍 크롤러] pharming crawler (1) | 2015.01.28 |
악성코드 자동분석관리 시스템 with telegram-cli, pytg (0) | 2014.12.09 |