As much as I enjoy building on ASP.NET MVC, it's time to move off Windows.
I'd like to switch to something Python-based with the least amount of pain.
Without discussing the merits of or reasons for switching, which Python web framework is most similar to ASP.NET MVC 3 in terms of architecture?
Architectural Examples
I'm talking about the flow, not the language.
Typical .NET Route
routes.MapRoute( // maps requests at /Product/ to ProductController
"Products", // Route name
"Product/{action}/{id}", // URL with parameters
new { controller = "Product", action = "Index", id = UrlParameter.Optional }
// Parameter defaults
);
Typical .NET controller
public class ProductController
{
public ActionResult Index(IndexInputModel inputModel)
{
// do something with inputModel ...
var viewModel = new ProductIndexViewModel()
{
Products = productList;
}
return View("~/Views/Product/Index.cshtml", viewModel);
}
// ...
}
Typical ~/Views/Product/Index.cshtml
.NET Razor View
@model ProductIndexViewModel
<h2>Products</h2>
@foreach (var product in Model.Products)
{
<h3>@product.Title</h3>
<p>@product.Description</p>
<span class="price">@product.Price</span>
}