Skip to content

Installation procedure issue #4

Closed
timlinux opened this Issue Dec 11, 2010 · 3 comments

2 participants

@timlinux

I kept notes on where I had to do things not listed in your readme which I attach as a diff below.

I am still getting an unresolved error (see below) which I dont have a solution for yet and would appreciate any hints. Will write back if I figure it out myself.

Regards

Tim

========================= DIFF =========================

diff --git a/README.rst b/README.rst
index 2f08222..7699378 100644
--- a/README.rst
+++ b/README.rst
@@ -49,7 +49,7 @@ from somewhere on your Python path::
 
 Then add ``cab`` to the ``INSTALLED_APPS`` setting of your Django
 project, run ``manage.py syncdb``, and either put a call to
-``include('cab.urls')`` somewhere inn your root URLConf or copy over
+``include('cab.urls.snippets')`` somewhere inn your root URLConf or copy over
 the URL patterns from Cab that you want to use.
 
 Note that the ``get_absolute_url`` methods of the ``Language``,
@@ -65,6 +65,20 @@ them with Django's ``ABSOLUTE_URL_OVERRIDES`` setting.
 .. _django-haystack: http://github.com/toastdriven/django-haystack/
 .. _django-amazon-resources: http://github.com/coleifer/django-amazon-resources/
 
+For search support you need to set up a search engine and configure haystack:
+
+``HAYSTACK_SITECONF = 'search_sites'``
+``HAYSTACK_SEARCH_ENGINE = 'whoosh'``
+``# Place where search indexes are stored for snippets - should be non web accessible``
+``HAYSTACK_WHOOSH_PATH = '/some-path/search-index'``
+
+And you should add a file called ``search_sites.py`` to your project with the 
+following lines:
+
+``import haystack``
+``haystack.autodiscover()``
+
+
 
 Templates
 =========

================== UNRESOLVED ERROR ===================

TemplateSyntaxError at /snippets/2/

'ratings_tags' is not a valid tag library: Template library ratings_tags not found, tried django.templatetags.ratings_tags,django.contrib.admin.templatetags.ratings_tags,django_sorting.templatetags.ratings_tags,pagination.templatetags.ratings_tags,django.contrib.humanize.templatetags.ratings_tags,django.contrib.comments.templatetags.ratings_tags,django.contrib.markup.templatetags.ratings_tags,cab.templatetags.ratings_tags

Request Method:     GET
Request URL:    http://qgis-django.localhost/snippets/2/
Django Version:     1.2.3
Exception Type:     TemplateSyntaxError
Exception Value:    

'ratings_tags' is not a valid tag library: Template library ratings_tags not found, tried django.templatetags.ratings_tags,django.contrib.admin.templatetags.ratings_tags,django_sorting.templatetags.ratings_tags,pagination.templatetags.ratings_tags,django.contrib.humanize.templatetags.ratings_tags,django.contrib.comments.templatetags.ratings_tags,django.contrib.markup.templatetags.ratings_tags,cab.templatetags.ratings_tags

Exception Location:     /home/web/qgis-django/python/lib/python2.6/site-packages/django/template/defaulttags.py in load, line 928
Python Executable:  /usr/bin/python
Python Version:     2.6.6
Python Path:    ['/home/web/qgis-django/python/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg', '/home/web/qgis-django/python/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg', '/home/web/qgis-django/python/lib/python2.6/site-packages/django_amazon_resources-0.1.0-py2.6.egg', '/home/web/qgis-django/python/lib/python2.6/site-packages/cab-0.2.0-py2.6.egg', '/home/web/qgis-django/python/lib/python2.6/site-packages', '/home/web/qgis-django/python/lib/python2.6/site-packages/PIL', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/home/web/qgis-django', '/home/web/qgis-django/qgis']
Server time:    Sat, 11 Dec 2010 06:39:09 -0600
@timlinux

Ok I resolved the remaining issues. Update patch below that adds notes that ratings and taggit should be listed in INSTALLED_APPS.

Regards

Tim

================= DIFF =======================

diff --git a/README.rst b/README.rst
index 2f08222..df7df00 100644
--- a/README.rst
+++ b/README.rst
@@ -47,9 +47,9 @@ from somewhere on your Python path::
 
     git clone git://github.com/coleifer/djangosnippets.org.git 
 
-Then add ``cab`` to the ``INSTALLED_APPS`` setting of your Django
-project, run ``manage.py syncdb``, and either put a call to
-``include('cab.urls')`` somewhere inn your root URLConf or copy over
+Then add ``ratings``, ``taggit`` and ``cab`` to the ``INSTALLED_APPS`` setting
+of your Django project, run ``manage.py syncdb``, and either put a call to
+``include('cab.urls.snippets')`` somewhere inn your root URLConf or copy over
 the URL patterns from Cab that you want to use.
 
 Note that the ``get_absolute_url`` methods of the ``Language``,
@@ -65,6 +65,20 @@ them with Django's ``ABSOLUTE_URL_OVERRIDES`` setting.
 .. _django-haystack: http://github.com/toastdriven/django-haystack/
 .. _django-amazon-resources: http://github.com/coleifer/django-amazon-resources/
 
+For search support you need to set up a search engine and configure haystack:
+
+``HAYSTACK_SITECONF = 'search_sites'``
+``HAYSTACK_SEARCH_ENGINE = 'whoosh'``
+``# Place where search indexes are stored for snippets - should be non web accessible``
+``HAYSTACK_WHOOSH_PATH = '/some-path/search-index'``
+
+And you should add a file called ``search_sites.py`` to your project with the 
+following lines:
+
+``import haystack``
+``haystack.autodiscover()``
+
+
 
 Templates
 =========
@coleifer

Applied. Thank you so much for catching this and taking the trouble to submit a diff!

@timlinux

Sorry to give thise feedback in drips and drabs - the urls py needed something like this for me:

   # snippets app
   (r'^snippets/', include('cab.urls.snippets')),
   (r'^tags/', include('cab.urls.tags')),
   (r'^bookmarks/', include('cab.urls.bookmarks')),
   (r'^languages/', include('cab.urls.languages')),
   (r'^popular/', include('cab.urls.popular')),

I think there is still one more problem with search because urls like this are failing:

http://qgis-django.localhost/search/?q=Good

I'll post a hopefully final comment if I figure that one out.

Tim

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.