Moved to Mezzanine

Posted by: aigarius 1 year, 1 month ago

(10 comments)

After my server that has hosted my blog for some years had given out its last breath (second motherboard failure), I decited it was time for a change. And not just server change, but also change in the blog engine itself. As I now focus on Python and Django almost exclusively at work, it felt logical to use some kind of Django-based blog or CMS. I tried django-cms and mezzanine and ... Mezzanine is so fast and simple, that I simply stopped looking.

After simply following the tutorial and creating a skeleton project, I had a ready-to go site with all the CMS features, incuding a blog. I just had to change a few settings to have the blog module be the home page of the site, change site settings for the title and Google Analytics settings and such and tweak the theme a bit to my liking.

This was my first real exposure to a Bootstrap design. I must say - it is very simple to understand and modify if your needs fit within its limits. For example, I wanted to remove the left sidebar and expand the main content block to fill that. All I had to do was to remove the div element with class "left-sidebar span-2" and change the class of the main content part from "span-7" to "span-9". To do that I simply copied the templates/base.html file from mezzanine default templates and modified it. The information from django-debug-toolbar showed me what files were used in rendering the page.

But the feature that really got me hooked was the Wordpress import. Using a simple management command I was able to feed into Mezzanine instance the XML export file from Wordpress. It created blog posts, categories, comments, static pages and even redirects from Wordpress permalinks to Mezzanine permalinks. It was not flawless - there were a few issues:

  • I had to set the COMMENT_MAX_LENGTH setting to something higher than the default 3000 chars to accomodate some longer comments
  • As I failed to clean up the comments before exporting, comments marked as spam in Wordpress still got into the XML and showed up in the new blog without being marked as spam there
  • Some comments (mostly spam) had a much longer user name than 50 char maximum. Even with a --noinput setting that should have truncated the names, the import errored-out as Django passed the long strings to the Postgress database which promptly refused to store too much data or to truncate it. I chose to work around that by increasing the column size in Postgress.
  • One of the posts did not have a set title, so the import took the whole first paragraph as the title and then failed to create a good slug from it. This caused the redirect creation to fail. I fixed this by editing the XML file and setting a title.
  • It looks like the slug creation for the redirect and the actual slug are slightly different. Some permalink redirects for posts with non-ascii symbols in the title failed to link up correctly

After that was done it was a relatively straightforward process of picking up the code and data and deploying it to a Django-friendly hosting service. There is a plenty of good competition out there, most now offer a simple one-click Django installation, so I just created a simple Django skeleton via their web interface and then replace what they generated with my app while keeping their settings as local_settings.py . I should probably write a bit more details about the process. After I create a custom fabric file for this.

It is quite a strange feeling to have a Mezzanine blog that responds faster from a shared server half a continent away, compared to a Wordpress on dedicated server in the same room

There are a few features that I am still missing - most notably draft post autosave. That has bitten me hard while writing this post :P Also a Twitter digest post feature. But on the bright side - that is a great motivation to write such features, preferably in a portable way that other people can use too :)

Current rating: 4.3


