You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.txt
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,14 @@ Quick start guide
19
19
To find the request overview page, please click on Requests inside the admin, then "Overview" on the top right, next to "add request".
20
20
21
21
Once you have installed ``django-request`` you can add it to a django project by following these steps;
22
-
23
-
#. Install the blog app by adding ``'request'`` to ``INSTALLED_APPS``.
24
-
25
-
#. Run ``manage.py migrate`` so that Django will create the database tables.
26
-
27
-
#. Add ``request.middleware.RequestMiddleware`` to ``MIDDLEWARE``. If you use ``django.contrib.auth.middleware.AuthenticationMiddleware``, place ``RequestMiddleware`` after it. If you use ``django.contrib.flatpages.middleware.FlatpageFallbackMiddleware`` place ``request.middleware.RequestMiddleware`` before it else flatpages will be marked as error pages in the admin panel.
28
-
29
-
#. Make sure that the domain name in django.contrib.sites admin is correct. This is used to calculate unique visitors and top referrers.
22
+
23
+
#. Install the blog app by adding ``'request'`` to ``INSTALLED_APPS``.
24
+
25
+
#. Run ``manage.py migrate`` so that Django will create the database tables.
26
+
27
+
#. Add ``request.middleware.RequestMiddleware`` to ``MIDDLEWARE``. If you use ``django.contrib.auth.middleware.AuthenticationMiddleware``, place ``RequestMiddleware`` after it. If you use ``django.contrib.flatpages.middleware.FlatpageFallbackMiddleware`` place ``request.middleware.RequestMiddleware`` before it else flatpages will be marked as error pages in the admin panel.
28
+
29
+
#. Make sure that the domain name in django.contrib.sites admin is correct. This is used to calculate unique visitors and top referrers.
In the last command you will need to change <PYTHONPATH> to a path in your PYTHONPATH, a path which Python has recognized to have python modules within.
37
+
In the last command you will need to change ``<PYTHONPATH>`` to a path in
38
+
your ``PYTHONPATH``, a path which Python has recognized to have python
39
+
modules within.
38
40
39
41
Using a package-management tool
40
42
===============================
@@ -53,7 +55,10 @@ pip is one of the more popular package-management systems for python. You can fi
53
55
easy_install
54
56
------------
55
57
56
-
Another option is to use easy_install, first you need to install easy_install. You can find documentation and how to install `easy_install here`_. Once you have easy_install up and running, just type:
58
+
Another option is to use ``easy_install``, first you need to install
59
+
``easy_install``. You can find documentation and how to install
60
+
`easy_install here`_. Once you have ``easy_install`` up and running, just
Copy file name to clipboardExpand all lines: docs/settings.txt
+44-36Lines changed: 44 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -9,56 +9,59 @@ Settings
9
9
10
10
Default: ``False``
11
11
12
-
If this is set to True, then ajax requests will be ignored and not added to the database. To determine if a request was ajax, we use HttpRequest.is_ajax(), see Django documentation for more information.
12
+
If this is set to ``True``, then ajax requests will not be recorded. To
13
+
determine if a request was ajax, we use ``HttpRequest.is_ajax()``, see
14
+
Django documentation for more information.
13
15
14
16
``REQUEST_IGNORE_IP``
15
17
=====================
16
18
17
19
Default: ``None``
18
20
19
-
Any requests from a IP Address in this list will be ignored.
21
+
Any requests from an IP address in this list will not be recorded.
20
22
21
23
``REQUEST_LOG_IP``
22
-
=====================
24
+
==================
23
25
24
26
Default: ``True``
25
27
26
-
If set to False, ip addresses are replaced with REQUEST_IP_DUMMY.
28
+
If set to ``False``, IP addresses are replaced with ``REQUEST_IP_DUMMY``.
27
29
28
30
``REQUEST_IP_DUMMY``
29
-
=====================
31
+
====================
30
32
31
33
Default: ``1.1.1.1``
32
34
33
-
Used dummy address, if REQUEST_LOG_IP is set to False.
35
+
Used dummy address, if ``REQUEST_LOG_IP`` is set to False.
34
36
35
37
``REQUEST_ANONYMOUS_IP``
36
38
========================
37
39
38
40
Default: ``False``
39
41
40
-
If set to True, last octet of the ip is set to 1.
42
+
If set to ``True``, last octet of the IP is set to 1.
41
43
42
44
``REQUEST_LOG_USER``
43
-
=====================
45
+
====================
44
46
45
47
Default: ``True``
46
48
47
-
If set to False, user are not logged (set to None).
49
+
If set to ``False``, user are not logged (set to ``None``).
48
50
49
51
``REQUEST_IGNORE_USERNAME``
50
52
===========================
51
53
52
54
Default: ``None``
53
55
54
-
Any requests from users in this list will be ignored.
56
+
Any requests from users in this list will not be recorded.
55
57
56
58
``REQUEST_IGNORE_PATHS``
57
-
===========================
59
+
========================
58
60
59
61
Default: ``None``
60
62
61
-
Any requests which match these paths will be ignored. This setting should be a tuple filled with regex paths.
63
+
Any requests which match these paths will not be recorded. This setting should
64
+
be a tuple filled with regex paths.
62
65
63
66
Example:
64
67
@@ -73,30 +76,31 @@ Example:
73
76
74
77
Default: ``None``
75
78
76
-
Any request with a user agent that matches any pattern in this list will be ignored.
79
+
Any request with a user agent that matches any pattern in this list will not be
80
+
recorded.
77
81
78
82
Example:
79
83
80
84
.. code-block:: python
81
85
82
86
REQUEST_IGNORE_USER_AGENTS = (
83
-
r'^$', # ignore requests with no user agent string set
87
+
r'^$', # don't record requests with no user agent string set.
84
88
r'Googlebot',
85
89
r'Baiduspider',
86
90
)
87
91
88
92
``REQUEST_TRAFFIC_MODULES``
89
-
=================================
93
+
===========================
90
94
91
-
Default:
95
+
Default:
92
96
93
97
.. code-block:: python
94
98
95
-
(
96
-
'request.traffic.UniqueVisitor',
97
-
'request.traffic.UniqueVisit',
98
-
'request.traffic.Hit',
99
-
)
99
+
(
100
+
'request.traffic.UniqueVisitor',
101
+
'request.traffic.UniqueVisit',
102
+
'request.traffic.Hit',
103
+
)
100
104
101
105
These are all the items in the traffic graph and table on the overview page. If you wish to remove or add a item you can override this setting and set what you want to see. There are also many more options you can add from the following list;
102
106
@@ -116,19 +120,19 @@ These are all the items in the traffic graph and table on the overview page. If
116
120
``REQUEST_PLUGINS``
117
121
===================
118
122
119
-
Default:
123
+
Default:
120
124
121
125
.. code-block:: python
122
126
123
-
(
124
-
'request.plugins.TrafficInformation',
125
-
'request.plugins.LatestRequests',
126
-
'request.plugins.TopPaths',
127
-
'request.plugins.TopErrorPaths',
128
-
'request.plugins.TopReferrers',
129
-
'request.plugins.TopSearchPhrases',
130
-
'request.plugins.TopBrowsers',
131
-
)
127
+
(
128
+
'request.plugins.TrafficInformation',
129
+
'request.plugins.LatestRequests',
130
+
'request.plugins.TopPaths',
131
+
'request.plugins.TopErrorPaths',
132
+
'request.plugins.TopReferrers',
133
+
'request.plugins.TopSearchPhrases',
134
+
'request.plugins.TopBrowsers',
135
+
)
132
136
133
137
These are all the plugins you can see on the overview page. If you wish to remove or add a plugin you can override this setting and set what you want to see. Here is a list of all the plugins and what they do;
134
138
@@ -139,7 +143,9 @@ These are all the plugins you can see on the overview page. If you wish to remov
139
143
- ``'request.plugins.TopReferrers'``: Shows a list of top referrals to your site.
140
144
- ``'request.plugins.TopSearchPhrases'``: Shows a list of all the search phrases used to find your site.
141
145
- ``'request.plugins.TopBrowsers'``: Shows a graph of the top browsers accessing your site.
142
-
- ``'request.plugins.ActiveUsers'``: Show a list of active users in the last 5 minutes. This may not be a good idea to use on a large website with lots of active users as it will generate a long list.
146
+
- ``'request.plugins.ActiveUsers'``: Shows a list of active users in the last
147
+
5 minutes. This may not be a good idea to use on a large website with lots of
This setting should only be set if you use SSL or do not use django.contrib.sites. This is the base url for detecting referral from within the same site.
150
156
151
157
``REQUEST_ONLY_ERRORS``
152
-
=====================================
158
+
=======================
153
159
154
160
Default: ``False``
155
161
156
-
If this is set to True, django-request will ONLY store error returning request/responses. This can be useful to use django-request purely as a error detection system.
162
+
If this is set to ``True``, ``django-request`` will ONLY store error returning
163
+
request/responses. This can be useful to use ``django-request`` purely as an
0 commit comments