[ckan-dev] fi.thedatahub.org installation - some help needed
David Read
david.read at okfn.org
Mon Jan 16 10:59:38 UTC 2012
On 16 January 2012 08:35, Jaakko Louhio <jaakko.louhio at floapps.com> wrote:
>> On 13 January 2012 03:05, Henri Ahti <henri.ahti at gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> We are currently installing ckan to fi.thedatahub.org. We used package
>>> installation on ubuntu 10.04 server according to these instructions:
>>> http://readthedocs.org/docs/ckan/en/latest/install-from-package.html.
>>> However, there seems to be extra '?id=None' -parameter that is appended
>>> to
>>> some links, for example to 'Search' -link
>>> (http://fi.thedatahub.org/dataset?id=None), and that of course screws up
>>> the search (adds an extra unwanted search filter). There are several
>>> other
>>> places, even when creating a new package. So, it seems that there is
>>> extra
>>> get -parameter that is for whatever reason carried around. Do you have
>>> any
>>> idea what might cause this and how to fix it?
>>
>>
>> What causes this is Routes config (the url generation in Pylons). We
>> have seen this before. What is happening here is that Pylons can
>> operate in different modes and in the strict mode (which we are now
>> use) it won't default any parameters which can have the affect of this
>> ?id=None showing up. I have to say we thought this was completely
>> eliminated (e.g. it does not happen on thedatahub.org) so surprised
>> you are encountering it.
>>
>> How are you generating these links that get the id=None parameter? For
>> example we are generating search link (which goes to /dataset) on the
>> front page by doing:
>>
>> url_for(controller='package', action='index')
>
>
> We have default out of the box install from package repository on ubuntu
> 10.04 that gives us problems with links having extra ?id=None parameter.
> We don't have a custom theme for now. For example, each of the links at
> layout_base menu have this extra parameter and they are generated as such:
>
> <span py:if="h.check_access('package_create')">
> ${h.nav_link(c, _('Add a dataset'), controller='package', action='new')}
> </span>
> ${h.nav_link(c, _('Search'), controller='package', action='index'
> , highlight_actions = 'new index')}
> ${h.nav_link(c, _('Groups'), controller='group', action='index')}
> ${h.nav_link(c, _('About'), controller='home', action='about')}
Jaako,
To help, I've summarised the change we made to the Routes config here:
http://trac.ckan.org/ticket/1651
I can't reproduce your behaviour on our clean Ubuntu 10.04 install or
by playing around with the Routes version or Routes config.
Do check your Routes version is 1.11 though:
$ pip freeze | grep Routes
You could try changing map.explicit=False to see if that helps
(although there will likely be other URLs messed up). Otherwise, I
suggest you'll have to debug why Routes is acting differently, due to
our different environments.
David
>
> Also links to API contain ?id=None:
>
> <li>
> ${h.link_to(_('API'), h.url_for(controller='api', action='get_api'))}
> </li>
> <li>${h.link_to(_('API Docs'), 'http://wiki.ckan.net/API')}</li>
>
> as well as login and register links:
>
> <a href="${h.url_for(controller='user',action='login')}">Login</a>
> <a href="${h.url_for(controller='user',action='register')}">Register</a>
>
> Mostly that extra ?id=None parameter is harmless, I think, but when
> going through that search link, it uses that ?id=None as a search facet.
> That will of course screw up the search.
> Can this be fixed with Routes config or is the issue more complicated?
>
>
>>> Only thing that went 'wrong' in the installation was that we had to
>>> initialize database after installation scripts failed to do it.
>>
>>
>> Was that due to permissions?
>
>
> Probably, or because of newer version of postgres. Unfortunately I didn't
> copy the error message. But it was due to not being able to create database
> for reason or another. We had 9.x version of postgres installed when I
> tried the installation. After the db part of install failed, I installed
> postgres version 8.4, made user account for ckan by hand and created a db
> with owner being ckan. Then I ran init db script, and it worked.
>
>
>>
>>> Also, we need two extensions on our installation. Googleanalytics and
>>> disqus. Googleanalytics seems to work at least somewhat (writes to log
>>> after doing its things) after installing it like instructed in the
>>> tutorial
>>> (http://readthedocs.org/docs/ckan/en/latest/install-from-package.html)
>>> and
>>> in the extension readme. But, we can't seem to get disqus working. Ckan
>>> finds the extension, but it does seem to do nothing (does not write
>>> anything to log). We have disqus account 'datahubsuomi' for
>>> fi.thedatahub.org and ckan is configured to use extensions like so:
>>> ckan.plugins = disqus googleanalytics
>>> disqus.name = datahubsuomi
>>>
>>> Is there some further magic that is required or is there some compability
>>> issue with newer ckan version/package install version or something else
>>> that we should know?
>>
>>
>> Hmmm, I believe that some changes with the default v1.5 theme may have
>> caused some problems here. We'll take look asap (probably tomorrow)
>> and get back with more detail.
>>
>
> According to David, disqus is not compatible with v.1.5 default theme, so we
> will
> discuss what we will do with it (dump it or try to fix it).
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
More information about the ckan-dev
mailing list