1

i'm developing a web site hosted on AppEngine and wanted to use Django for some tasks. I've read these two answers:

Django on Google App Engine Django and App Engine

But those are pretty old, and my question is a little more specific. I've taken a look at django-nonrel and seems good, but i've not used it and cant affirm anything.

So, the question is. Can I use the Admin site and the forms from Django with this package? If not, do you know any other patch that allow me to use them?

Thank you very much!

Community
  • 1
  • 1
santiagobasulto
  • 11,320
  • 11
  • 64
  • 88

2 Answers2

2

If you use django-nonrel, then you can use the Django admin site but it will be limited to the types of queries you can do on app engine. I personally found it easier to code my own simple admin interfaces that to type to make things work in Django Admin.

Regarding forms, regular Django Forms and ModelForms work quite well.

cope360
  • 6,195
  • 2
  • 20
  • 33
  • Thank you for your answer. Would you recommend Django non-rel then? – santiagobasulto Aug 20 '11 at 18:18
  • If you want to use Django on GAE, then yes I would recommend it but it is not going to be a easy as using Django on a normal RDBMS. You can also just use parts of Django on GAE (like forms and templates, for example) and then you don't have to deal with as many GAE-Django quirks. – cope360 Aug 20 '11 at 18:26
  • What are the differences? I mean, what else would non-rel involve? – santiagobasulto Aug 20 '11 at 18:27
  • All the parts of Django that are not forms and templates, for example: ORM, views, dispatching, sessions, etc. – cope360 Aug 20 '11 at 18:32
  • I see. What about authentication? – santiagobasulto Aug 20 '11 at 18:41
  • I use authentication and sessions and they work fine but for permissions I don't use any custom permissions. I don't think those work on nonrel without doing a patch (it's a many-to-many relationship). – cope360 Aug 20 '11 at 18:48
  • @cope360 - if you add the proper indexes using dbindexer you can get pretty much all the same query types you're used to in django. There's still a few quirks like you mention though when it comes to ordering by multiple items and a couple other things – Aaron Aug 22 '11 at 12:43
2

Yes, you can (both Admin and forms).

(definitely) :)

I installed djangoappengine 3 months ago and work on it daily under Eclipse (Windows).

If you have some expericence with Django it should be easy, I faced much more problems with Eclipse integration, but nothing unfeseable (even for a newbie - as I'm still).

You just have to start from here:

http://www.allbuttonspressed.com/projects/djangoappengine#installation

Be careful anyway: there are some limitations due to the Datastore capabilities.

A lot of work has been done to circumvent them (dbindexer, specifics decorators...) and if you're planning to develop an app from scratch you will find your way (keeping " noSQL " in mind) but if you plan to migrate a plain vanilla SQL app, it may cause you some pain...

Last point: instances handling Django and all its libraries may be long to start with App Engine ; an issue to consider:

http://code.google.com/p/googleappengine/issues/detail?id=1695

Hope it helps.

Florent

Florent
  • 41
  • 2
  • Thank you for your help. Could you make Authentication work? (not the google accounts authentication) – santiagobasulto Aug 20 '11 at 18:42
  • Yes, straight forward by: - adding django.contrib.auth in the INSTALLED_APPS - addind some kind of (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}), in the urls.py - and " protecting " views with a @login_required(login_url='/login/') decorator. You could find the doc here: https://docs.djangoproject.com/en/dev/topics/auth/ Sessions work also perfectly. – Florent Aug 21 '11 at 22:34
  • Great! All this using Django nonrel? – santiagobasulto Aug 22 '11 at 19:16
  • Yes really. :) There's much more to say, but, at this point, I suggest you to just follow the doc and try it by yourself. It does have limitations (perheaps more than I can say, because I never used Django in another environment) but, as far as I'm concern, benefits bring by the framework (compare to WebApp - the AppEgine default) worth the time you'll have to invest. – Florent Aug 22 '11 at 22:55