Archive for the Website Category

14 December 2009

Django better than a CMS?

Django logo

I recently had to rewrite a website I’m maintaining for a very small business: Le fil à soi. They are 3 teacher who offer courses of chinese massage, qi gong and Gestalt therapy in Bordeaux, France. The requirements for the website are quite simple:

  • presentation of the place, the people, and contact information
  • pages for all courses sorted in categories
  • automatic management of courses dates display and RSS feed generation
  • simple backend to modify courses information (should be used by the teachers, although they don’t really like computers and prefer sending me an email…)

The version I wanted to replace was a hand-made PHP website. I started it years ago when I knew little about websites technical design, so it had become really messy and complicated to maintain. I considered letting someone else maintain the website, so I needed a cleaner version.

Using a CMS: Drupal or WordPress

A CMS (Content Management System) is a platform that makes building a website easy. WordPress is particularly intended to create blogs, but there are plenty of plugins that enable to create any type of websites. Drupal is really made to build websites of any type. There are plenty of plugins too that address about every possible needs (calendar, online shop…)

The strength of these CMSs is that they manage the two parts of the website: the user part, and the administration part. The administration part gives you many simple ways to personalize and watch the user part.

I started two small prototypes using these CMSs and came to the same conclusion: none of them perfectly addresses my very simple needs.

For example for the courses dates managment: plenty of plugins do something close enough to what I want, but none do it exactly. So I will have to personnalize a plugin, probably without real documentation of the code. This plugin will then be updated (without documentation again) by its author, and I’ll have to maintain my changes again and again…

It’s the same for the theme: plenty of themes are available but I can’t seriously download and use a design without customizing it.

So I can make my very simple website using a CMS but:

  • the result will be huge, with plenty of features I won’t use (no blog, no users management needed…)
  • it will be difficult to maintain, and I will have to watch updates to the plugins I have customized
  • I will have to make regular updates when the CMS is updated, because known security flows of well-known CMSs are rapidly used by “hackers”

This is a lot of work for such a small website.

Using Django

Django isn’t really a CMS. It’s a Python framework to build websites (comparable to PHP Zend, Ruby On Rails…). So it means that you have to actually write code to use it.

The huge difference with other web frameworks is that Django has originally be developped for a news website, so content management was very important. That’s why an impressive feature is available: an automatic administration generation.

I just had to define my models (what a course is, what a teacher is, what a date, a category is). Then it was mapped to my database and the administration part was generated. I finally defined my views, that is to say the way these models are displayed to the users (with simple tools to generate RSS feeds, sitemaps…)

The advantages of this approach are:

  • the final application is very small, no useless features
  • you get exactly what you want, you haven’t to adapt to random plugins found on the Internet
  • you know perfectly what each line of code does (even if you don’t document it…)
  • the only updates you have to watch are Python and Django updates, that are rare and usually well managed

The only possible drawbacks I see:

  • There are much fewer people who are used to Python Django than people who are used to WordPress, so it will be more difficult to find maintainers (but they will be better :p)
  • Python has to be properly supported by you host. I use OVH, that supports Django only in CGI, but it’s okay for such a small website.
  • There is no WYSIWYG editor by default in Django-generated administration: this can be bad to edit articles (or courses descriptions for me). But it’s fairly easy to add TinyMCE as it’s purely javascript.

Conclusion

If you want to create a simple full-featured blog, use WordPress. If you want complicated features like an online shop, use Drupal.

But if you want to build a simple, dynamic and easy to maintain website, and coding doesn’t scare you too much, use Python Django. You will get exactly what you want, without much efforts, and the result will be very easy to maintain.

Le fil à soi website main page

Le fil à soi website main page

Le fil à soi pages administration

Le fil à soi pages administration

2 Comments »

1 June 2008

Develop a website for students to choose projects

[lang_fr]Logo de l\\\'UBO[/lang_fr][lang_en]UBO logo[/lang_en]

From january to june 2007, for my second semester project at TELECOM Bretagne “Development project”, I was asked, with 3 other students, to develop an online projects management system for the computer science department of the university Université de Bretagne Occidentale (UBO).

Goals

This website had to allow the persons invited by the projects session administrator to enter projects propositions. These propositions were then validated by the administrator, and shown to the students. THe interested students could then sort their choices. Once it was done, the administrator could assign projects to students, trying to satisfy a maximum of students. The assignments were then notified to the students.

The students had to be identified thanks to the LDAP of the UBO. However the persons who entered projects propositions weren’t all in the LDAP.

The website had to work in the most used browsers, and to use PHP and MySQL server-side.

Problems and solutions

The most difficult problem was the assignment of projects to the students. First we wanted to make an automatic system, but it wouldn’t have been flexible enough, and we hadn’t enough time to implement it. So we decided to create an AJAX interface that allowed the administrator to see in live which students and projects were unsastsified, and which changes could improve the situation. The changes could be saved at any moment to prevent data lost.

