How and why to use django-mongokit (aka. Django to MongoDB) Here I'm going to explain how to combine Django and MongoDB using MongoKit and django-mongokit. MongoDB is a document store built for high speed and high concurrency with a very good redundancy story. It's an alternative to relational databases (e.g. MySQL) that is what Django is tightly coupled with in it's ORM (Object Relation Mapping)
Testing in Django¶ Automated testing is an extremely useful bug-killing tool for the modern web developer. You can use a collection of tests – a test suite – to solve, or avoid, a number of problems: When you’re writing new code, you can use tests to validate your code works as expected. When you’re refactoring or modifying old code, you can use tests to ensure your changes haven’t affected your a
Django-nonrelプロジェクトが終了した。 DjangoでリレーショナルDBではないデータベースをサポートする目的で立ち上げられたプロジェクトだ。もっぱらGAEでBigTableベースのDjangoをサポートするためのプロジェクトと言った方がただしいだろう。 GAEはバージョン1.6となり料金体制も含めて比較的大きな変更が実施された。Pythonベースも2.5から2.7へ移管し、Djangoも0.96から1.2へと変更された。今回のプロジェクト終了宣言はこれらの変更に対して追従しているさなかの出来事だった。 PythonベースのGAEに対するアプローチはいろいろとあるが、ここで再度注目が集まるのは「Kay-Framework」だろう。現在2.7への対応は進行中であり、おおよその対応は済んだようだ。 実際に私も使っているが、Djangoの移植ではなく、「GAEでDjangoライク」と
Using pdb, the Python Debugger (Django Debugging Series, Part 3) I had a couple of comments about my last post saying that I should be sending all of the screencasts to the aggregator because this is content and isn't spam. So I'm going to do that. Thanks for all the feedback everyone! Hope you're enjoying the series. Screencast 3 Setup No setup today. pdb is included with python, so everything th
Yesterday, I gave a basic overview of descriptors and what they can do, including a simple example to demonstrate one in action. That’s all well and good, but today I’ll explain how this can be genuinely useful in your apps, particularly when used in models. Storing data with a descriptor Yesterday’s example generated a new value each time it was accessed, which is really only useful in a few situ
Heroku | Cloud Application Platform Heroku と言えば Ruby/Clojure/Node ですが、 Django アプリ(というか Python アプリ)がデプロイできるようになったらしいので試してみました。 変更履歴 2011-09-21 gunicorn 対応しました github https://github.com/voluntas/heroku-template-django 環境 Mac OS X Lion でやっているので、Linux や Windows だとまた別だと思います。 必須 Git Python 2.7 Ruby (gem install heroku するためにいる) heroku にアカウントを作る というかそもそも Heroku のアカウントすら持っていなかったので、アカウント作るところから。 https://api
私はVPSと自宅LAN内でDjangoで作った個人的なwebサービスをいくつか運用しています。 現在の運用環境はapache+mod_wsgiですが、ネットで色々調べていると、nginxとgunicornとsupervisorを組み合わせるのが旬(?)のようなので、その方法について色々調べたことを書きたいと思います。 具体的には、nginxがリバースプロキシ兼Webサーバとして、キャッシュと静的ファイルの配信を担当し、gunicornがバックエンドとして動的なページ生成を担当し、supervisorがサーバプロセスの監視を行う、という構成です。 環境としては、CentOS 5.X を想定しています。 nginxのインストール CentOSにnginxをイントールする方法はこちらのページに詳しく書かれているので、それを参考にしました。configureの引数のうち、追加した方が良さそうなもの
Django 1.3ではcacheにKEY_PREFIX, VERSION, KEY_FUNCTIONというオプションが追加されていた。http://docs.djangoproject.com/en/dev/topics/cache/#cache-arguments # settings.py from django.utils.encoding import smart_str def my_make_key(key, key_prefix, version): return ':'.join([key_prefix, str(version), smart_str(key)]) # Cache CACHES = { 'default': { 'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache', 'LOCA
概要 最近、会社では、FastCGIより、Gunicornを使うのがどう?といわれました。Gunicornを触ったことない僕はFastCGIのロードテストも実際やったことなくて、メソッドについて、(preforkがいいか、threadedがいいか)の読んでいたものを元にした推測しかできない状態で、知識足りないと思った。 Gunicornは何かというと、Pythonで作られたWSGIに対応するウェブサーバーです。同期、非同期ウェブアプリ両方対応できますし、作りがよくてかなりスピーディーそうですし、Djangoアプリを簡単に組み込めますし、pythonで運用が楽というのがポイントですね。もちろん、エンドユーザーが直接Gunicornに接続するのではなく、Nginxのローダーバランサーでプロクシーのが一般的だと思っています。 テストアプリケーション ということで、ちゃんとテストしようと思いまして
昨日のリンクまとめが使いやすかったので、Djangoについてもまとめてみた。数が多いのでちょっと大変だった。 各項目の上のほうが新しい記事で下に行くほど古いです。 古い記事は、Djangoのバージョンも古いので役に立たない可能性有り。内容が酷い物もあるけど気にしない。 Tips PostGISのST_SimplifyをGeoDjangoから使う - 偏った言語信者の垂れ流し Django1.3のClass-based generic viewsを使う - 偏った言語信者の垂れ流し 3次元の座標を扱う - 偏った言語信者の垂れ流し Debianで標準のPythonを切り替えてpostgis/python-gdal周りでハマった - 偏った言語信者の垂れ流し djangoのセッションキーについて調べてた - 偏った言語信者の垂れ流し SortedDict - 偏った言語信者の垂れ流し modw
Modular search for Django More Like This Faceting Spatial Search Stored (non-indexed) fields Highlighting Spelling Suggestions Boost Search doesn't have to be hard. Haystack lets you write your search code once and choose the search engine you want it to run on. With a familiar API that should make any Djangonaut feel right at home and an architecture that allows you to swap things in and out as y
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く