Google App EngineでDjango-nonrelを使ってみる。
Google App EngineでDjango-nonrelを使ってみます。
参考
joinwithjack: django-nonrel on GAE
django-nonrelのインストールします。
hgコマンドでソースファイルを取得して、projectのディレクトリにシムリンクをはります。
hg clone http://bitbucket.org/wkornewald/django-testapp hg clone http://bitbucket.org/wkornewald/djangoappengine hg clone http://bitbucket.org/wkornewald/djangotoolbox hg clone http://bitbucket.org/wkornewald/django-nonrel
Google App Engineに新規アプリを作成します。
app.yamlファイルを編集します。
- ctst -> 新規アプリ名
ローカルでテストします。
./manage.py createsuperuser ./manage.py syncdb ./manage.py runserver
デプロイします。
./manage.py deploy
GAEで確認します。
http://
Admin画面の準備をします。
vi app.yaml --- builtins: - remote_api: on - datastore_admin: on <- 追加 --- ./manage.py remote createsuperuser vi urls.py --- from django.views.generic.simple import direct_to_template from django.contrib import admin admin.autodiscover() handler500 = 'djangotoolbox.errorviews.server_error' urlpatterns = patterns('', ('^_ah/warmup$', 'djangoappengine.views.warmup'), (r'^admin/', include(admin.site.urls)), # Enabling Admin ('^$', direct_to_template,{'template': 'home.html'}), ) --- ./manage.py syncdb ./mange.py runserver http://localhost:8000/admin ./mange.py deploy http://<Urappid>.appspot.com/admin