[ckan-dev] File system layout: best practice guide?

Sean Hammond sean.hammond at okfn.org
Mon Jun 9 10:53:43 UTC 2014


The standard layout is this:

/etc/ckan/default/production.ini <- Your CKAN config file

/etc/ckan/default/who.ini <- Your who.ini symlink

/usr/lib/ckan/default <- Your virtualenv, where CKAN, it's Python
   dependencies, and any CKAN extensions are all installed.

/usr/lib/ckan/default/src/ckan <- The CKAN source code

/usr/lib/ckan/default/src/ckanext-foo <- Where I would recommend that
    you git clone an extension ckanext-foo to.

It's perfectly easy to update an extension, you just do:

  . /usr/lib/ckan/default/bin/activate
  cd /usr/lib/ckan/default/src/ckanext-foo
  git pull
  python setup.py install
  sudo service apache2 restart

(Though check the READMEs of individual extensions for any additional
steps.)

There's a few more files and directories as well: FileStore directory,
Apache, modwsgi and nginx config and log files...

PluginNotFoundException sounds as if you do not have your CKAN
virtualenv activated when you're running `paster serve` (if you're
running CKAN with paster), or you didn't have the virtualenv activated
when you ran `pip install` or `python setup.py install` to install the
plugin.

As far as CKAN finding the plugin is concerned it doesn't actually matter
where the plugin is located in your filesystem, it just matters that you
activate your CKAN vitualenv then run the command to install the plugin.

Excerpts from John Brisbin's message of 2014-06-09 04:43:01 +0200:
> G'Day all,
> 
> The wonderful CKAN docs are far better than many I've encountered: kudos 
> and appreciations to those who have helped make it happen.
> 
> In terms of getting a production system layed out properly, could 
> someone point me toward advice on how to set up the installation files 
> so that updates are straightforward and installations of new 
> themes/plugins go smoothly?
> 
> My experience so far is in trying to get the spatial_search plugin 
> installed properly (ref: 
> http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html).
> 
> We seemed to get the extension installed, but when I've restarted the 
> service we get:
> 
> ----
> 
> ckan.plugins.core.PluginNotFoundException: spatial_metadata
> 
> ----
> 
> Looking into the file system, it's not clear to me where this plugin is 
> located, or where it *should be* located.
> 
> We have paths like this:
> 
> /usr/lib/ckan/default/src/ckan/src/ckanext-spatial/ckanext/spatial
> 
> I can't see how this will make it easy to update ckan when our 
> additional extensions are located under ckan/default/src/..
> 
> Is this normal practice?
> 
> Assuming it is, how would I go about trying to locate this missing 
> spatial_metadata plugin?
> 
> Do I manually delete some fork of the file system and start over with 
> the extension install?
> 
> Thanks in advance for advice...and patience while I grind away in the 
> foothills of this learning curve!
> 
> Kind regards,
> 
> JB
> 



More information about the ckan-dev mailing list