What are the gotchas with ColdFusion? - coldfusion

Background:
I have a new site in the design phase and am considering using ColdFusion. The Server is currently set-up with ColdFusion and Python (done for me).
It is my choice on what to use and ColdFusion seems intriguing with the tag concept. Having developed sites in PHP and Python the idea of using a new tool seems fun but I want to make sure it is as easy to use as my other two choices with things like URL beautification and scalability.
Are there any common problems with using ColdFusion in regards to scalability and speed of development?
My other choice is to use Python with WebPy or Django.

ColdFusion 9 with a good framework like Sean Cornfeld's FW/1 has plenty of performance and all the functionality of any modern web server development language. It has some great integration features like exchange server support and excel / pdf support out of the box.
Like all tools it may or may not be the right one for you but the gotchas in terms of scalability will usually be with your code, rarely the platform.
Liberally use memcached or the built in ehache in CF9, be smart about your data access strategy, intelligently chunk returned data and you will be fine performance wise.
My approach with CF lately involves using jQuery extensively for client side logic and using CF for the initial page setup and ajax calls to fill tables. That dramatically cuts down on CF specific code and forces nice logic separation. Plus it cuts the dependency on any one platform (aside from the excellent jQuery library).
To specifically answer your question, if you read the [coldfusion] tags here you will see questions are rarely on speed or scalability, it scales fine. A lot of the questions seem to be on places where CF is a fairly thin layer on another tool like Apache Axis (web services) and ExtJs (cfajax) - neither of which you need to use. You will probably need mod-rewrite or IIS rewrite to hide .cfm

