· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
ȯ ϱ


1

ڶ ȯ ſ ִ. ⼭ ȯ Eclipse + Django + MySQL Ȥ PgSQL. 11.04 Ÿ .

2 α׷ ġ

# apt-get install eclipse python-django

3 DB ġ

3.1.1 ġ

# apt-get install postgresql python-psycopg2 pgadmin3
ġ ϷǸ postgres ( ) йȣ Ѵ.
# sudo -u postgres psql postgres
postgres=# \password postgres

3.1.2 DB

$ sudo -u postgres createuser -D -A -P myuser
ÀÌ »õ ·Ñ¿¡°Ô ¶Ç ´Ù¸¥ ·ÑÀ» ¸¸µé ¼ö ÀÖ´Â ±ÇÇÑÀ» ÁÙ±î¿ä? (y/n) n

$ sudo -u postgres createdb -O myuser mydb

3.2.1 ġ

# apt-get install mysql-server python-mysqldb

3.2.2 DB

$ mysql -u root -p
> CREATE DATABASE mydb;
> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'some_passwd';
> GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost' WITH GRANT OPTION;
> QUIT;

4 Ŭ Ʈ

File - New - Project - Pydev Django Project ( django ġǾ ұϰ 'django not found' ޽ ½ ޴ Window - Preference - Interpreter - Python ٽ ߰)

c660ab95c3629a7324e8a433b38d76aa.png
Pydev Django Proejct

8dda77f8d559252b1f9c0bedf753b760.png
Ʈ Next, Next

6efa15a80dc8eebea3e3db299e4b1b3c.png
ռ (ϴ DB MySQL mysql, PostgreSQL postgresql_psycopg2 Ѵ.)

src/myproject/settings.py - TIME_ZONE = 'America/Chicago' 'Asia/Seoul' - LANGUAGE_CODE = 'en-us' 'ko-kr'

5 ġ ׽Ʈ


Ʈ ޴ - Django - Run Django Tests(manage.py test)

00c6355cba3a9924d2629239335ad2b0.png

Ȯ

Ʈ ޴ - Run As - Pydev: Django http://127.0.0.1:8001

e2da65282890d1381c03a8860f658332.png

6 ø̼ ߰


Ʈ ޴ - Django - Create application(manage.py startapp) - 'FirstApp'

7 Admin Ȱȭ

  1. urls.py ã ּ
from django.contrib import admin
admin.autodiscover()
...
    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
  1. settings.py INSTALLED_APPS ׸ ã 'django.contrib.admin' ּ
  2. Ʈ ޴ - Django - Sync DB(manage.py syncdb) ,
  3. http://127.0.0.1:8000/admin ׽Ʈ (/admin / ȭ Django .)


ID
Password
Join
The wise shepherd never trusts his flock to a smiling wolf.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-08-13 21:08:26
Processing time 0.0734 sec