<div dir="ltr">OK, for posterity I thought I'd report back on my experience integrating Geonode version 2.4.dev20160701231044 and django-cms v3.3. It seems to be working well for me, although still early days and I have no test suite so I'm expecting a few bugs yet. <div><br></div><div>Given that this touches Apache, urls, dependencies outside of pip, and the base templates, I don't really have an understanding about how to turn it into a contrib app. But hopefully this will help the discussion if other wise folk end up going down a similar path. </div><div><br><div><br></div><div>1. Firstly, you really need an automated build environment for this. Python virtualenv won't save you from dependency hell, as many of the dependencies for each are system-wide libraries. I'm using a system-wide install, using a fresh instance each time. It will depend on how you customise DjangoCMS. Here's what worked for me:</div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">#DjangoCMS dependencies<br>sudo apt-get install python-dev python-setuptools python-pip -y<br>sudo apt-get install -y libqd-dev libpq-dev<br>sudo apt-get install -y libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk<br><br>#Geonode dependencies<br>sudo apt-get install -y python-virtualenv build-essential openssh-server apache2 gcc gdal-bin gettext git-core libapache2-mod-wsgi \<br>    libgeos-dev libjpeg-dev libpng-dev libpq-dev libproj-dev libxml2-dev libxslt-dev openjdk-7-jre patch postgresql postgis postgresql-9.3-postgis-scripts \<br>    postgresql-contrib python python-dev python-gdal python-pycurl python-imaging python-pastescript python-psycopg2 python-support python-urlgrabber \<br>    python-virtualenv tomcat7 unzip zip</pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><br></pre></div><div>The good old PIL/pillow challenges came up again during this process, but the above works for me to resolve that.</div><div><br></div><div>2. I installed geonode generally in accordance with this <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html" target="_blank">http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html</a></div><div>And DjangoCMS generally in accordance with this <a href="http://docs.django-cms.org/en/release-3.3.x/how_to/install.html" target="_blank">http://docs.django-cms.org/en/release-3.3.x/how_to/install.html</a> Note to get fuller functionality of DjangoCMS you might want to set up a separate install using <a href="https://github.com/nephila/djangocms-installer" target="_blank">django-cms-installer</a> and then replicate INSTALLED_APPS and dependencies into your project. The vanilla CMS installed by hand is very vanilla. </div><div><br></div><div>3. The ordering of INSTALLED_APPS is very important and takes some time and rebuilds to get right. I found it very useful to have a standalone postgres database (not using the one that geonode spins up on localhost), to save me migrating models every time I tried a new build. </div><div><br></div>Here's what works for me:<br><br><a href="https://gist.github.com/davekennewell/d4f99670396707f9ec9ec2c9636ddc08" target="_blank">https://gist.github.com/davekennewell/d4f99670396707f9ec9ec2c9636ddc08</a><div><br></div><div>4. Regarding Internationalisation, in ~/<span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">geonode/geonode/urls.py </span>I simply overrode the </div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">from </span>django.conf.urls <span style="color:rgb(0,0,128);font-weight:bold">import </span>include, patterns, url</pre></div><div><span style="font-family:"Courier New";font-size:9pt;color:rgb(0,0,128);font-weight:bold">from </span><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">django.conf.urls.i18n </span><span style="font-family:"Courier New";font-size:9pt;color:rgb(0,0,128);font-weight:bold">import </span><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">i18n_patterns </span><span style="font-family:"Courier New";font-size:9pt;color:rgb(0,0,128);font-weight:bold">as </span><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">patterns</span><br><br></div><div>This means that all your geonode webpages will now look like this: <font face="monospace, monospace"><a href="http://myawesomesite.com/en/layers" target="_blank">http://myawesomesite.com/en/layers</a></font> or <a href="http://myawesomesite.com/hi/layers" target="_blank"><font face="monospace, monospace">http://myawesomesite.com/hi/layers</font></a> which in my case is fine because we may need the internationalisation later anyway. But having that extra language code might be a pain for others. </div><div><br></div><div>But importantly now the CMS urls can simply add on as an include at the end of geonode's urlpatterns:</div><div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">url(<span style="color:rgb(0,128,0);font-weight:bold">r'^'</span>, include(<span style="color:rgb(0,128,0);font-weight:bold">'cms.urls'</span>)),</pre><br>5. DjangoCMS uses django-filer & easythumbnails to allow upload & storage of images. It needs to store these in a manner similar to geonode's ~<span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">/geonode/geonode/uploaded/thumbs </span>directory. So you'll need to create </div><div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">~/geonode/geonode/uploaded/filer_public<br>~/geonode/geonode/uploaded/filer_public_thumbnails/filer_public</pre>and set the permissions and apache configuration similar to the thumbs directory. </div><div><br></div><div>6. The real design work to make any of this useful is in merging the templates and template tags. There's a bunch of choices here that are specific for each usecase. I'd really recommend understanding how these work in vanilla DjangoCMS before trying to merge them into your geonode project. It's nothing super difficult, but there are many moving parts and I've had to learn a lot here by using CMS independently, before I would even know where to start. </div><div><br></div><div>OK, that's about it for now. If anyone is headed down this path, I'd be happy to compare notes & thanks again Jesus for you work - it helped me a lot. </div><div><br></div><div>cheers</div><div><br></div><div>Dave</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">       </span><br></div><div dir="ltr">David Kennewell<div>Water Resources Engineer</div><div><a href="http://Hydrata.com" target="_blank">Hydrata.com</a><span></span><span></span></div><div>+971 55 409 7378</div><div><a href="mailto:david.kennewell@hydrata.com" target="_blank">david.kennewell@hydrata.com</a>   </div><div><span style="font-size:12.8000001907349px">                               </span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Jun 29, 2016 at 11:57 AM, David Kennewell <span dir="ltr"><<a href="mailto:david.kennewell@hydrata.com" target="_blank">david.kennewell@hydrata.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">That's some great work Jesús, thanks. It's always reassuring knowing that a task is possible before you set out! Let me know when you've got a blog post up - I'd be interested to see how it looks & understand the user experience a bit more. </span><br style="font-size:12.8px"><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">It looks like I'm going to go ahead with the integration for my site - I'll pay attention to the challenges you've highlighted there, and let you know how I get on with them.</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">I also note you're using </span><span style="color:rgb(51,51,51);font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">django-cms==3.1.5.</span>It's the latest CMS version (3.3) that has dropped support for django 1.6 & 1.7. I'll test out both options and figure out a way forward. My preference will be to use geonode master & djangocms3.3, to avail future upgrades, but we'll see if it works. It will be useful having your code to track the differences. </div><div class="gmail_extra"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8000001907349px">       </span><br></div><div dir="ltr">Dave<br><div><span style="font-size:12.8000001907349px">                               </span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div><div>
<br><div class="gmail_quote">On Sun, Jun 26, 2016 at 10:11 PM, Jesús <span dir="ltr"><<a href="mailto:gesusjl@gmail.com" target="_blank">gesusjl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all, <br><br>I have succesfully integrated django-cms and geonode for a project currently available at  <a href="http://darwinfoundation.org/geoportal" target="_blank">darwinfoundation.org/geoportal</a> or <a href="http://geoportal.darwinfoundation.org" target="_blank">geoportal.darwinfoundation.org</a> . Hope we can start uploading data and blog posts soon.  We have an internal geonode with layers, maps, and posts as part of the workflow.<br><br>There's plenty of space for further development but i needed to stop at some point to cover other tasks. <br><br>Current version of django-cms use django 1.6 and has been installed manually. I have integrated djangocms-blog for multilingual post and a wiki system also.<br><br>I didn't touch the models nor views so we can benefit from geonode project development . I have not developed geonode django-cms plugins but should be easy enough to integrated them on geonode.<br><br>For already published maps i use iframes to embed them on posts. The workflow is quite simple. Users publish maps and editors can use those maps among other resources to publish stories.<br><br>I found no problem related with the auth system so far. Admins can use the group app to give permissions to advance users.<br><br>The code needs  cleaning and would benefit from refactoring  but you can take a look at <a href="https://github.com/jesusjl/cdfgeonode/tree/2.4.x-geonode-1.0.0" target="_blank">https://github.com/jesusjl/cdfgeonode/tree/2.4.x-geonode-1.0.0</a>. <br><br>It's just a geonode template with customizations. <br><br><br>Some challenges i found on the path...<br><br>Internationalization: I had problems with the way geonode and django-cms manage internationalization. As far as i know django-cms use parler... So with some hacks i was able to use both ways to handle this topic. I had a lot of problems by the way geonode handle layers and maps urls, mostly 404 errors. <br><br>Javascript: i had some javascript error difficult to debug when allowing geonode pages be controlled by django-cms, but i was able to use placeholders at the homepage. Care should be taken anyway.<br><br>Url: I was expecting to use django i18n patterns to handle geonode urls as part of django-cms but it became really cumbersome. So i just import geonode url and include django-cms urls at the end. See internalization for the purpose on it.<br><br>Probably someone with more django experience could surpass all this difficulties. Im sure that integrating django-cms on geonode would leverage the project to a new level and probably it is worth the investment. <br><br>Hope i can help within my means and would love to hear more on this topic.<br><br>Jesus </div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-06-23 1:53 GMT-06:00 David Kennewell <span dir="ltr"><<a href="mailto:david.kennewell@hydrata.com" target="_blank">david.kennewell@hydrata.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi there Geonode users, <div><br></div><div>I wanted to share a few developments we've made with Geonode and DjangoCMS, and learn if there are others in the community headed in this direction. </div><div><br></div><div>For those not familiar with <a href="http://django-cms.org" target="_blank">django-cms</a> it's a tool that allows users to edit and publish content directly to a website through their browser. No coding or web developer required. A typical usecase would be a reporting publishing an article to her newspaper website. </div><div><br></div><div>I've been working with an NGO in Chennai,India to improve the accessibility of their work around flood management, and have found the CMS a really useful tool to merge reports and Geonode spatial data together in a way that readers can engage with. Here's an example:</div><div><a href="http://chennaifloodmanagement.org/en/projects/cag-flood-inundation-mapping/" target="_blank">http://chennaifloodmanagement.org/en/projects/cag-flood-inundation-mapping/</a></div><div><br></div><div>To achieve this outcome, there's basically two steps. I'd be interested in collaborating with anyone who would like to get involved in either of these. </div><div><br></div><div><b>1. Integrating Geonode with DjangoCMS</b><br clear="all"><div><div data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-size:12.8px">Current status: </span></div><div><span style="font-size:12.8px">I've bolted these two together with sticky tape and paper glue to demonstrate what might be possible on the Chennai project :) Currently I'm running two separate servers & databases, with hardcoded links in each project to make it look like it's all talking to each other. Apart from the dev headache, major drawback here is that users need two django accounts, one for editing reports in CMS and another for geonode. Yuk. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Desired status:</span></div><div><span style="font-size:12.8px">Integrate DjangoCMS as an app under geonode. Now that geonode is running on Django 1.8 this is should be possible. If I do go down this path (we still need some decent traction here to justify it) I'd really appreciate some guidance on how to do this in a manner that allows both easy integration for other projects, but acknowledges that this isn't the core use-case for geonode, so should be an optional extra (in my opinion). </span></div><div><span style="font-size:12.8px"><b><br></b></span></div><div><span style="font-size:12.8px"><b>2. Authoring geonode maps within DjangoCMS content editor. </b></span></div><div><span style="font-size:12.8px">Once you're geonode/CMS webapp is up and running, your users still need to be able to publish geonode maps from the CMS editor. I've written a plugin to enable this. Once again, it's bare-bones, but it works and we find it useful. I've pushed the code to github here: <a href="https://github.com/Hydrata/geonode_cms_map" target="_blank">https://github.com/Hydrata/geonode_cms_map</a></span></div><div><span style="font-size:12.8px">I'd be happy to write an install doc for this, but that's probably not useful until I resolve the above integration issues. Until then it's a manual deploy - feel free to reach out if you would like guidance and we can work through together - I'm sure I'd learn something from this too. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">That's it from me for now, I'd love to hear any similar stories or use-cases that might help guide this development in a way that's useful for all.  </span></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">thanks</span></div><span><font color="#888888"><div dir="ltr"><span style="font-size:12.8px">       </span><br></div><div dir="ltr">David Kennewell<div>Water Resources Engineer</div><div><a href="http://Hydrata.com" target="_blank">Hydrata.com</a><span></span><span></span></div><div><a href="tel:%2B971%2055%20409%207378" value="+971554097378" target="_blank">+971 55 409 7378</a></div><div><a href="mailto:david.kennewell@hydrata.com" target="_blank">david.kennewell@hydrata.com</a></div><div><a href="https://ae.linkedin.com/in/davekennewell" target="_blank">https://ae.linkedin.com/in/davekennewell</a>   </div><div><span style="font-size:12.8px">                               </span></div></div></font></span></div></div></div></div></div></div></div></div>
</div></div>
<br></div></div><span>_______________________________________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/geonode-users</a><br>
<br></span></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div data-smartmail="gmail_signature">Jesús </div>
</font></span></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>