Since you have both ColdFusion and Python available to you already, I would carefully consider exactly what it is you're trying to accomplish.
Do you need a gradual learning curve, newbie-friendly language (easy for someone who knows HTML to learn), great documentation, and lots of features that make normally difficult tasks easy? That sounds like a job for ColdFusion.
That said, once you get the basics of ColdFusion down, it's easy to transition into an Object Oriented approach (as others have noted, there are a plethora of MVC frameworks available: FW/1, ColdBox, Fusebox, Model-Glue, Mach-ii, Lightfront, and the list goes on...), and there are also dependency management (DI/IoC) frameworks (my favorite of which is ColdSpring, modeled after Java's Spring framework), and the ability to do Aspect-Oriented Programming, as well. Lastly, there are also several ORM frameworks (Transfer, Reactor, and DataFaucet, if you're using CF8 or earlier, or add Hibernate to the list in CF9+).
ColdFusion also plays nicely with just about everything else out there. It can load and use .Net assemblies, provides native access to Java classes, and makes creating and/or consuming web services (particularly SOAP, but REST is possible) a piece of cake. (I think it even does com/corba, if you feel like using tech from 1991...)
Unfortunately, I've got no experience with Python, so I can't speak to its strengths. Perhaps a Python developer can shed some light there.
As for url rewrting, (again, as others have noted) that's not really done in the language (though you can fudge it); to get a really nice looking URL you really need either mod_rewrite (which can be done without .htaccess, instead the rules would go into your Apache VHosts config file), or with one of the IIS URL Rewriting products.
The "fudging" I alluded to would be a url like: http://example.com/index.cfm/section/action/?search=foo -- the ".cfm" is in the URL so that the request gets handed from the web server (Apache/IIS) to the Application Server (ColdFusion). To get rid of the ".cfm" in the URL, you really do have to use a URL rewriting tool; there's no way around it.

From two years working with CF, for me the biggest gotchas are:
If you're mainly coding using tags (rather than CFScript) and formatting for readability, be prepared for your output to be filled with whitespace. Unlike other scripting languages, the whitespace between statements are actually sent to the client - so if you're looping over something 100 times and outputting the result, all the linebreaks and tabs in the loop source code will appear 100 times. There are ways around this but it's been a while - I'm sure someone on SO has asked the question before, so a quick search will give you your solution.
Related to the whitespace problem, if you're writing a script to be used with AJAX or Flash and you're trying to send xml; even a single space before the DTD can break some of the more fussy parsing engines (jQuery used to fall over like this - I don't know if it still does and flash was a nightmare). When I first did this I spent hours trying to figure out why what looked like well formed XML was causing my script to die.
The later versions aren't so bad, but I was also working on legacy systems where even quite basic functionality was lacking. Quite often you'll find you need to go hunting for a COM or Java library to do the job for you. Again, though, this is in the earlier versions.
CFAJAX was a heavy, cumbersome beast last time I checked - so don't bother, roll your own.
Other than that, I found CF to be a fun language to work with - it has its idiosyncracies like everything else, but by and large it was mostly headache free and fast to work with.
Hope this helps :)
Cheers
Iain
EDIT: Oh, and for reasons best known to Adobe, if you're running the trial version you'll get a lovely fat HTML comment before all of your output - regardless of whether or not you're actually outputting HTML. And yes, because the comment appears before your DTD, be prepared for some browsers (not looking at any one in particular!) to render it like crap. Again - perhaps they've rethought this in the new version...
EDIT#2: You also mentioned URL Rewriting - where I used to work we did this all the time - no problems. If you're running on Apache, use mod_rewrite, if you're running on IIS buy ISAPI Rewrite 3.

do yourself the favor and check out the CFWheels project. it has the url rewriting support and routes that you're looking for. also as a full stack mvc framework, it comes with it's own orm.

It's been a few years, so my information may be a little out of date, but in my experience:
Pros:
Coldfusion is easy to learn, and quick to get something up and running end-to-end.
Cons:
As with many server-side scripting languages, there is no real separation between persistence logic, business logic, and presentation. All of these are typically interwoven throughout a typical Coldfusion source file. This can mean a lot more work if you want to make changes to the database schema of a mature application, for example.
There are some disciplines that can be followed to make things a little more maintainable; "Fusebox" was one. There may be others.

Related

Development "model" for clojurescript/clojure applications

Note: I'm a backend (Java) developer by trade and work in Clojure in my spare time, so forgive me for my ignorance.
I'm trying to get my head around Clojurescript and how it could potentially fit in with projects I'm working on, or plan to work on in the future. As I've grown up with the "classic" web development mindset (e.g. Clojure running the backend, distributing data to the frontend via JSON to be processed in JS or returning a HTML page for the browser to render), I'm having trouble trying to understand how Clojurescript might make things better than this model.
Could anyone explain to me what the general approach to Clojurescript/Clojure development would be, seeing as the "Clojurescript One" project moniker signifies that application development will be unified under one language (as such)
What tasks would normally be done in the Clojurescript portion of the application?
What tasks would normally be done in the Clojure (e.g. backend) portion of the application?
Any help would be appreciated, or if anyone can point me towards some diagrams or explanations or anything - that would be great too!
I think Clojure/ClojureScript applications will be structured very similarly to X backend technology + JavaScript.
One big benefit with architecting applications with Clojure and ClojureScript - a richer data format than JSON (you can represent hash-maps and sets with arbitrary keys) without losing compactness.
JavaScript is a fine, fine language but ClojureScript offers quite a few benefits. It's semantically simpler (functional), ships with a rich standard library, a robust battle tested application library (Google Closure), and all the benefits you get from the tasteful application of syntactic abstraction via macros.
That said, it's still very much alpha software and the tooling still needs a lot of work.
A bit of background about me, I have developed with Clojurescript, JQuery, Vaadin, Servlets, JSP, and many other web technologies.
1) Clojurescript is much harder to learn than any other web technology I have used as you need, Java, Clojure, Closure (with an s ;), Closure Lib, and Closurescript specific knowledge.
2) Clojurescript doesn't make sense for a small app. It only makes sense when you will have ALOT of client side processing
3) Clojurescript's only use as far as I see is as a better javascript (which is why it is better suited to larger apps) as the minifier part of Clojurescript is available for javascript too
4) Only the client end would be written in Javascript, the server would be in Clojure/Java servlets
Maybe Ganelon micro-framework (which incidentally I am author of) will suit your needs - the execution model is similiar to Vaadin's: server-side Clojure code pushes UI updates to the browser through AJAX/JavaScript, but we don't store application state in session by default.
The demo and docs are available at http://ganelon.tomeklipski.com/
For me, clojure and clojurescript offers cleaner code than mixed stack. There is only one language to think of and code is quite easy to read.
At the backend clojure does things that java usually would do. Input validation, saving to database and above all, implementing business logic. Our backend also validates incoming / outgoing data by types using prismatic schemas.
Frontend in short: We get pretty code using ClojureScript and it is fast to write. We are using ClojureScript version of material-ui when writing UI components. We have to write less code when compared to the JavaScript and I find our UI component code to be easier to read than JavaScript counterpart. One of the main reasons is shorter closing tags and less noise by coding language. Development with ClojureScript is quite fast.
Of course ClojureScript is used for simple imput validation like RegExp for phone numbers etc.
One of the disadvantages of clojure which you have probably noticed is long lines after giving proper names to the functions. I havent found silver bullet how to cope with that.
As dnolen said: ClojureScript is still developing. It is way better now than it was 6 months ago, so you'll have to keep checking its maturity now and then.

