Now in Django - Welp, this site has been ported to Django. It's my second Django project but this is the first one that extends beyond two pages. Since putting it on production equipment a few things aren't working quite right but it's passable for now. Tomorrow I'll clean up any loose ends and write the story of the port. The URL rewrites to .aspx filenames are annoying me, but I might leave them to remind me of the old days. If I get motivated over the weekend I might set up some 301's. Please, If anybody sees anything broken or odd please email me. Now it's time to sleep!
Stored Procedures in Django - Web development platforms like Django go a long way to removing the need for writing hand-crafted SQL with all of their ORM goodness. Sometimes, for some reason or another, it's handy to execute hand-crafted SQL code or even a stored procedure. Naturally that should be a last resort and I don't intend on starting a discussion about when it is and when is not appropriate, but for those situations where it is this article applies. Database To illustrate how to do this I'll start out with the following MySQL table (the remainder of the post assumes it's filled with sample data). It'll sit underneath the the Document class in an application named "searcher". I'm sort of working backwards here as I've actually generated this table from a model I've included later...
Tale of a Website, from Rails to ASP.NET to Django - I hesitate to call it complete yet but for the most part www.chrisumbel.com has been ported from ASP.Net to Django. Sure, there really isn't a lot to this site so no port would have been incredibly painful but I'm quite pleased with the effort level (or lack thereof) required to get it done. Aside from just this port it's been a long and interesting ride for just a bunch of blog posts and comments. Ancient History: Rails in my basement In reality the story began with Ruby on Rails several years back. This site still bares the look, feel, basic data structure and even a few blog posts from kilnaar.com which was based on a Rails and MySQL stack and spent most of its time running on various OpenBSD, Solaris and...
Templating with NDjango - It never ceases to amaze me how many great open source tools and libraries have been ported to .Net. NUnit... NHibernate... NAnt... All incredibly widely adopted. Today, however I'd like to focus one that a coworker brought to my attention which may actually get some use at the office, NDjango. During my recent Django work I've become quite attached to Django's template language. It took me a while to warm up to it but I'm hooked. When I heard that the templating had been ported to .Net I was naturally quite interested. Examples As you'd expect, there really isn't all that much to it. Consider the following code /* The data we'll pass into the template */ Dictionary<string, object> context = new Dictionary<string, object>(); context.Add("name", "Chris Umbel"); context.Add("profession", "Database Administrator"); /*...
Using reCAPTCHA With Django - I sure was naive. When I launched a certain django-based site that accepted user comments (wonder which one that is?) a while back I thought I could block the comment spam myself without CAPTCHA. After a few months of traffic I started getting hammered with it and tried blocking IPs, keywords and patterns. All to no avail. The trouble-spot was a strait-forward, regular old HTML form that accepted the comment input. I needed it to appeal to wide browser requirements of the site. My AJAX-jQuery-to-django-piston-service comment submissions rarely were the source of spam entry but I needed my regular forms locked down as well. I toyed with the idea of rolling my own CAPTCHA but I honestly have bigger fish to fry. Turns out that integrating reCAPTCHA with django was a...
Using Solr in Django for Full-Text Searching via Solango - I've been doing quite a bit of work with Solr lately, both at the office and at home and, by golly, I love it! It's very powerful and simple to integrate with regardless of your platform. In this post I'll explain how to use Solr as a data-store independent search provider for Django projects. I'll assume that you have a functional Solr install and generally understand how to use it. If that's not the case Apache's Solr documentation can help. Get Solango The easiest way to get your project talking to Solr is via the Solango Django application. Grab the source from here and copy the solango sub-directory into your PYTHON_PATH. Configure Solango Solango must now be configured. Jump into the solango directory that you copied above and edit the settings.py...











