views:

212

answers:

4

django.forms is very nice, and does almost exactly what I want to do on my current project, but unfortunately, Google App Engine makes most of the rest of Django unusable, and so packing it along with the app seems kind of silly.

I've also discovered FormAlchemy, which is an SQLAlchemy analog to Django forms, and I intend to explore that fully, but it's relationship with SQLAlchemy suggests that it may also give me some trouble.

Is there any HTML Forms processing library for python that I haven't considered?

+1  A: 

Is there a more specific reason you don't want to use django.forms? I've quite successfully used bits and pieces of django all by themselves without trouble in several projects.

As an aside, there are several patches that make django sortof work in app-engine, though I assume you've considered and discarded them.

Paul McMillan
I'm not rejecting django-forms exactly, but my need for it is narrow enough that it makes sense to me to really consider the options, if I have any. If none of the solutions are at least as simple as django for hand-made forms, then that's what I intend to use.
TokenMacGuy
+8  A: 

I've grown to love WTForms, it's simple, straightforward, and very flexible. It's part of my django-free web stack.

It's completely standalone, and carries over the good parts of django's form libraries, while imho having some things much better.

Bryan McLemore
Ah, this might be just the thing! +1 very informative
TokenMacGuy
It looks so close to Django Forms :)
Natim
@Bryan Mclemore - what are the rest of the elements to your Django-free web stack, if you don't mind? I've been curious to see what peeps out there are using, and I've looked at Flask, but it seems inherently limited for larger applications.
orokusaki
+1  A: 

You can also have a look at formencode, it is generic enough so that you may fit it in GAE.

Anurag Uniyal
this one is different enough from django to be quite interesting. +1
TokenMacGuy
+3  A: 

I'm not sure what you mean by "making most of the rest of Django unusable" and especially by "packing it along with the app". Are you familiar with the docs? If you just do as they suggest, i.e.

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from google.appengine.dist import use_library
use_library('django', '1.1')

don't django.forms and the rest of Django work for you (once you upload your app to Google)?

As the docs also explain,

Django versions 1.0 are later are not included in the SDK. To test your app with a newer version of Django on your computer, you must download and install Django from the Django website.

but

You do not need to add the newer Django library to your application directory.

i.e. you don't have to "pack it along"; it's already made available on Google's servers by Google to your app engine application. (A few third-party apps that depend on relational features, admin especially, don't work -- but your own Django app, written using he App Engine data modeling libraries, will be fine!-).

Alex Martelli