Ensuring Essential Data Exists in Your Django App on Startup When building Django applications that rely on permissions and roles, the auth.Group model becomes an essential part of your authentication …

Djangoのツールに"South"というモノがあるようです。 このツールを使うと、DBのマイグレーションをうまいことやってくれるようです。 プロジェクトで、既存のModelにフィールドの追加が発生したためこのツールを使ってみます。DBのマイグレーションが簡単にできるようになればもうけものです。 まずはインストール ドキュメント"Bitbucket | The Git solution for professional teams"を見てインストールをおこないます。 自分は、Mercurialを使ってソースを取得しました。Djangoアプリの部分だけ欲しかったため、一時的なディレクトにてsetup.pyのインストール作業を実施してソースを取得しました。 Djangoにsouthアプリを追加した時点(settings.pyのINSTALL_APPSに追加)でsyncdbが必要です。south
It's great that many software conferences nowadays put their videos online, DjangoCon has been especially good on this. Those who can't attend the real conference for budget or geographical reasons get a chance to experience some great presentations. It's great for pushing the overall web development level upward. I collected here mainly DjangoCon presentations, but there are a few other quality t
The document discusses making Django applications more "pluggable" by designing them to be focused, self-contained, and easily adaptable. It provides several examples of how to achieve pluggable applications, such as through configurable options, abstract models, optional integrations, and lazy registration of custom fields, managers, model admins, URLs, and templates. The goal is to make applicat
The document discusses the Django framework, highlighting its features and functionalities such as model validation, admin settings, URL routing, and template management. It provides examples of code snippets related to project setup and model configuration. Overall, it serves as a technical reference for developers using Django to build web applications.
"DAMON BLOGONS" の、 "The Perfect Django Settings File" という記事で紹介されていた Django の設定 (settings.py) が面白かったので、私が利用しているものと併せて紹介したいと思います。 環境による DEBUG の切り分け 開発環境では "DEBUG = True" と書くと幸せになれます。Django のデバッガーは強力です。ただし、本番環境にそのままデプロイしてしまうと・・・。デプロイを楽にするためにも、失敗を防ぐためにも自動的に切り分けるのが望ましいですよね。Damon 氏は以下のようなコードで切り分けているようです。 # Set DEBUG = True if on the production server if socket.gethostname() == 'your.domain.com': DEBUG =
実践的な DJango テクニック集として、凄くいい記事だったので、勝手に超訳してみました。 http://zeroandone.posterous.com/top-10-tips-to-a-new-django-developer 1. import にプロジェクト名を書かないこと 例えば "project3" というプロジェクトに "xyz" アプリケーションがある場合、次のようにはしないこと。 from project3.xyz.models import Author これではプロジェクトとアプリケーションの結びつきが強すぎて、以下の弊害がおこる。 アプリケーションの再利用がしづらい 将来プロジェクト名を変えたくなっても変更が難しい なので、このようにしよう。 from xyz.models import Author python パス上にある django プロジェクトならば、
I’ve been playing with automating Django deployments again, this time using Fabric. I found a number of examples on the web but non of them quite fit the bill for me. I don’t like serving directly from a repository, I like to have either a package or tar I can use to say “that is what went to the server”. I also like having a quick rollback command as well as being able to deploy a particular vers
Private content!This content has been marked as private by the uploader.
すっきりした、簡潔で明解な URL スキームの設計は、高品質の Web アプリケーショ ンでは重要な要素です。 Django では、フレームワークの制限なしに、望み通りの URL を設計できます。 .php や .cgi といった拡張子は必要なく、 0,2097,1-1-1928,00 のよ うな意味不明の URL にする必要もありません。 URL はすっきりした扱いやすいものにすべきであるという主張については、ワール ドワイドウェブの産みの親である Tim Berners-Lee の優れた解説、 Cool URIs don’t change を参照してください。 概要¶ あるアプリケーション向けの URL を設計するには、 URLconf (URL 設定: URL configuration) と呼びならわされている Python モジュールを作成します。このモ ジュールは pure P
BPで話題になっているdjango-debug-toolbar. 簡単にSQLやHTTPリクエストの情報を見れるようになるとのこと。 早速インスコした http://robhudson.github.com/django-debug-toolbar/ ちなみに mac os X 10.5.8 に入れるだけ入れてみた。 インストール eazy_install $ sudo easy_install-2.5 django-debug-toolbar パス設定 自分の環境ではeasy_installしてもパスには追加されなかった(デフォでは追加されない?)ので、 PAYTHONPATHにdjango-debug-toolbarのディレクトリを追加 $ vi ~/.zshrc --- # Python export PYTHONPATH=/opt/local/lib/python2.5/site-
Django Request Response processing by shabda on June 24, 2009 Have you wondered the steps a users request goes through before being responded to by Django? The answer lies in reading django.core.handlers.base and django.core.handlers.wsgi. Here is a diagram explaining what happens. (Click to enlarge.) The steps are. (With Apache/Mod_wsgi, similar steps for other setup.) User’s request comes to Apa
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く