What step would u take to refactor a ball of mud CF app into something modern and maintainable

I am going to pick up a task that no one has ever attempted to try at my workplace. It is a CF app first written using CF 2.0 (Yes, 2.0!) 10 yrs ago with > 10 cfscheduler tasks.. We explored the idea of rewriting the app, but 10 yrs of work simply can't be rewrote in 2-3 months.
What steps shall one take to modernize the app into a maintainable, extendable state? The one that I keep hearing is "write tests", but how can I write tests when it wasn't even in MVC?
Any advice would be appreciated, thanks!
p.s. I should thank Allaire, Macromedia and Adobe for keeping CF so freaking backward compatible all the way back to 2.0!
btw, what's the most modern, maintainable state for a CF app without MVC framework? or should my end goal be ultimately refactoring it into a MVC app?? I can't image how many links I will break if I do... seems impossible... thought?
update: found 2 related Q's...
https://softwareengineering.stackexchange.com/questions/6395/how-do-you-dive-into-large-code-bases
https://softwareengineering.stackexchange.com/questions/29788/how-do-you-dive-into-a-big-ball-of-mud
I am not sure if you need to move the whole site to a MVC application. Recently I did helped with an site that was not MVC, that still had a library with the Models, Services and Assemblers in a clean and organized manor. It worked great, and we didn't need to do anything more than what was necessary.
That being said, my first step would be to organize the spaghetti code into their different purposes. It may be hard to properly create the models, but at the very least you could break out the services like functions from the pages. With that done, it should be a lot cleaner already.
Then, I would try to take the repeated code and put them into custom tags. It will make the code more reusable, and easier to read.
Good Luck!
Consider, whether a full fledged framework is really necessary. In its most basic form a framework is merely highly organized code. So if procedural, that is well organized, works leave it.
Keep in mind something like FW/1 as migration path can be better than say Coldbox if you don't need all the other stuff.
Lastly, consider this I was able to migrate a 4.5 almost 70% of the way to Coldbox (very simple and really more about directory and file organization versus IOC, plugins, modules, etc...) just using a few extra lines per file plus onMissingMethod functions.
Good Luck.
I had to deal with a similar situation for about two years at my last job, however, it wasn't quite as old as yours. I think I was dealing with code from 4.0 on. There's no silver bullet here, and you'll need to be careful that you don't get too caught up in re-factoring the code and costing your company tons of money in the process. If the app works as it is rewriting it would be a pretty big wast of money.
What I did was update small chunks at a time, I wouldn't even refactor whole templates at a time, just small portions of one at a time. If I saw a particular ugly loop, or nested if statements I'd try to clean it up the best I could. If the app can be broken down into smaller modules or areas of functionality and you have the extra time you can try to clean up the code a module at a time.
A good practice I heard from the Hearding Code podcast is create a testing harness template that would use a particular cfm page that has a known output that you can re-run to make sure that it still has the same output once you've done refactoring. Its not nearly as granular as a unit test, but its something and something is almost always better than nothing, right?
I suspect that the reason this app hasn't been touched for years is because for the most part it works. So the old adage "if it ain't broken don't fix it" probably applies; However, code can always be improved :)
The first thing I'd do is switch to Application.cfc and add some good error logging. That way you may find out about things that need to be fixed, and also if you do make changes you're know if they break anything else.
The next thing I'd do is before you change any code is use selenium to create some tests - it can be used as a FireFox plugin and will record what you do. It's really good for testing legacy apps without much work on your part.
Chances are that you won't have much if any protection from SQL injection attacks so you will want to add cfqueryparam to everything!!
After that I'd be looking for duplicated code - eliminating duplicate code is going to make maintenance easier.
Good luck!
Funnily enough, I'm currently involved in converting an old CF app into an MVC3 application.
Now this isn't CF2, it was updated as recently as a year ago so all of this may not apply at all to your scenario, apologies if this is the case.
The main thing I had to do consolidate the mixed up CFQuerys and their calls into logical units of code that I could then start porting in functionality either to C# or JavaScript.
Thankfully this was a very simple application, the majority of the logic was called on a database using the DWR Ajax library; that which wasn't was mostly consolidated in a functions.cfm file.
Obviously a lot of that behavior doesn't need to be replicated as packaging up the separate components of logic (such as they were) in the CF app did map quite neatly to the various Partial Views and Editor Templates that I envisaged in the MVC application.
After that, it was simply a case of, page by page, finding out which logic was called when, what it relied upon that then finally creating a series of UML class and sequence diagrams.
Honestly though, I think I gained the most ground when I simply hit File-New Project and started trying to replicate the behavior of the app from the top of index.cfm.
I would break logical parts of the app into CFC's
Pick a single view, look at the logic within. Move that out to a CFC and invoke it.
Keep doing that you will have something much easier to work with that can be plugged into an MVC later. Its almost no work to do this, just copy and paste sections of code and call them.
You can consider using object factory to layer your application. We have similar situation at work and we started refactoring by putting Lightwire DI framework.
First we migrated all the sql statement into gateways, then we started using services and take a lot of code out of the templates to the services.
The work is not finished yet but the application is looking better already.
For large, really complex applications I'd prefer ColdBox for a re-factor project. However, I just saw a presentation at the D2W Conference on F/W 1 (Framework One), a VERY simple ColdFusion MVC framework. Check out code from the presentation here.
It's 1 (one) CFC file and a set of conventions for organizing your code. I highly recommend evaluating it for your project.

