views:

171

answers:

5

I am completing my first database project which aims to build a simple discussion site.

The answers which I got at Superuser suggests me that Python is difficult to use in building a database webapp without any other tools.

Which other tools would you use?

+2  A: 

Many people would recommend SQLAlchemy.

Martin v. Löwis
+1  A: 

ORM is not same as templating. Since you want to write your own sql queries and at the same time want to write clean python code, i would suggest you look at web.py. I have used web.py and i must say its really simple and to the point.It has its own templating engine, but you can use a different one too.

If you would like to use ORM you can use SQLAlchemy or SQLObject they seem to be quite popular.

Amit
+4  A: 

Sorry, your question makes no sense.

  1. You say you can't use Django because you have to write your SQL queries yourself. Firstly, why do you have to? And secondly, Django certainly doesn't stop you.

  2. Even though you say you want to write your SQL queries yourself, you then ask what ORM is best. An ORM replaces the need to write SQL, that's the whole point. If you can't use Django for that reason, SQLAlchemy won't help.

Daniel Roseman
+2  A: 

Your question is very strange.

First, Django doesn't force you to use its SQL abstraction. Each part of Django can be use idenpendently of the others. You can use Django together with any other SQL library.

Second, if you need to build your own SQL queries, an ORM is the opposite of what you need.

vog
+2  A: 

There are many other options other than Django. However:

You can make your own SQL queries in Django. Here is the documentation for extra(). extra() lets you make extra SQL calls on top of the ORM.

If you want to make raw SQL queries, bypassing the ORM entirely, you can do so with django.db. See this article for examples.

That said, other options aside from Django if you still want to use a framework:

  • Turbogears
  • Pylons
  • Web2Py
  • Zope3
  • Plone/Zop2

See this list for a listing of more frameworks.

Now, if you don't want to use a ORM and just want o make SQL calls directly, Python also has the ability to interact with a database. See this page on the Python wiki.

thedz
extra() is not the right tool for making arbitrary SQL calls. If you want to bypass the ORM completely, do it via `cursor.execute`.
Daniel Roseman
Right -- that's what I said in the third paragraph. Extra() let's you filter with custom SQL on top of the ORM.
thedz