This tutorial walks through the deployment of a default, autogenerated Django website to an AWS Elastic Beanstalk environment running Python. This tutorial shows you how to host a Python web app in the cloud by using an Elastic Beanstalk environment. In this tutorial, you’ll do the following: Prerequisites To follow this tutorial, you should have all of the Common Prerequisites for Python installe
Mezzanine is a powerful, consistent, and flexible content management platform. Built using the Django framework, Mezzanine provides a simple yet highly extensible architecture that encourages diving in and hacking on the code. Mezzanine is BSD licensed and supported by a diverse and active community. In some ways, Mezzanine resembles tools such as Wordpress, providing an intuitive interface for ma
Django Software Foundationが「Django 1.4」をリリースした。Djangoは開発の効率化を実現する柔軟性の高いPythonフレームワークで、Pythonを使ってWebアプリケーションやWebサイトを構築する際に使用できる代表的なフレームワークのひとつ。 Django 1.4で最も注目すべき機能としてタイムゾーンのサポートが挙げられる。この機能を有効にすると、タイムゾーンに対応したオブジェクト内部では日付や時刻をUTCで保持し、ユーザに表示する時はローカルの時刻に変換するようになる。プロジェクトではDjango 1.4にアップグレードする場合に、タイムゾーンに注意する必要があるとし、ユーザへのケアとしてタイムゾーンの移行ガイドやFAQを用意している。 Django 1.4では、ORM(Object Relational Manager)に多数の改善も加えられて
"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 =
はじめに サエンバイノー(こんにちは)、Python界のメンソレータムです。さて猫も杓子もクラウドの時代ですが、みなさんいかがお過ごしでしょうか。先日ふと「DotCloud」というサービスを見かけてベータ登録したので、ご紹介致します。 DotCloudってなに? dotCloud - One home for all your apps DotCloudはいままでWebアプリケーションホスティングサービスの中で期待されていた領域に切り込もうとしてますよ。まず使える言語はPHP, Ruby, Python, Javaがいまのbetaの時点で使えて、さらにこれからリクエストがある言語にも対応しようとしてます。(ErlangとかSchemeとか)で、DBとかMQとかすでに有名所はいくつか使えて、なんでもリクエストがあれば対応するぜ!っていう勢い。またスケールに関してもスケールアップ、スケールアウ
Lee Cuts Code Lee Packham's blog about software, engineering and life I have recently started doing development on the iPhone. It’s great fun. I am particularly interested in the Push aspect of this. I’m also a big fan of Python.There’s a number of RESTful things that can be done with Ruby on Rails. However, the whole ‘packaged application’ thing is quite new to that framework. To Django, it’s the
Django thumbnails, resize image with PIL and python There is a wide variety of django filters and tags to crop, resize or make a thumbnail out of an image but most of them seem to reinvent the wheel. #!/usr/bin/env python try: from PIL import Image, ImageOps except ImportError: import Image import ImageOps image = Image.open('snake.jpg') # ImageOps compatible mode if image.mode not in ("L", "RGB")
change a widget attribute in ModelForm without define the field Author: jedie Posted: July 25, 2008 Language: Python Version: .96 Score: 6 (after 6 ratings) Download Raw I will change a model form widget attribute without define the complete field. Because many "meta" information are defined in the model (e.g. the help_text) and i don't want to repeat this. I found a solution: Add/change the widge
開発途中では頻繁にモデル構成変えたりするので、スキーマ変更時にデータベースを更新してくれないと苦しい。
ページ番号などの情報を URL に持たせる時の話。 Django 的には /something/?page=7 のようにクエリ要素を使うのと /something/7/ のような URL はどちらが便利なのか考えてみた。 今の時点での結論は「URL ディスパッチャが強力なので /something/7/ でよい」かな。 Django 使いはじめたばかりなのですぐに意見が変わる可能性は大。 /somethig/7/ だけでなく /something7/, /something/page7/, /something/page/7/ など、正規表現しだいでいろいろやりようがあるのもメリット。 以下比較。 URL ディスパッチャの記述 ここだけはクエリ要素使用のほうが楽。 クエリ要素に情報を持たせる場合 URL ディスパッチャはクエリを無視するのでやることがない。以下の記述で /something
Mitsukuni SatoSoftware Engineer and Web Developer in 東京, 日本 I am a software engineer and web developer currently living in Tokyo, Japan. My interests range from cycling to Motorbike. I am also interested in programming, outdoors, and web development. You can click the button above to read my blog. If you’d like to get in touch, feel free to say hello through any of the social links below.
http://www.dabapps.com/blog/logging-sql-queries-django-13/ >>> import logging >>> l = logging.getLogger('django.db.backends') >>> l.setLevel(logging.DEBUG) >>> l.addHandler(logging.StreamHandler()) >>> for b in Bookmark.objects.all(): ... print b.page.url ... http://google.co.jp http://yahoo.co.jp (0.000) SELECT "Bookmark_bookmark"."id", "Bookmark_bookmark"."page_id", "Bookmark_bookmark"."user_id"
前回の続きで、CentOS 5.6 に Django 1.3 をインストールして、mod_wsgi 3.3 を使って動作する様に設定してみたのでメモ Python 2.7.1 と mod_wsgi 3.3 は既にインストールしてあるので、後は Django をインストールして設定をすれば OK。 インストールそのものは簡単。 前に DJango をインストールした時と同様に easy_install で一発。 [paraches@localhost myTest]$ sudo easy_install Djangoこんだけ。 一応、確認。 [paraches@localhost myTest]$ python Python 2.7.1 (r271:86832, Apr 19 2011, 01:31:25) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on
モデルとは、サイトを構成するデータの、ただ一つかつ最終的なデータソースを指 します。モデルには、保存したいデータに不可欠なデータフィールドと、その振舞 いが収められています。一般的に、各モデルは単一のデータベーステーブルに対応 づけられています。 基本として、まず以下のことを知っておきましょう: 各モデルは Python のクラスで、 django.db.models.Model のサブ クラスです。 モデルの各属性値は、データベース上のあるフィールドを表現します。 これらの情報をもとに、 Django はデータベース API を自動生成します。 API の詳細は クエリを生成する で解説します。 See also このドキュメントを理解する上で、 モデル例の公式リポジトリ が参考になるでしょう。 (Django のソース配布物中では、これらの例は tests/modeltests ディレ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く