Django:Site Scaffold : djsite : Registration & User Login

Registartion

hdknr@LennyOne:~/django/djsite$ python manage.py startapp registration

hdknr@LennyOne:~/django/djsite$ cp -rf ../django-registration/registration .

hdknr@LennyOne:~/django/djsite$ tree registration/
registration/
|– __init__.py
|– admin.py
|– forms.py
|– locale
|   |– ar
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– bg
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– de
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– el
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– en
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– es
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– es_AR
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– fr
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– he
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– is
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– it
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– ja
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– nl
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– pl
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– pt_BR
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– ru
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– sr
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– sv
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   |– zh_CN
|   |   `– LC_MESSAGES
|   |       |– django.mo
|   |       `– django.po
|   `– zh_TW
|       `– LC_MESSAGES
|           |– django.mo
|           `– django.po
|– management
|   |– __init__.py
|   `– commands
|       |– __init__.py
|       `– cleanupregistration.py
|– models.py
|– signals.py
|– tests.py
|– urls.py
`– views.py

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

hdknr@LennyOne:~/django/djsite$ grep HDKNR settings.py
    ‘registration’,             # HDKNR  INSTALLED.APP
# registration                                  #HDKNR
ACCOUNT_ACTIVATION_DAYS = 2                     #HDKNR
EMAIL_HOST = ‘localhost’                        #HDKNR
DEFAULT_FROM_EMAIL = ‘hdknr@debian.deb’         #HDKNR
LOGIN_REDIRECT_URL = ‘/’                        #HDKNR

hdknr@LennyOne:~/django/djsite$ python manage.py syncdb
Creating table registration_registrationprofile

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

from django.views.generic.simple import direct_to_template      #HDKNR

urlpatterns = patterns(”,
     (r’^accounts/’, include(‘registration.urls’)),                             #HDKNR
     (r’^$’, direct_to_template,  { ‘template’: ‘index.html’ }, ‘index’),       #HDKNR

hdknr@LennyOne:~/django/djsite$ svn export http://code.hdknr.com/Python/registration/templates templates
A    templates
A    templates/registration
A    templates/registration/password_change_done.html
A    templates/registration/password_reset_complete.html
A    templates/registration/registration_form.html
A    templates/registration/activate.html
A    templates/registration/password_reset_confirm.html
A    templates/registration/activation_email_subject.txt
A    templates/registration/registration_complete.html
A    templates/registration/activation_email.txt
A    templates/registration/password_reset_form.html
A    templates/registration/login.html
A    templates/registration/logout.html
A    templates/registration/password_reset_done.html
A    templates/registration/password_change_form.html
A    templates/registration/password_reset_email.html
A    templates/base.html
リビジョン 97 をエクスポートしました。

hdknr@LennyOne:~/django/djsite$ vi templates/index.html

てきとうに

hdknr@LennyOne:~/django/djsite$ python manage.py runserver 0.0.0.0:9000
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:9000/
Quit the server with CONTROL-C.
[30/Jun/2009 15:09:20] "GET /admin/ HTTP/1.1" 200 3600
[30/Jun/2009 15:09:23] "GET /admin/sites/site/ HTTP/1.1" 200 2217
[30/Jun/2009 15:09:25] "GET /admin/sites/site/1/ HTTP/1.1" 200 2851
[30/Jun/2009 15:09:25] "GET /admin/jsi18n/ HTTP/1.1" 200 2173

WS000003

http://hdknr.deb:9000/accounts/register/ にアクセス。

WS000004

WS000005

LennyOne:/var/spool/exim4/input# mailq
3m  1.9K 1MLWZF-0001yB-JR <> *** frozen ***
          hdknr@debian.deb
LennyOne:/var/spool/exim4/input# grep activate 1MLWZF-0001yB-JR-D
http://hdknr.deb/accounts/activate/b13436e2be1321acb25c5fb6404ae51205e19ac5/

http://hdknr.deb:9000/accounts/activate/b13436e2be1321acb25c5fb6404ae51205e19ac5/ にアクセス。

WS000006

WS000007

WS000008

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

コメントを残す

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

WordPress.com ロゴ

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

Twitter 画像

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

Facebook の写真

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

Google+ フォト

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

%s と連携中