# django-registration2
## Install
```bash
pip install django-registration2
```
## Setup
Add `registration` to `INSTALLED_APPS`:
```python
INSTALLED_APPS = (
'django.contrib.auth',
'registration',
)
```
Add `registration.urls` to your project's urls.py:
```python
urlpatterns = patterns('',
...
url(r'^', 'registration.urls')),
)
```
Run [South](http://south.readthedocs.org) migrations (if installed):
```python
python manage.py migrate registration
```
Otherwise run `syncdb`:
```python
python manage.py syncdb
```
## Settings
Registration is handled by a _backend_ which is a class composed of various
methods for performing each step in the registration process. In most cases
the default behavior is suitable, but for convenience a few settings are
available to customize a few common scenarios.
### REGISTRATION_OPEN
A boolean which determines whether users can register or not. Default is `True`
### REGISTRATION_MODERATION
A boolean which defines whether or not users will be moderated before
completing their registration. Default is `False`
### REGISTRATION_MODERATORS
A tuple of name/email pairs (like `ADMINS` or `MANAGERS`) whom will be notified
of newly registered users. Defaults to `MANAGERS`
### REGISTRATION_ACTIVATION_DAYS
An integer of the number of days an account activation link is valid. Users
receive one in their email after they sign up to verify their email address
is valid. Default is `0` (no time limit)
## Signals
A few signals are exposed to notify when various events occurs. All signals
provide the following arguments:
- `user` - The new user instance
- `request` - The request instance used during registration
- `backend` - The registration backend used for registration
### `user_registered`
Sent when a user registers.
### `user_verified`
Sent when a user verifies their email address using the verification link they
receive via email. This occurs only for registration that is moderated since
moderators will not receive notice of new registrations unless they verify
their email address.
### `user_activated`
Sent when a user verifies their account using the verification link they
receive via email. This applies to non-moderated registrants.
### `user_moderated`
Sent when a moderator has moderated a user's registration (pass or fail).
## Backends
Multiple backends are supported which may be necessary to handle different
registration methods for different kinds of users.
```python
REGISTRATION_BACKENDS = {
'default': 'registration.backends.default.Backend',
'other': 'myapp.backends.MyBackend',
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
django-registration2-0.9.3.tar.gz (50个子文件)
django-registration2-0.9.3
MANIFEST.in 103B
PKG-INFO 599B
django_registration2.egg-info
PKG-INFO 599B
requires.txt 11B
SOURCES.txt 2KB
top_level.txt 13B
dependency_links.txt 1B
registration
models.py 4KB
managers.py 2KB
utils.py 3KB
templates
registration
acceptance_email.txt 260B
registration_closed.html 103B
password_reset_confirm.html 973B
registration_moderate.html 1KB
moderator_email.txt 291B
password_reset_complete.html 145B
registration_subject.txt 12B
acceptance_subject.txt 30B
registration_moderate_list.html 833B
login.html 705B
registration_form.html 673B
registration_complete.html 156B
moderator_subject.txt 19B
registration_email.txt 505B
password_reset_form.html 399B
registration_verify.html 513B
password_reset_email.html 131B
password_reset_done.html 154B
management
commands
__init__.py 0B
cleanupregistration.py 577B
__init__.py 0B
__init__.py 580B
migrations
0002_auto__add_field_registrationprofile_verified.py 4KB
0004_migrate_activated_flag.py 5KB
0003_auto__add_field_registrationprofile_activated__add_field_registrationp.py 6KB
__init__.py 0B
0001_initial.py 4KB
auth_urls.py 692B
signals.py 470B
views.py 3KB
admin.py 2KB
backends
default.py 8KB
__init__.py 1KB
urls.py 1KB
forms.py 3KB
LICENSE 2KB
setup.cfg 59B
AUTHORS 1KB
setup.py 945B
README.md 3KB
共 50 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功