Commit 93e50af886b22bb8defaedb8c8b1e76bea4cf3f3
1 parent
b37a5596
Added basic instructions to porting docs
Showing
1 changed file
with
38 additions
and
1 deletions
| ... | ... | @@ -2,4 +2,41 @@ |
| 2 | 2 | Porting to ``django_comments`` from ``django.contrib.comments`` |
| 3 | 3 | =============================================================== |
| 4 | 4 | |
| 5 | -FIXME | |
| 5 | +To move from ``django.contrib.comments`` to ``django_comments``, | |
| 6 | +follow these steps: | |
| 7 | + | |
| 8 | +#. Install the comments app by running ``pip install django-contrib-comments``. | |
| 9 | + | |
| 10 | +#. In :setting:`INSTALLED_APPS`, replace ``'django.contrib.comments'`` | |
| 11 | + with ``'django_comments'``. | |
| 12 | + | |
| 13 | + .. code-block:: python | |
| 14 | + | |
| 15 | + INSTALLED_APPS = ( | |
| 16 | + ... | |
| 17 | + 'django_comments', | |
| 18 | + ... | |
| 19 | + ) | |
| 20 | + | |
| 21 | +#. In your project's ``urls.py``, replace the url include | |
| 22 | + ``django.contrib.comments.urls`` with ``'django_comments.urls'``: | |
| 23 | + | |
| 24 | + .. code-block:: python | |
| 25 | + | |
| 26 | + urlpatterns = patterns('', | |
| 27 | + ... | |
| 28 | + (r'^comments/', include('django_comments.urls')), | |
| 29 | + ... | |
| 30 | + ) | |
| 31 | + | |
| 32 | +#. If your project had :doc:`customized the comments framework | |
| 33 | + </custom>`, then update your imports to use the ``django_comments`` | |
| 34 | + module instead of ``django.contrib.comments``. For example: | |
| 35 | + | |
| 36 | + .. code-block:: python | |
| 37 | + | |
| 38 | + from django.contrib.comments.models import Comment # old | |
| 39 | + from django_comments.models import Comment # new | |
| 40 | + | |
| 41 | + from django.contrib.comments.forms import CommentForm # old | |
| 42 | + from django_comments.forms CommentForm # new | ... | ... |
Please
register
or
login
to post a comment