Commit 29c4c1ff8b2f713b30e459fe5c2a528d5bb48477

Authored by Jannis Leidel
2 parents d4b178e1 93e50af8

Merge pull request #6 from alasdairnicol/docs

Added basic instructions to the porting page
@@ -5,7 +5,7 @@ Comment form classes @@ -5,7 +5,7 @@ Comment form classes
5 .. module:: django_comments.forms 5 .. module:: django_comments.forms
6 :synopsis: Forms for dealing with the comment model. 6 :synopsis: Forms for dealing with the comment model.
7 7
8 -The ``django.contrib.comments.forms`` module contains a handful of forms 8 +The ``django_comments.forms`` module contains a handful of forms
9 you'll use when writing custom views dealing with comments, or when writing 9 you'll use when writing custom views dealing with comments, or when writing
10 :doc:`custom comment apps <custom>`. 10 :doc:`custom comment apps <custom>`.
11 11
@@ -2,4 +2,41 @@ @@ -2,4 +2,41 @@
2 Porting to ``django_comments`` from ``django.contrib.comments`` 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