-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
73 lines (47 loc) · 2.05 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Requires Django 1.1+
0) Django admin urls must be imported the "1.1" way:
...
(r'^admin/', include(admin.site.urls)),
...
1) Add authlog to installed apps in settings.py
INSTALLED_APPS = (
...
'authlog',
...
)
2) Add authlog to near beginning of middlware in settings.py
MIDDLEWARE_CLASSES = (
'authlog.logadminmiddleware.LogAdminMiddleware',
....
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
3) Configure AUTHLOG in settings.py. Sane defaults exist.
AUTHLOG_SAVE_GOOD_LOGINS = True or False (default True)
Specify whether to log good logins
AUTHLOG_SAVE_BAD_LOGINS = True or False (default False)
Specify whether to log bad logins (login attempts)
AUTHLOG_TRACKED_MODELS = (default is ['authlog.Access','authlog.AccessPage'] )
Specify which models and apps to log views of. Must be a list of 'app.model' names
AUTHLOG_SAVE_LOGIN_POST_DATA = True or False (default True)
Specify whether to save http POST data for logins to the db
AUTHLOG_SAVE_VIEW_POST_DATA = True or False (default True)
Specify whether to save http POST data for page views to the db
# NOTE: These settings offer a simple interface to start logging.
# Alternatively, using Django 1.3, you can simple define a logger
# called authlog.watch_login within settings.py and it will
# start logging to your custom logger.
AUTHLOG_LOG_TO_FILE = True or False (default False)
Specify whether to log to a file via python logging
AUTHLOG_LOGDIR = path to log dir (default none - current dir)
If LOG_TO_FILE set, specify what dir the file should log to
AUTHLOG_FILENAME = log file name (default authlog.log)
If LOG_TO_FILE set, specify the log file name
4) ./manage.py syncdb
MANAGEMENT COMMANDS
These two commands dump the Access and AccessPage tables stdout as CSV
manage.py authlog_dumpview
manage.py authlog_dumplogin