background preloader

Django

Facebook Twitter

Work / Wilson Miner. Django for non-programmers. In the 48 hours since I launched the new version of this site, I’ve been inundated with questions about Django, the Python-based web application framework I used to build it. I’ve pointed many people at the official Django website, which is loaded with great information. However, most of it is aimed at programmers — and rightfully so. Django is, after all, a platform for programming web applications. I wanted to take a moment or two while I still have your attention to tell you why I think Django is a great tool for those of us who really aren’t programmers, as well. I consider myself a web designer. Enter Django. What is Django? According to the official site, “Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.” Now, if you’re used to building sites using a blogging app (Wordpress, TXP, etc.) as a CMS, you’re used to getting all that for free.

With Django, you get all of these things and none of the limitations of a blogging app. Views. How Not To Sort By Average Rating. By Evan Miller February 6, 2009 (Changes) PROBLEM: You are a web programmer. You have users. Your users rate stuff on your site. WRONG SOLUTION #1: Score = (Positive ratings) - (Negative ratings) Why it is wrong: Suppose one item has 600 positive ratings and 400 negative ratings: 60% positive. Sites that make this mistake: Urban Dictionary WRONG SOLUTION #2: Score = Average rating = (Positive ratings) / (Total ratings) Why it is wrong: Average rating works fine if you always have a ton of ratings, but suppose item 1 has 2 positive ratings and 0 negative ratings.

Sites that make this mistake: Amazon.com CORRECT SOLUTION: Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter Say what: We need to balance the proportion of positive ratings with the uncertainty of a small number of observations. (Use minus where it says plus/minus to calculate the lower bound.) You will quickly see that the extra bit of math makes all the good stuff bubble up to the top. Wilson, E. Writing your first Django app, part 1. Let’s learn by example. Throughout this tutorial, we’ll walk you through the creation of a basic poll application. It’ll consist of two parts: A public site that lets people view polls and vote in them.An admin site that lets you add, change and delete polls. We’ll assume you have Django installed already.

. $ python -c "import django; print(django.get_version())" If Django is installed, you should see the version of your installation. This tutorial is written for Django 1.8 and Python 3.2 or later. See How to install Django for advice on how to remove older versions of Django and install a newer one. Where to get help: If you’re having trouble going through this tutorial, please post a message to django-users or drop by #django on irc.freenode.net to chat with other Django users who might be able to help. Creating a project If this is your first time using Django, you’ll have to take care of some initial setup. . $ django-admin.py startproject mysite Note Where should this code live? These files are:

Are you generic? / Wilson Miner. Even more Django for non-programmers. How I built a portfolio app in 30 minutes with Django's generic views. I remember when people were just getting excited about Rails. It was all about the demo. Build a blog (or whatever) in 30 minutes. It was so elegant that even designers were getting into it. As a designer for World Online, I’ve been involved with the development of Django since before it was Django. I’ve finally been able to realize that dream (sniff), thanks to a little feature in Django called generic views. The missing link There are really three basic steps you need to build a basic web app in Django. And I can get my head around a model. Views are another story. But most of the time I don’t need anything that complicated. That’s where generic views come in. In fact, it’s possible to build an entire app or site using entirely generic views, without writing a single line of actual view code.

How I built a portfolio app in 30 minutes with Django Step 1. 2. Perfect! Step 3. Quercus php speed. GoDjango.com - Going Through Django Screencasts. Unravelling the anatomy of a website visually | Richard Boardman. The visual anatomy of wordconfusion.com (see below for complete diagram) I’ve been reading (and writing) a lot of code recently and wanted to share a graphical technique for understanding an alien codebase. Code can be hard to follow, especially if you didn’t write it, and even more so if you are new to a language. Web apps are particularly hard to follow since they consist of several layers, each containing multiple technologies (HTML, CSS, Javascript, plus the intricacies of whichever MVC web framework you use).

I’ve been trying to get back into programming recently with Python and Django. To that end I’ve been doing a number of online tutorials. I find these easiest to follow when the tutorial guides you, incrementally, through the writing of an app so you can grasp the code a piece at a time. A couple of my favourite tutorials on this “incremental” type are James McGaw’s Beginning Django E-Commerce, and Ayman Hourieh’s Django 1.0 Web Development.

Django-social-auth 101 - GoDjango.com.