@@ -28,7 +28,7 @@ have a basic familiarity with MongoDB operation and have
28
28
29
29
.. note::
30
30
31
- `Django MongoDB Engine`_ uses the a forked version of Django 1.3
31
+ `Django MongoDB Engine`_ uses a forked version of Django 1.3
32
32
that adds non-relational support.
33
33
34
34
.. _Django: http://www.djangoproject.com
@@ -47,7 +47,7 @@ Prerequisite
47
47
This tutorial uses pip_ to install packages and virtualenv_ to isolate
48
48
Python environments. While these tools and this configuration are not
49
49
required as such, they ensure a standard environment and are strongly
50
- recommended. Issue the following command at the system prompt:
50
+ recommended. Issue the following commands at the system prompt:
51
51
52
52
.. code-block:: sh
53
53
@@ -59,7 +59,7 @@ Respectively, these commands: install the ``virtualenv`` program
59
59
project (named ``myproject``.)
60
60
61
61
To activate ``myproject`` environment at the system prompt, use the
62
- following command :
62
+ following commands :
63
63
64
64
.. code-block:: bash
65
65
@@ -133,7 +133,7 @@ The first step in writing a tumblelog in `Django`_ is to define the
133
133
"models" or in MongoDB's terminology :term:`documents <document>`.
134
134
135
135
In this application, you will define posts and comments, so that each
136
- :py:class:` Post` can contain a list of :py:class:` Comments`. Edit the
136
+ `` Post`` can contain a list of `` Comments` `. Edit the
137
137
:file:`tumblelog/models.py` file so it resembles the following:
138
138
139
139
.. code-block:: python
@@ -167,17 +167,17 @@ In this application, you will define posts and comments, so that each
167
167
author = models.CharField(verbose_name="Name", max_length=255)
168
168
169
169
170
- The Django "nonrel" code looks the same as vanilla Django however,
170
+ The Django "nonrel" code looks the same as vanilla Django, however
171
171
there is no built in support for some of MongoDB's native data types
172
- like Lists and Embedded data. :py:mod:`djangotoolbox` handles these
172
+ like Lists and Embedded data. :py:mod:`djangotoolbox:djangotoolbox ` handles these
173
173
definitions.
174
174
175
175
.. see:: The Django MongoDB Engine fields_ documentation for more.
176
176
177
- The models declare an index to :py:class:` Post`. One for the
178
- :py:obj:` created_at` date as our frontpage will order by date: there
179
- is no need to add :py:obj:` db_index` on :py:obj:` SlugField` because
180
- there is a default index on :py:obj:` SlugField`.
177
+ The models declare an index to the `` Post`` class . One for the
178
+ `` created_at` ` date as our frontpage will order by date: there
179
+ is no need to add `` db_index`` on `` SlugField` ` because
180
+ there is a default index on `` SlugField` `.
181
181
182
182
.. _fields: http://django-mongodb.org/reference/fields.html
183
183
@@ -268,7 +268,7 @@ and :file:`templates/tumblelog` for storing the tumblelog templates:
268
268
mkdir -p templates/tumblelog
269
269
270
270
Configure Django so it can find the templates by updating
271
- :py:obj:` TEMPLATE_DIRS` in the :file:`settings.py` file to the
271
+ `` TEMPLATE_DIRS` ` in the :file:`settings.py` file to the
272
272
following:
273
273
274
274
.. code-block:: python
@@ -441,7 +441,7 @@ the following to the :file:`views.py` file:
441
441
442
442
.. note::
443
443
444
- :py:class:` PostDetailView` extends the :py:class:` DetailView` so
444
+ The `` PostDetailView`` class extends the `` DetailView`` class so
445
445
that it can handle ``GET`` and ``POST`` requests. On ``POST``,
446
446
:py:func:`post` validates the comment: if valid, :py:func:`post`
447
447
appends the comment to the post.
@@ -511,19 +511,19 @@ can easily create an administrative interface for posts with
511
511
Django. Enable the admin by adding the following apps to
512
512
:py:obj:`INSTALLED_APPS` in :file:`settings.py`.
513
513
514
- - :py:mod:`django.contrib.admin`
515
- - :py:mod:`django_mongodb_engine `
516
- - :py:mod:`djangotoolbox`
514
+ - :py:mod:`django:django .contrib.admin`
515
+ - :py:mod:`djangomongodbengine `
516
+ - :py:mod:`djangotoolbox:djangotoolbox `
517
517
- :py:mod:`tumblelog`
518
518
519
519
.. warning::
520
520
521
521
This application does not require the :py:class:`Sites`
522
- framework. As a result, remove :py:mod:`django.contrib.sites` from
522
+ framework. As a result, remove :py:mod:`django:django .contrib.sites` from
523
523
:py:obj:`INSTALLED_APPS`. If you need it later please read
524
524
`SITE_ID issues`_ document.
525
525
526
- Create a :file:`admin.py` file and register the :py:class:` Post` model
526
+ Create a :file:`admin.py` file and register the `` Post` ` model
527
527
with the admin app:
528
528
529
529
.. code-block:: python
@@ -536,7 +536,7 @@ with the admin app:
536
536
.. note::
537
537
538
538
The above modifications deviate from the default django-nonrel_ and
539
- :py:mod:`djangotoolbox` mode of operation. Django's administration
539
+ :py:mod:`djangotoolbox:djangotoolbox ` mode of operation. Django's administration
540
540
module will not work unless you exclude the ``comments`` field. By
541
541
making the ``comments`` field non-editable in the "admin" model
542
542
definition, you will allow the administrative interface to function.
0 commit comments