What web-CMS website language do you recommend?

I am a novice web designer who has a history of creating websites using templates and WSIWYG programs like Dreamweaver. So I know some basic html and a little flash. But that's it - I DO NOT know CSS or CMS. Mostly I'm a graphic designer. But I'm looking to learn a new web language...
I now have a client who wants me to design a website so that in the future, they can edit the website themselves. I know this is a popular trend these days in the client community. And I know this is the main purpose of web CMS. I am looking to learn a new web language but want to make sure I learn the right one.
My question is, what language do you recommend to build this website -- making it the easiest for the client to edit in the future? What language has the best/easiest interface for a NON-DESIGNER to edit a website? Another matter of note, also, is the flexibility of design creativity on my end.
Wordpress? Droopal? Joomla? I've researched a little bit about Adobe Contribute CS5 as well and thought of this also as a viable option... perhaps?
Thoughts? Suggestions?
In depth info would be awesome! Pros/cons of popular languages, common uses for popular languages (blogs, ecommerce, etc.), links to further knowledge, references, etc.
Thanks!!
Without a doubt, you should start with Wordpress.
You may take a look at this google trends comparison: https://trends.google.com/trends/explore?q=wordpress,drupal,joomla
I'm not saying is the best, but Wordpress is VERY popular, it is much simpler to begin with, and I think you'll get much more job offers.
Regarding languages and technologies, Wordpress is PHP powered, so your learning path should be:
- HTML
- CSS
- PHP
- JavaScript / jQuery
And for the future, you might start thinking on Javascript, Node, Angular and React since the internet ship is going that direction (even Wordpress)
My personal recommendation if you wanted to code fancy things would be Python and the Django web framework. However, that's probably a bit more advanced than you can currently handle.
All 3 of the frameworks you've listed are well respected. Which one you choose is really going to depend on what kind of site you're building. If you're building a site which focuses around a blog, by all means use Wordpress. You can add static elements relatively easily, but it shines for episodic content. If you're building a site that has more static "page" type content, either Drupal or Joomla are reasonable choices. I would probably lean a bit towards Drupal. If you tell us what kind of page you're building for your client, we can give you more tailored advice.
As an aside, "CMS" isn't really a language. The systems you're talking about are frameworks. PHP is the language that they happen to be written in.
You won't go wrong with any of the above options.
I would stay away from Adobe Contribute.
There are many good open source content systems such as wordpress, drupal, joomla, etc. They can be customized for your needs. Here are some tips if you want to write your own: learn soke script language like php, perl, python,etc. Php is very user-friendly and there are so much built in functions that make your life easier. You also need some database experience - mysql, postgre, etc. Creating your own cms is a good way to learn a concept, so good luck.
I would definitely start with learning HTML 4 (and 5) and CSS.
For a server side language there are several options. Perhaps PHP is the easiest to start with.
WordPress is a very powerful framework. Joomla is even bigger. It totally depends on the requirements. But if you want to use a framework like Joomla, Drupal, or WordPress, PHP is probably the best language to study. Personally I'd prefer ASP.NET, but that's mostly because I'm already familiar with that framework. I like PHP as well, but it always feels like ASP.NET is more mature. But that's my personal opinion!
Take a look at the features of WordPress, Joomla, Drupal, that's the best advice I can give. You've got the requirements for the website so, after a short study, you are the only one who can make a good decision.

