I am really excited to present this Django tutorial, made with Django 1.8 and Python 3. In this tutorial, I will show you how to create a Django Project from scratch. I will focus in a simple Task manager project, but the idea is that you can follow this tutorial while building your own project. Specially during the first posts. And you will be able to download a Django Project Boilerplate too! 🙂
What’s the optimal layout for your Django applications, settings files, and various other associated directories? When Django 1.4 was released it included an updated project layout which went a long way to improving the default Django project’s layout, but here are some tips for making it even better. This is a question we get asked all of the time so I wanted to take a bit of time and write down
In this series we’re discussing basic to advanced techniques for writing fast, efficient, and focused unit tests in the Django framework/content management system (CMS). Let's start with some background. One of the most important aspects of working on a software team is code testing. During a big sprint towards a production release on a recent project, my team decided to get really serious about t
What are class-based views anyway? Django's class-based generic views provide abstract classes implementing common web development tasks. These are very powerful, and heavily-utilise Python's object orientation and multiple inheritance in order to be extensible. This means they're more than just a couple of generic shortcuts — they provide utilities which can be mixed into the much more complex vi
I recently started using Sublime Text 2 more and more as my main editor for Python development. This article explains my setup and some tweaks that make Python programmers happy. Why Sublime Text? I’ve been an avid user of TextMate for a long time. It’s light-weight, open-source, and as a native OS X application it feels very Mac-esque. While TextMate is a great editor it seems very bare bones som
Viewable in Serbo-Croatian - Thanks to Vera Djuraskovic! As part two in this series on testing in Django (part I if you missed it), we're going to continue expanding the test suite on the venerable "polls" app. As with the previous post, the code can be found on Github with tags marking our progress along the way. Where we left on the previous post was adding some view tests for basic HTTP GET req
Welcome to Django Testing Docs’s documentation!¶ This is a place to help contribute to Django’s docs about testing. It is hosted on Github. If you want to help contribute, please fork the docs and help out! Hopefully this will make it’s way back into the Django documentation at some point. If you have any questions, please contact Eric Holscher at eric@ericholscher.com Contents:
Djangoでユニットテストを書く際にテストクライアントを使うことができますが、これはurls.pyを用意しないと使えません。 しかし、ビュー関数のみをテストする場合、Requestクラスのオブジェクトが必要になります。 django.test.client.RequestFactoryを使えば、GETやPOSTメソッドのRequestオブジェクトを簡単に生成できます。 試したバージョンは、Python2.7.2、Django1.4。 views.py from django.http import HttpResponse def my_view(request): return HttpResponse("OK") このmy_view関数をテストする。 tests.py from django.test import TestCase from django.test.client i
Thu 07 March 2013 By Beno�t Bryon How to test views of a Django application? Django's builtin test client is not suitable for unit testing! It performs system tests: it handles your views as a black box in a project's environment. This article provides a recipe for developers to replace Django's builtin test client by smaller, fine-grained, view-centric tests. self.client.get(): system tests for t
This document summarizes Andy McKay's presentation on the anatomy of Mozilla's large Django site. It discusses performance optimizations including caching, reducing SQL queries, async tasks with Celery, and localization. It also covers code reuse through libraries like Bleach and JavaScript testing. Testing, linting, and continuous integration with Hudson were also mentioned.Read less
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く