forked from dimagi/couchforms
-
Notifications
You must be signed in to change notification settings - Fork 0
XForms processing engine in django and couchdb
wbnigeria/couchforms
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Put XForms in couchdb! To include this in a django project you need the following settings defined in your settings.py ####### Couch Forms & Couch DB Kit Settings ####### COUCH_SERVER_ROOT = 'localhost:5984' COUCH_USERNAME = '' COUCH_PASSWORD = '' COUCH_DATABASE_NAME = 'database_name' # you may want to import localsettings here so the variables above can be overridden def get_server_url(server_root, username, password): if username and password: return "http://%(user)s:%(pass)s@%(server)s" % \ {"user": username, "pass": password, "server": server_root } else: return "http://%(server)s" % {"server": server_root } COUCH_SERVER = get_server_url(COUCH_SERVER_ROOT, COUCH_USERNAME, COUCH_PASSWORD) COUCH_DATABASE = "%(server)s/%(database)s" % {"server": COUCH_SERVER, "database": COUCH_DATABASE_NAME } XFORMS_POST_URL = "http://%s/%s/_design/couchforms/_update/xform/" % (COUCH_SERVER_ROOT, COUCH_DATABASE_NAME) COUCHDB_DATABASES = [(app_label, COUCH_DATABASE) for app_label in [ 'couchforms', ] ] ### end settings.py ### In order to put up a couchforms url that can receive POSTs, add the following line to urls.py: # ... (r'desired/url/$', 'couchforms.views.post'), # ... In order to test whether this is working, you can send a filled out xform submission (saved at ./sub.xml) for the command line with curl as follows: $ curl -X POST http://localhost:8000/desired/url/ -d @sub.xml
About
XForms processing engine in django and couchdb
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published