use with django

2 views
Skip to first unread message

Mike

unread,
Dec 3, 2008, 6:53:14 PM12/3/08
to Appengine Admin Users

I am using django on GAE (with django-patch). Just wondering whether
appengine admin can be used with this setup. Since the admin is based
on webapp I presume that this would be difficult.

Valts Mazurs

unread,
Dec 3, 2008, 7:25:52 PM12/3/08
to appengine-...@googlegroups.com
Hello,

Do you mean Google App Engine Helper for Django (http://code.google.com/p/google-app-engine-django/)?

If yes, I assume that there should not be any serious problems with using this helper together with Appengine Admin. appengine_django.models.BaseModel is derived from google.appengine.ext.db.Model. Model attribute definiton also is the same as for usual GAE application.
The only issue could be different URL and view definition patterns between webapp and Django. But it is easy to get around it.

Add specific handler for admin urls in app.yaml:
===
- url: /admin/.*
  script: admin_urls.py
===

Create file admin_urls.py:
===
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

import admin
import appengine_admin

application = webapp.WSGIApplication([
        # Admin pages
        (r'^(/admin)(.*)$', appengine_admin.Admin),
    ], debug = True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()
===

I found also http://code.google.com/p/app-engine-patch/
The instructions above should apply also if you are using this project as app-engine-patch does not touch models at all.

Best regards,
--
Valts

Mike

unread,
Dec 4, 2008, 12:10:47 AM12/4/08
to Appengine Admin Users
Thanks for the reply. I meant appengine-patch not django-patch. I
tried adding a separate handler in app.yaml, but the running
WSGIApplication seems to conflict with the way that the django
application runs. It resulted in problems importing libraries and
finding properties in the django code. It may have something to do
with the way I start the local server with the django commands
manage.py -runserver. It may work when I upload the application.
> I found alsohttp://code.google.com/p/app-engine-patch/
> The instructions above should apply also if you are using this project as
> app-engine-patch does not touch models at all.
>
> Best regards,
> --
> Valts
>

Valts Mazurs

unread,
Dec 5, 2008, 10:07:42 AM12/5/08
to appengine-...@googlegroups.com
Could you, please, post some code sample that causes the error?
Full error message with backtrace would be also very helpful.

Thanks in advance,
--
Valts
Reply all
Reply to author
Forward
0 new messages