random ramblings and various other shenanigans

› Welcome people

Hello and welcome to my blog!

I created this blog mainly to play around in Django and see how quickly and efficiently a descent web application could be created using the Django framework.

It really is that easy, you spend most of your time realising that what you want to do is actually already built into the framework and will take only a matter of minutes to implement into your application, then you realise that some of your code could have been done much quicker and you end up with hardly any code left!

Now I've made a blog in Django I'm going to have a few goes at building something else, something a little more challenging, this blog imports my Google Reader shared items so if you subscribe to one of my rss feeds you should find something interesting to read while I'm trying to think of something else to blog about!

Cheers!

by Ben on 19:00, August 9, 2007 | 0 comments | leave comment | permalink
tags | | | |



› Extending Djangos auth.User

I was trying to find a good way to extend the User model from django.contrib.auth which seemed as easy as


from django.contrib.auth.models Import User
class User(User):
photo_url = models.CharField(blank=True,max_length=200)

Seemed easy enough, and looking at the sql that was produced it looked like I'd guessed correctly.

However when trying to use this model on the admin site I was running into error after error and eventually ran into the article Tips on Extending User model which explains that this is the wrong way to go.

To sumarise, create a User or UserProfile model which references auth.User


from django.contrib.auth.models import User
class User(models.Model):
photo_url = models.CharField(blank=True,max_length=200)
user = models.ForeignKey(User, unique=True)

Add this to settings.py


AUTH_PROFILE_MODULE = 'myapp.User'

and you can reference the variables with


u = User.objects.get(pk=1)
u.get_profile().photo_url

by Ben on 14:56, August 19, 2007 | 0 comments | leave comment | permalink
tags | |



› Google maps without the api!

Google Maps can now be inserted into your website by just copying some HTML from the Google Maps website..

For example

Easy eh! No programming required!

by Ben on 17:58, August 23, 2007 | 2 comments | leave comment | permalink
tags | | | | |



› "Knowing" a Language (link)

via Proudly Serving My Corporate Masters

While obsessively trolling the Web for mentions of Find the Bug, I came upon this post from a fan of python, which is one of the 5 languages I used in the book. He discusses one of the Python problems...

posted on 12:56, September 4, 2007 | 0 comments | leave comment | permalink
tags | |



› Rails Envy videos

I really like these Rails Envy Videos.

Similar to the Mac Guy vs PC Guy videos, but it's ruby on rails vs Java, PHP, .NET and Django (or DJ Ango), most amusing.

They're up to #7 at the time of posting, but according to this there are some more to come so stay tuned!

by Ben on 23:50, September 10, 2007 | 0 comments | leave comment | permalink
tags | | | |