Some Developer Advice

I am currently working on a program that I really think is a good idea (at least I sure hope it is). For the program I am building I am using (after some very long consideration) ColdFusion - Flex - Adobe Air. However, I have to learn ColdFusion to do this.
I am an independent developer that for the most part uses PHP to build my client's websites. Since I plan on learning ColdFusion to build this program, do you guys have any advice on how I can use ColdFusion elsewhere. It is not very exciting to think that I am learning this language for just one thing.
I don't plan on bulding Coca-Cola's lastest greatest website anytime soon, but I (for some odd reason) enjoy coding and was just wondering if you guys had any advice on any smaller-time avenues that one could persue??
Any advice would be greatly appreciated! :)
Cliff notes: I'm an independent PHP developer learning ColdFusion for a client. Its not exciting to learn a language which I will never use again. Where can I apply ColdFusion in the future?
You can use ColdFusion to build any webapp you could build with PHP. I've seen a few articles lately with comments from PHP developers switching to ColdFusion. This one was posted today, and lists some pros and cons of switching to ColdFusion.
http://blog.rubicon.je/2009/09/coldfusion-half-a-year-away/
I wouldn't consider it an either/or proposition though. If you want to learn CF for your AIR app, it will absolutely come in handy for something else down the road, even if you don't plan for that. Knowing more than one (or three) languages is always beneficial, as it gives you additional insight into other ways to solve problems.
Dan
ColdFusion or CFML the language is a tool, like any other you might add to your toolkit. As developers I personally feel we choose choose the best tool for the job. That said having another tool available will invariably come in handy down the road rather you write another CFML application or not. General solid programming advice is to try and learn at least one new language a year.
CFML is easy to learn, yet also provides for advanced development, which is why many choose to go with it. I came from a PHP/Perl background and picked it up in a couple weeks. If you are comfortable programming once you get the syntax down you can use to it do anything you can do with PHP. I wrote at length on the comparison in this answer.
Further lengthy Question/Answers to the viability/use of ColdFusion:
Is ColdFusion a good choice for web development?
What is the status of ColdFusion today?
I know you didn't ask about comparisons, you have made your decision. For building Flex/AIR apps with a data back-end imho ColdFusion or BlazeDs is the way to go. ColdFusion allows you to hook up the power of java to serve data with the easy of a scripting language. With that starting point you have your foot in the Java platform which is tremendously powerful and extensive. You can invoke interact with the Java layer and harness that power. Many will make the leap to Java or a more "friendly" JVM language like Groovy or JRuby.
do you guys have any advice on how I can use ColdFusion elsewhere.
slidesix is a recent example of an interesting use of ColdFusion. NASDAQ built Flex/AIR market replay application. Also you can check Ben Forta's site for more sites running ColdFusion to get some ideas.
But I think you already hit the nail on the head with Flex/AIR apps if you plan on making more, much of what Adobe does is work to make integration with their technologies as seamless as possible. Honestly that alone has been what has excited me most about using CFML and the recent addition of open source alternatives in Railo/BlazeDs I have been building Flex apps powered by Railo/BlazeDs without paying a dime to Adobe.
I guess the bottom line is that the Java platform (via CFML) and the Flash Platform (via Flex Framework ) are both not going anywhere any time soon, and for that matter neither is PHP so I think you will have a solid set of skill from which to build on either way you go.
ColdFusion is huge in Government, both at the Federal and State level. I moved to the D.C. area in large part because of the number CF jobs available around here.
So, you could always use it for gainful employment.
Update: Some links as requested
Ben Forta's list of sites using ColdFusion, Government category
Who uses ColdFusion - a list of ColdFusion development shops
GotCFM?com - a list of sites using ColdFusion; lots of government sites there (look under "N"; the "Government" category isn't fleshed out)
Adobe.com - abridged list of customers, some with links to case studies
Monster.com search "coldfusion" in Washington, DC
Dice.com search "coldfusion" in Washington, DC
You can get a basic reading of what people are paying for via (shudder) RentACoder: http://www.google.com/search?q=coldfusion+site%3Arentacoder.com
You can use coldfusion everywhere and as much as you like in PHP. There's enough free engines (Railo, Smith, OpenBlueDragon) that you can load into Tomcat instances, or use something like stax to put a coldfusion app into the cloud.
How far you do or don't go is up to you. I find that I write about 1/2 the code in coldfusion that I do in PHP. Maybe it's syntax that I feel less, I don't know.
But build your first project, I think the dots to connect will become apparent on their own

Web Application Frameworks: C++ vs Python

I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.
Some things I'm looking for:
It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.
I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).
Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
I would go with Wt because:
You already know C++
It has a nice layout system, so you don't need to know lots of HTML
It is very well written and a pleasure to code in
Your deployed apps will handle 50 times the load of the python app on less hardware (from experience with pylons apps, 10,000 times the load of a plone app :P)
It has all the libraries that the guy in the first question says it doesn't and more
In built development webserver
Templating language
ORM
unit testing help
open-id and user+password authentication
A brilliant widget library
Web 2.0 isn't an after thought; it wasn't designed on a Request+Response model like all the python frameworks (as far as I know), but on an event driven interactive model.
It uses WebSockets if available
Falls back to normal ajax gracefully if not
Falls back to http for browsers like linx
It is more like coding a gui app than a web app, which is probably what you're used to
It is statically typed and therefore less error prone. Does def delete(id): take an int or a string ?
The unit tests (on my apps at least) take 10-100 times less time than my python app unit tests to run (including the compile time)
It has a strong and friendly community. All my email list posts are answered in 0-3 days.
If you'd like to avoid writing HTML, you could try GWT. However, in my experience, using an intermediate framework to generate HTML and ECMAScript never works anywhere near as well as hand-writing the pages.
[edit] nikow mentions in the comments that Pyjamas is a port of GWT to Python.
Regarding the language, if given the choice between C++ and Python I would pick Python 100% of the time. Even ignoring the obvious difference in abstraction between those languages, Python simply has more useful libraries than C++. You don't have to write your own development-oriented web server -- Django comes with one. You don't need to write a custom template library -- Python has Genshi. Django comes with a capable ORM layer, or for even more control you can use SQLAlchemy. It's barely a contest.
Django is good point to start web development it is great framework
If you look for C++ take a look on CppCMS, it is much more close to Django, it is not like Wt that mimics Qt.
In any case, it is really depends on your needs. C++ can be used for embedded or high performance web applications, but for medium range web sites Django would be better. (and I'm developer of CppCMS)
I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it.
wt was a good idea design, but somehow not that suitable.
If you are exploring Python frameworks (based on the excepted answer I think you are) I think you really owe it to yourself to check out CherryPy. When you write CherryPy apps, you really are just writing Python apps. The framework gets out of your way in a real hurry. Your free to choose your own templating, ORM (if you choose to use ORM), etc. Seriously, take 10 or 20 minutes and give it a look.
The only reason you might want to use C++ over Python is when speed is paramount.
If this is going to be your first web-app, you'll probably be ok with just Python, and your development speed will be orders of magnitude better than with CPP.
Django's templating language is far from powerless, to me it actually seems very pythonic. You actually can write pure python in a template(although this is generally not recommended).
Even better, it's possible to replace Django's templating system with the one you like.
My personal favourite language for this is HAML.
Here's some data on this:
Is there a HAML implementation for use with Python and Django
Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of "ruby on rails" and easy to learn.