Django:Site Scaffold : djsite

hdknr@LennyOne:~/django$ more ~/bin/tdb.sh
#!/bin/sh
echo "CREATE DATABASE $1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql -u root –password=$2
echo "GRANT ALL on $1.* to ‘$1’@’localhost’ identified by ‘$1’" | mysql -u root –password=$2
echo "show databases" | mysql -u root –password=$2 | grep $1

hdknr@LennyOne:~/django$ ~/bin/tdb.sh  djsite hdknr
djsite

hdknr@LennyOne:~/django$ django-admin startproject djsite

hdknr@LennyOne:~/django$ tree djsite/
djsite/
|– __init__.py
|– manage.py
|– settings.py
`– urls.py
0 directories, 4 files

hdknr@LennyOne:~/django$ cd djsite
hdknr@LennyOne:~/django/djsite$ vi settings.py

hdknr@LennyOne:~/django/djsite$ grep HDKNR settings.py
DATABASE_ENGINE = ‘mysql’           # HDKNR
DATABASE_NAME = ‘djsite’             # HDKNR
DATABASE_USER = ‘djsite’             # HDKNR
DATABASE_PASSWORD = ‘djsite’         # HDKNR
DATABASE_HOST = ”             # HDKNR
DATABASE_PORT = ”             # HDKNR
TIME_ZONE = ‘Asia/Tokyo’        # HDKNR
LANGUAGE_CODE = ‘ja-jp’         # HDKNR
    ‘templates’,                                #HDKNR

    ‘django.contrib.admin’,     #HDKNR

hdknr@LennyOne:~/django/djsite$ python manage.py syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log

You just installed Django’s auth system, which means you don’t have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use ‘hdknr’): hdknr
E-mail address: hdknr@hdknr.deb
Password:
Password (again):
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model

Installing index for admin.LogEntry model

hdknr@LennyOne:~/django/djsite$ vi urls.py

from django.contrib import admin                        # HDKNR
admin.autodiscover()                                    # HDKNR
    (r’^admin/(.*)’, admin.site.root),                  # HDKNR

hdknr@LennyOne:~/django/djsite$ !py
python manage.py runserver 0.0.0.0:9999
Validating models…
0 errors found
Django version 1.0.2 final, using settings ‘djsite.settings’
Development server is running at http://0.0.0.0:9999/
Quit the server with CONTROL-C.
[30/Jun/2009 14:36:34] "GET /admin/ HTTP/1.1" 200 1540

WS000000

1021-412663287921c10b

カテゴリー: 未分類 パーマリンク

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中