¿ìºÐÅõ¿¡ Àå°í °³¹ß ȯ°æ ±¸ÃàÇϱâ
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.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 ¿¡¼ ÀÎÅÍÇÁ¸®ÅÍ Á¦°Å ÈÄ ´Ù½Ã Ãß°¡)
[PNG image (51.82 KB)] [PNG image (56.37 KB)] [PNG image (43.68 KB)] src/myproject/settings.py ÆÄÀÏÀ» ¿¾î
- TIME_ZONE = 'America/Chicago' À» 'Asia/Seoul' ·Î ¼öÁ¤
- LANGUAGE_CODE = 'en-us' ¸¦ 'ko-kr'·Î ¼öÁ¤
5. ¼³Ä¡ Å×½ºÆ® ¶ÇÁ·ÎÁ§Æ® ¹®¸Æ ¸Þ´º - Django - Run Django Tests(manage.py test) ½ÇÇà
[PNG image (165.01 KB)] ¹®Á¦ ¾ø´Â °ÍÀ» È®ÀÎ ÈÄ
ÇÁ·ÎÁ§Æ® ¹®¸Æ ¸Þ´º - Run As - Pydev: Django ½ÇÇà
ºê¶ó¿ìÀú¸¦ ¶ç¿î ÈÄ http://127.0.0.1:8001 Á¢¼Ó
[PNG image (66.1 KB)] 7. Admin È°¼ºÈ ¶
from django.contrib import admin
admin.autodiscover() ... # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)),
|
You are going to have a new love affair. |