2016年5月4日水曜日

djangae 勝手に日本語訳 - インストール

原文:
https://djangae.readthedocs.io/en/latest/installation/

Installation
ja> インストール

If you just want to get started on a fresh Django project, take a look at djangae-scaffold
ja> あなただけの新鮮なDjangoプロジェクトを始めたい場合は、djangae-scaffold を見て下さい。

Alternatively, you can also follow this guide:
ja> 代わりに、あなたはまた、このガイドに従うことができます。

1.Create a Django project, add app.yaml to the root. Make sure Django 1.7+ is in your project and importable
ja> Djangoプロジェクトを作成し、ルートディレクトリに app.yaml を追加します。Djangoの1.7以降は、プロジェクトにインポート可能であることを確認してください。

2.Install Djangae into your project, make sure it's importable (you'll likely need to manipulate the path in manage.py and wsgi.py)
ja> あなたのプロジェクトに Djangae をインストールし、インポート可能であることを確認してください。(あなたはおそらく manage.py と wsgi.py で、適切なパスを設定する必要があります。)

3.Add djangae to INSTALLED_APPS.
ja> settings.py の INSTALLED_APPS に djangae を追加します。

4.At the top of your settings.py, insert the following line to setup some default settings:
ja> settings.py の上部に、次の行を挿入します。

 from djangae.settings_base import *

In app.yaml add the following handlers:
ja> app.yaml に、以下のハンドラを追加します。

 * url: /_ah/(mapreduce|queue|warmup).*
  script: YOUR_DJANGO_APP.wsgi.application
  login: admin

 * url: /.*
  script: YOUR_DJANGO_APP.wsgi.application

Make your manage.py look something like this:
ja> このようなかんじで、manage.py を作ります。

 if __name__ == "__main__":
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
  from djangae.core.management import execute_from_command_line
  execute_from_command_line(sys.argv)

Use the Djangae WSGI handler in your wsgi.py, something like
ja> wsgi.py に、djangae WSGIハンドラを適用します。

 from django.core.wsgi import get_wsgi_application
 from djangae.wsgi import DjangaeApplication
 application = DjangaeApplication(get_wsgi_application())

Add the following to your URL handler:
ja> (urls.pyの)URLハンドラに以下を追加します。

 url(r'^_ah/', include('djangae.urls'))

It is recommended that for improved security you add
djangae.contrib.security.middleware.AppEngineSecurityMiddleware as the first of your middleware classes. This middleware patches a number of insecure parts of the Python and App Engine libraries and warns if your Django settings aren't as secure as they could be.
ja> セキュリティの向上のために、あなたのミドルウェアクラスの最初に、djangae.contrib.security.middleware.AppEngineSecurityMiddleware を追加することをお勧めします。本ミドルウェアは、PythonとApp Engineのライブラリの安全でない部品をパッチし、安全でない場合は警告を表示します。

If you wish to use the App Engine's Google Accounts-based authentication to authenticate your users, and/or you wish to use Django's permissions system with the Datastore as you DB, then see the section on Authentication.
ja> ユーザーを認証するために App Engine の Googleアカウントベースの認証を使用する場合、または、DBなどのデータストアでDjangoの権限システムを使用したい場合は、認証のセクションを参照してください。

It is highly recommended that you read the section on Unique Constraints
ja> Unique Constraints のセクションを読むことを強くお勧めします。

0 件のコメント:

コメントを投稿