django standard install..

Posted by nopsled
2015.10.13 10:57 프로그래밍

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 (=`ω´=)$ 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 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 migrate' to apply them.

October 13, 2015 - 00:25:50

Django version 1.8.5, using settings 'project.settings'

Starting development server at

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


    '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':'', # 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 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 syndb

nopsled@localhost:/var/www/SeoulMetro/db (=`ω´=)$ wget

# unzip it and use "python build;sudo python 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 startapp application

nopsled@localhost:/var/www/SeoulMetro (=`ω´=)$ ls

project/   db/           db.sqlite3*    application/


이 댓글을 비밀 댓글로