Dec 15 2011

Django Site matching query does not exist.

Category: Uncategorizedtuxie @ 11:16

When you configure your brand new Django project you’ll see in your settings something like:


SITE_ID = 1

That ID refers to the Django “sites” framework. If you plan on using the admin interface make sure that ID exists in the database, otherwise you’ll get an error:


DoesNotExist at /admin/

Site matching query does not exist.

Request Method: GET
Request URL: http://localhost:8000/admin/
Django Version: 1.3
Exception Type: DoesNotExist
Exception Value:

Site matching query does not exist.

If it doesn’t exist, create it:


>>> from django.contrib.sites.models import Site
>>> site = Site()
>>> site.domain = 'example.com'
>>> site.name = 'My website'
>>> site.save()
>>> site.id
3

That’s the ID you should use in your settings file:


SITE_ID = 3


Dec 07 2011

2nd place for Santa’s Media Queries!

Category: CSS,HTML5,JavaScript,Web Developmenttuxie @ 12:53

Santa's Media QueriesI’m happy to announce that my demo Santa’s Media Queries got the 2nd place on October’s Mozilla Dev Derby!! =)

(Read the announcement)

My first big surprise was to see the number of hits the demo was getting, never thought that it could attract so many people. At the time of this writing it has received 1744 views and 35 likes. Never expected that.

My second (and biggest) surprise was to find out that from all the excellent submissions (I mentioned some in a previous post) mine got to be in the top 3. It’s such an honor.

What makes it even more special is the people who chose it. Let’s take a look at the judges:

And the prize is a beautiful laptop messenger bag, something I’ve been checking out on ebay recently, but this one is *way* better than what I intended to buy =)

It’s perfect.


Dec 03 2011

Anatomy of a SPA. RubyConf Uruguay.

Category: JavaScript,Ruby,Uncategorizedtuxie @ 00:09

My present from the RubyConf Organization This is the prize I got for giving a talk at the RubyConf Uruguay, I totally loved it. It has my github nick in it =)

My talk was “Anatomy of a Single-Page Application: Client-side Model-View-Controller“. (Watch it. Spanish audio, slides in english.) For me was a total success, got a lot of great feedback, people approached me after the talk to ask questions and didn’t hear much of contrary opinions to what I said. I do know that how I said it wasn’t much fun for everyone.

I trolled a little. Not much, just enough, and (almost) always with proper justification. I trolled against jQuery, CoffeeScript and PHP. The problem was that I didn’t know there was a CoffeeScript talk right before mine. Duda Dorenelles talk about CoffeeScript, and as I watched his talk I was feeling bad for what I had on my slides.

Forget about CoffeeScript, be a man!” I think it’s the most controversial line of my talk, but it’s not groundless, and I explained it. I also talked to Duda and he totally understood, he even agreed with me. He is a super cool guy, I hope we can share a beer again sometime.

The organization of the event was excellent, besides some delay in the talks which is totally normal, everything went very smoothly, at least it seemed so. The night before the event they took the speakers to dinner, I didn’t expect that, was a very nice surprise. And as I mentioned before, I got this beautiful present after the talk which was very cool.

I was very anxious and nervous after the talk so I didn’t look at it very well, didn’t realize it had my nick on it. Later, when I was more calm I saw it and really loved it. I’m looking forward to being part of next year’s RubyConf Uruguay.