Comments

  • aigarius 1 year, 1 month ago

    Another feature for the TODO list:
    * autopost of new blog entries to my Twitter stream

    Link / Reply
    • jackdhanaaxtteyro 1 week, 2 days ago

      Seb didn't make any mistakes and we finished second, Button said. "It's good to get some points on the board after the retirement at Monza. <a href=http://boutique.antesite.com/orders.php?hollister-france/>hollister france</a> Green Zone opened at a distant No. 2 in North America with US$14.5 million. Distributor Universal Pictures, which axed its top executives last fall after a poor run at the box office, had hoped for a slightly better showing. <a href=http://www.m2ca.fr/plesk.php?moncler-soldes/>moncler soldes</a> China's first golf course was built in 1984 and although around 500 more have sprung up since, a six-year-old government ban on new development has slowed growth. <a href=http://www.grayandwellsbodyshop.com/web.php?&#x30AF;&#x30EA;&#x30B9;&#x30C1;&#x30E3;&#x30F3;&#x30EB;&#x30D6;&#x30BF;&#x30F3;/>&#x30AF;&#x30EA;&#x30B9;&#x30C1;&#x30E3;&#x30F3;&#x30EB;&#x30D6;&#x30BF;&#x30F3;</a> He made sure of that by staying aggressive even when he had a five-shot lead with 11 holes to play in the final round on Tuesday. Rosberg's only previous pole was in China last year. Mercedes has not had back-to-back poles since it returned as a works team in 2010.

      I had nothing to lose, said Howell, who started the year outside the top 100 in the world and hasn't qualified for this World Golf Championship in five years. "In this format, match play is crazy. He's Tiger Woods. I was lucky to hang in there." <a href=http://www.a-chateau.fr/memo.php?abercrombie-2/> abercrombie</a> The 76-year-old director lost his first bid for release on bail this week, but his lawyers are pursuing other avenues. <a href=http://www.feoh.fr/font.php?abercrombie-et-fitch/>abercrombie et fitch</a> LAW enforcement agencies in the United States are reporting a surprising drop in crime last year, with homicide rates in some major cities plunging to levels not seen in four decades. <a href=http://www.la-balade-des-livres.fr/ajax.php?louboutin-femme/>louboutin femme</a> Boston bottled up James and cruised to a convincing 120-88 victory over the top-seeded Cavaliers in front of a home crowd that booed its team off the court. <a href=http://www.m2ca.fr/case.php?air-max-90-pas-cher/>air max 90 pas cher</a> If he signs, he will compete with Steven Gerrard, Lucas Leiva, Raul Meireles, Jay Spearing, Christian Poulsen and Jonjo Shelvey for a place in the center of Liverpool's midfield.

      Police surrounded the plant minutes after the shooting, and roads in the area were detoured as officers swarmed nearby. <a href=http://www.la-balade-des-livres.fr/view.php?hollister-homme/>hollister homme</a> French Open champion and sixth seed Francesca Schiavone of Italy advanced with a 6-4, 6-3 win over Russian Dinara Safina. <a href=http://a-chateau.fr/case.php?jordan-retro-4/>jordan retro 4</a> Prime minister-designate Abdurrahim El-Keib is scheduled to form a government by Tuesday, and the fate of Saif al-Islam, whom Libyans want to try at home before, possibly, handing him over to The ICC, will be an early test of its authority. <a href=http://www.avanti-telecom.com/images/down.php?moncler-femme/>moncler femme</a> Young adults aged 18 to 25 had the highest level of mental illness at 30 percent, while those aged 50 and older had the lowest, with 13.7 percent, said the report by the Substance Abuse and Mental Health Services Administration (SAMHSA). Court records reveal that Apple has already seized unauthorized iPod, iPhone and iPad accessories sold by two stores in the Flushing neighborhood of the New York City borough of Queens, and is now demanding the names of its customers and suppliers. It is also asking one of the defendants -- Apple Story -- to change its name to keep consumers from confusing the unauthorized gear with Apple-sanctioned products.

      http://www.creditcardflyers.com/credit-card-news/2012/spotting-credit-card-skimmers-3653.php
      http://www.valtolson.com/
      http://liloli.net/counseling-life-coaching-psychotherapy/2014/01/happy-new-year/comment-page-1/#comment-4747
      http://online.siu.edu/d2l/lms/blog/view_userentry.d2l?ou=6606&ownerId=54298&entryId=464&ec=1&iu=1&sp=&gb=usr+Result:+%D1%A1%D4%F1%D7%A2%B2%E1%D3%C3%BB%A7%C3%FB+%22bletrsfer%22;+%B7%A2%CB%CD;
      http://www.revivalnet.org/addmsg.html

      Link / Reply
  • daGrevis 1 year, 1 month ago

    Looking good, working great! :)

    Another thing you might want to add — favicon.

    Link / Reply
  • Martin 1 year, 1 month ago

    Too bad, that mezzanine did not make it into Debian. There was an ITP, but no upload happened. I don't like software, that is not in Debian :~(

    Link / Reply
    • aigarius 1 year, 1 month ago

      I, personally, do not see *too much* sense in having a rapidly changing web software package in Debian stable. The pattern or declaring requirements and then satisfying them in a Python virtualenv folder for each web app separately makes a bit more sense to me for these environments.
      There kind of projects simply do not support running a 3 year old version.

      Link / Reply
      • Martin 1 year, 1 month ago

        Well, that's not my cup of tea. When I'm using a software for a long term deployment, I want each and every component in a central package management, security support (it's the web, right?), and uniform bug tracking. Using virtualenv + pip for playing and development would be OK, as long as the production deployment does not depend on such things, but uses proper package management. But YMMV.

        Link / Reply
        • krs 1 year ago

          Python has its own central package management, so you still have that, you can even peg it to a version without the normal apt-conflicts.

          Link / Reply
  • Josh Cartmell 1 year, 1 month ago

    Great post and welcome to Mezzanine! Feel free to bring up any of the issues you've encountered with Mezzanine on the Google group (https://groups.google.com/forum/#!forum/mezzanine-users).

    The community is my favorite part of Mezzanine.

    Link / Reply
  • Big Al 4 months, 3 weeks ago

    I am new to django/python. I am wanting to create a business directory site, and was starting out using many tutorials, etc, but then wondered whether something like django cms or django mezzanine would be a better place to start since it would have logic like registering, logging in, etc already built into it. I don't know how difficult it would be in either of the django cms' to create a search form and then show listings one at a time, etc, and add more logic as needed. Has anyone here done something similar? Also do you then do the development on the server??? or locally and upload to the server?

    Link / Reply
  • musician#1 3 weeks, 2 days ago

    Thanks for interesting article :)

    Link / Reply

New Comment

required
required (not published)
optional

Recent Posts

Archive

2014
2013
2012
2011
2010
2009
2008
2007
2006
2005

Categories

Authors

Feeds

RSS / Atom