Kecko.comhttp://kecko.com/feeds/atom/2011-04-05T13:41:44+00:00Say *what* again, I dare ya, I double-dare ya!Zinnia, My Django Blog2011-04-05T13:41:44+00:00scoopseven/author/scoopseven/http://kecko.com/zinnia-my-django-blog/<p>UPDATE: 4/7/11 !!! IMPORTANT !!! Read the comments between Julien and I below before installing or deciding to install Zinnia.  It's far easier than I lay out in this post.  I'm leaving here for reference of what not to do :) --Mark</p><p>After writing so much lately about Django and Python I felt silly doing so on a hosted WordPress blog.  So for no good reason, I started investigating Django blogging engines. I decided to go with Zinnia.  It's an app, which means I can include it in other projects I have already started or going.  The documentation is fairly complete (or seemed to be) and it's still supported / in development. The main missing ingredient is multi-blog support, which is possibly in the works.</p><p>If you've decided on using a Django blog and Zinnia is your choice, I'll let you in on a couple secrets that may save you some time during installation and conversion from WordPress, if that's where you're coming from.  </p><p>There are <a href="http://django-blog-zinnia.com/documentation/install/#getting-the-code">three ways to install Zinnia</a>, all which will load all of the dependencies for you.  When I did this on my Apple Macbook (for development/testing purposes) I ran the pip install, copied the Zinnia project code from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django_blog_zinnia-0.8-py2.6.egg/zinnia (where it installed), placed that code in my project and p<a href="http://django-blog-zinnia.com/documentation/install/#applications">ut the proper lines in my settings.py</a> file. All of that was pretty seamless. When I updated templates (to change the look) I saw the changes immediately on my local python runserver. </p><p>I repeated this process on my production Arch Linux machine, the application acted differently.  When I updated my live server with the updated templates, I didn't see any of the design changes.  Restarted apache, still nothing. So I ran the zinnia pip install again, restarted apache and whaddyaknow, there were my changes.  On the production machine, it seems like Django/Python ignores the "zinnia" installed app in settings.py and runs the code/templates from the site-packages/django_blog_zinnia-0.8-py2.6.egg/zinnia folder. Since I didn't want to have code in there and have my project live in two places, I deleted the site-packages/django_blog_zinnia-0.8-py2.6.egg/zinnia folder and make a symbolic link to the zinnia folder in my project. </p><code><p>ln -s /path/to/your/project /usr/lib/python2.6/site-packages/django_blog_zinnia-0.8-py2.6.egg/zinnia</p></code><p>Now my project lives in one place and Zinnia works as it should. Yay!</p><p>Another thing that impressed me about Zinnia is that it includes <a href="http://django-blog-zinnia.com/documentation/wordpress_2_zinnia/">tools for converting to and from WordPress</a>. When I exported my WordPress xml file, ran the script and started getting errors:</p><code><p>xml.parsers.expat.ExpatError: unbound prefix</p></code><p>I was starting to think I'd made the wrong decision going with Zinnia. This time though, the problem was on Python/WordPress. WordPress exports with this xmlns information in the rss tag:</p><code><p><rss version="2.0"<br />xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"<br />xmlns:content="http://purl.org/rss/1.0/modules/content/"<br />xmlns:wfw="http://wellformedweb.org/CommentAPI/"<br />xmlns:dc="http://purl.org/dc/elements/1.1/"<br />xmlns:wp="http://wordpress.org/export/1.0/">  </p></code><p>If you add this line:</p><code><p>xmlns:atom="http://www.w3.org/2005/Atom"</p></code><p>The error magically goes away.  I found that <a href="http://stackoverflow.com/questions/3249799/python-feedparser-not-using-atom-wordpress-namespace">solution on StackOverflow</a>.  It wasn't a horrible process once I found the couple of gotcha's, so don't be afraid to ditch WordPress!</p>WordPress 2.1 Image Upload Problem2008-05-05T13:43:50+00:00scoopseven/author/scoopseven/http://kecko.com/wordpress-21-image-upload-problem/After upgrading to Fast-CGI, my WordPress 2.1 image upload tool started asking for a password every time a image was uploaded. Turned out to be a permissions issue with WP/Fast-CGI-IIS that was solved by following the steps below from <a href="http://joseph.randomnetworks.com/archives/2007/09/04/wordpress-file-uploads-with-iis/">Joseph Scott's Blog</a>.
<ol>
<li>Edit upload_tmp_dir option in php.ini. In my case I created an uploads folder in the wwwroot: upload_tmp_dir = “c:\inetpub\wwwroot\uploads”</li>
<li>Create the c:\inetpub\wwwroot\uploads folder and grant the IUSR full control of it</li>
<li>Create the uploads folder in your wp-content folder, for me this was in c:\inetpub\wwwroot\wordpress-trunk\wp-contents\uploads, then grant the IUSR full control of it</li>
<li>Restart the IIS service (to pick up the php.ini change)</li>
</ol>Multiple Blogs, One Wordpress Install2007-07-12T09:59:02+00:00scoopseven/author/scoopseven/http://kecko.com/multiple-blogs-one-wordpress-install/From <a href="http://likemind.co.uk/journal/?p=64">http://likemind.co.uk/journal/?p=64</a>...
In the home directory for my new blog, I created an index.php like this, pointing to my existing blog directory:
<?
define('WP_USE_THEMES', true);
require_once('../journal/wp-blog-header.php');
In the same directory I created a .htaccess to route other requests to the existing blog:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/portfolio$
RewriteRule . /portfolio/ [L,R=301]
RewriteCond %{REQUEST_URI} !^/portfolio/$
RewriteCond %{REQUEST_URI} !^/portfolio/index.php$
RewriteRule ^(.+) /journal/$1
Then I edited wp-config.php so it specified a different table prefix for my new blog, changing the assignment of $table_prefix to this:
if(substr($_SERVER['REQUEST_URI'], 0, 10) == '/portfolio') {
$table_prefix = 'pf_';
} else {
$table_prefix = 'wp_';
}
At that point I requested the new blog and got the installation dialog. After following it my new blog was basically ready, except for its theme. I wanted to re-use most of the existing theme, so I simply edited the files to test the global $table_prefix wherever I wanted different output.
For just two blogs this approach is OK. I’d tidy it up before I added any more.WordPress Wish List2007-01-25T13:04:35+00:00scoopseven/author/scoopseven/http://kecko.com/wordpress-wish-list/In order to make WordPress suitable for content management, we have to:
<ul>
<li>Allow for multiple authors for one post/article</li>
<li>Be able to display "editions" or compilations or multiple posts in one page</li>
</ul>