The interface for the students to sort the projects was a bit complicated too. So we used javascript to allow the student to slide and sort the projects. However the interface worked properly if javascript was disabled.

We had a little technical problem too to test the authentification system: we worked in TELECOM Bretagne and we hadn’t access to the UBO’s LDAP. So we tested the authentification with the TELECOM Bretagne’s LDAP, and we made the last changes during the deployment on the UBO’s server.

Difficulties

La première difficulté que nous avons rencontrée est que parmi le groupe de 4 étudiants pour ce projet, j’étais le seul à avoir déjà développé en PHP. Il a donc fallu du temps pour que les 3 autres apprennent ce langage.

THe first difficulty was that among 4 students, I was the only one to already know PHP. So the 3 others needed time to learn this language.

An other problem was due to a bad requirements gathering at the beginning of the project. As the problem wasn’t precise, the requirements have changedduring the project, making us waste a lot of time.

Conclusion

Despite these difficulties, the final result was functional, not beautiful (none of us was designer). It was fairly easy to maintain and properly documented.

I don’t know if our system is presently used at the UBO.

No Comments yet »

31 May 2008

A short adventure: Netvibes modules directory

[lang_fr]Un mini module Netvibes[/lang_fr][lang_en]A Netvibes mini module[/lang_en]

Do you know Netvibes ? This is (in my opinion) the best customizable start page (competitor of iGoogle).

It allows you to put on the same page all the information you are interested in on the web. For this, it uses a modular structure: each user can add the modules it is interested in.

The idea of a netvibes modules directory

Au début, seuls les développeurs de Netvibes créaient des modules, qui étaient accessibles à partir d’une barre latérale dans Netvibes.

At the beginning, only netvibes developpers could create modules, that users accessed thanks to a sidebar integrated in Netvibes.

But on 3rd March 2006, Netvibes announced on its blog the Mini Module API. So anyone with HTML knowledge could create modules for Netvibes. I then tried to create some modules.

Some days later, modules had been created by Netvibes users, but there was no easy way to list these modules. I then decided to create a modules directory. I released it some weeks later at http://twisterss.free.fr/netvibes. The website is now closed, but you can still see it in this blog’s archives.

This directory, that was available in English, French and later in German, was very successful, and most of netvibes modules were rapidly added by their authors.

Collaborating with Netvibes

A bit later, I was contacted by Tariq Krim, then Netvibes CEO, to integrate the directory to Netvibes. Thanks to this collaboration, the design was improved by a Netvibes designer (Maurice Svay), and I added RSS and Ical feeds support to the directory (an idea of Tariq).

Due to difficulties in the integration, my original code hasn’t been used in the Netvibes directory, but my database has been integrated to the Netvibes directory, that is still working.

To avoid multiplying the modules lists, I then deactivated my directory, and replaced it with a redirection to the Netvibes directory.

Conclusion

Finally my directory has only worked during some months, but it has had a lot of visitors. Thus I was obliged to create an advanced caching system, to avoid overloading my free host.

This short adventure allowed me to discover the Netvibes team. I understood too the necessity to write readable code, and to separate it from the appearance of the website, in order to ease the collaboration with other developpers and the reuse of the code. If I had properly used the PHP Zend framework, my code could probably have been reused in Netvibes directory.

No Comments yet »

Create the website of a very small business: Le fil à soi

[lang_fr]Logo du fil à  soi[/lang_fr][lang_en]Logo of Le fil à  soi[/lang_en]

This website is one of the first websites I have created.

History

The firstversion looked very bad: there were animated GIFs and frames that gave the website a very unprofessional look. Sadly I haven’t any screenshot of this version.

The second version was a bit better: I had discovered PHP, that allowed me to replace the frames by includes. But my free host didn’t provide any database, so all pages were saved in text files.

This architecture didn’t ease the modifications I had to do: generation of an RSS feed, creation of a simple administration interface, change of design…

Present state

A few years ago, I changed of free host, and I rebuilt completly the website to use a database and a homemade template system. I changed the design too (but the present design is still far from being XHTML valid).

You can see the website of “Le fil à soi” in its present version.

Conclusions

I am not yet satified by the design of the website, but I am limited by my skills in graphic design.

If you have to build a website for a very small business too, you should use a Content Management System (CMS) (drupal for example). It will allow you to reuse themes and plugins, and to customize the website as your client want very rapidly.

The next step for me would probably be to migrate this website to a CMS, and to convince the owners that they should pay for a real host and domain name.

No Comments yet »

  • Welcome!

    I write on this blog about my projects, my practices and my discoveries in the domains of the internet, networks and computer science.

    Tristan, French student in TELECOM Bretagne, a "grande école" specialized in telecommunications

    Contact me Twitter Facebook

    Read more »