1- Usage
2- =====
1+ Quick Start
2+ ===========
33
44Install
55-------
@@ -16,10 +16,37 @@ Install from PyPI with ``pip``:
1616.. _crate.io : https://crate.io/packages/django-simple-history/
1717
1818
19- Quickstart
20- ----------
19+ Configure
20+ ---------
2121
22- Add ``simple_history `` to your ``INSTALLED_APPS ``.
22+ Settings
23+ ~~~~~~~~
24+
25+ Add ``simple_history `` to your ``INSTALLED_APPS ``
26+
27+ .. code-block :: python
28+
29+ INSTALLED_APPS = [
30+ # ...
31+ ' simple_history' ,
32+ ]
33+
34+ The historical models can track who made each change. To populate the
35+ history user automatically you can add middleware to your Django
36+ settings:
37+
38+ .. code-block :: python
39+
40+ MIDDLEWARE_CLASSES = [
41+ # ...
42+ ' simple_history.middleware.HistoryRequestMiddleware' ,
43+ ]
44+
45+ If you do not want to use the middleware, you can explicitly indicate
46+ the user making the change as documented in :ref: `recording_user `.
47+
48+ Models
49+ ~~~~~~
2350
2451To track history for a model, create an instance of
2552``simple_history.models.HistoricalRecords `` on the model.
@@ -46,20 +73,8 @@ Django tutorial:
4673 Now all changes to ``Poll `` and ``Choice `` model instances will be tracked in
4774the database.
4875
49- The historical models can also track who made each change. To populate
50- the history user automatically you can add middleware to your Django
51- settings:
52-
53- .. code-block :: python
54-
55- MIDDLEWARE_CLASSES = [
56- # ...
57- ' simple_history.middleware.HistoryRequestMiddleware' ,
58- ]
59-
60- If you do not want to use the middleware, you can explicitly indicate
61- the user making the change as indicated in the advanced usage
62- documentation.
76+ Existing Projects
77+ ~~~~~~~~~~~~~~~~~
6378
6479For existing projects, you can call the populate command to generate an
6580initial change for preexisting model instances:
@@ -153,4 +168,3 @@ records for all ``Choice`` instances can be queried by using the manager on the
153168 <simple_history.manager.HistoryManager object at 0x1cc4290>
154169 >>> Choice.history.all()
155170 [<HistoricalChoice: Choice object as of 2010-10-25 18:05:12.183340>, <HistoricalChoice: Choice object as of 2010-10-25 18:04:59.047351>]
156-
0 commit comments