| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
- 변태는
- 네이버카페
- Malware Sample
- ssrf
- 채팅환전사기
- AWS
- react2shell
- XSS
- Frida
- jeb_mcp
- 허리디스크
- 척추관협착증
- ChatGPT
- aes
- EC2
- Sequoia
- 안전결제
- cve-2025-55182
- 모의해킹
- 중고나라
- mitmproxy
- shell_gpt
- ue4dumper
- 내부확산
- 많다..
- S3
- LFI
- intelmac
- 취약점
- 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 |