Like others have mentioned, Django is popular.
Another that I've used is web2py, which is really easy to set up and get into. I have it running on nginx right now actually. I used this script. Also, it uses python both as the server-side language and in the templates. The latter cannot be said of Django.
And if that's not enough, there's always the huge list on the python wiki.
Hi, to kill the Flask VS Django war I like to show ImportD: it is as minimal as Flask to get started quickly with no fuss, but it's Django under the hood (and you can use it as any Django project if you wish).
Web2py has a nice ORM and a very nice admin interface too (with which you can deploy and manage websites) http://www.web2py.com/ (I have no experience with it).
After a few minutes on the docs book, I'd say something like this:
rows = db(db.Employee.eName==&var_from_view).select(db.Employee.job, db.Employee.address, db.Employee.phNum)
Brief explanation: apparently the where clause is applied to the db object through the call method:
db(db.Employee.eName==&var_from_view)
Then you apply the select statement on the above:
select(db.Employee.job, db.Employee.address, db.Employee.phNum)
Now serialize it and return the results.
From this section: http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#select
Take a look at web2py too.
And this quick example might be relevant to your database structure.
Web2py can be run as a standalone server. It comes with built in SQLite2 and webserver. It's written in Python and also can easily hook into most main databases out there with minimal code change. Lots of built-in security and ease-of-use features.
what if we want the fast start up of Flask with all the power built-in in Django ? We can use ImportD http://importd.readthedocs.org/en/latest/ (the D is for Django)
Theres also web2py, with its own ORM and dashboard, that allows remote code editing and more http://www.web2py.com/
There's Pyramid, etc…
I would like to recommend web2py as well. It's small and has batteries included. I like its use of DAL vs ORM, (I guess cause I like my SQL looking more like SQL than python objects but that's just me). Also the book is pretty good and has a good example of a blog application. One day I'll quit being lazy and get back to making my Cloud Databases webapp. Anyways, happy hacking!
I'd advise getting to know HTML/CSS/JS before you dive into something more back end oriented. If you've decided to learn web development, knowledge of the front end technologies is essential (at least basics / intermediate stuff).
If you have to decided to use Django, it's perfectly fine. However, there are some pretty good alternatives such as web2py or web.py. They're more lightweight, but still have all the features of a proper framework. The latter was created by Aaron Swartz - you probably have heard the name (closely tied to the development of Reddit).
>My greatest concern from what I have heard is the templating engine is designed for certain things and isn't as flexible as PHP's.
Are you referring specifically to the Django templating engine? I've heard some (I think usually minor) complaints about its limitations, though given the way the framework works, I suspect you won't generally have any problems with it.
Of course, you've got lots of other options to choose from -- check out this overview and listing of Python web frameworks. There are a number of different templating engines available, including some that let you use pure Python in your templates (e.g., web2py, pyTenjin).
You're right. It's probably not a big differentiator. But it's helpful to new folks, and it can be a nice convenience at times even for experienced users, and even when working on a "full blown enterprisey app" (though you would likely do most of your editing in a standalone editor or IDE). It also includes an error ticketing system. Actually, you can check out a demo.
Anyway, I don't think anyone is touting it as web2py's killer feature. I think one of web2py's main goals is ease of use, and this just makes life a little easier.
Also, note that the IDE is itself simply a web2py application (like any application), so it's easy enough to simply delete it or ignore it if you don't want to use it. It is not integral to the framework at all.
Personally I don't think there's such a thing as 'learn faster'. You need to do it at your pace and not get frustrated, or like most people you'll burn out. If you're 'just not getting' certain concepts, then you should relax, as the more immersed you are in programming the more they will make sense, at four months you are (likely) only touching the surface.
It took years of bad, sloppy, linear coding before I understood OOP, and then it was probably another year until I was using them in my code effectively, but that's me.
Still if you're looking for resources and want to keep to Python, the only thing I could suggest is working with development frameworks that require an object-oriented structure. Being a web developer and mostly using PHP, my resources for suggestions are limited, but web2py is one available that would do this. Lots of video tutorials out there for it too.
Good to know it works on 3.x... why do they advise to run it from 2.7 then ? (http://www.web2py.com/init/default/download).
Web2py got me started on python web dev back in the day, and I'm sure it did for many others... I never understood the hate.
To learn web dev, I recommend it because Flask has less buit-in tools. There's also importd (D is for Django) that is like Flask (quick setup) in Django. Or web2py, or others…
> >web2py
> What is this exactly?
web2py is a full stack web framework in python. It's designed to do as much of the work as possible for you, by adding layers of abstraction to handle the grunt work. If you have any experience with python, IMO it's the easiest and fastest in terms of going from nothing to website. I made a text-based dungeoncrawling RPG site (which is far from polished) in web2py, if you want to take a look.
That's what I thought too. The docs says "sort the records according to multiple fields", so I think you're right. I submitted an issue. Thanks! orderby in the official docs
These are good options. You have others :) Want to have the best of Flask and Python together ? I think ImportD is worth a look: http://importd.readthedocs.org/en/latest/ it is pure Django, but minimalistic like Flask.
web2py has an awesome online manager http://www.web2py.com/
And you didn't ask about a frontend framework, but you should consider picking one if you want more than static pages.
>and you have to use a custom executable to run the server and can't just use "python whatever.py".
False.
http://www.web2py.com/books/default/chapter/29/03/overview
If you are working with the source distribution of web2py (which I reccomend regardless of your platform) its just:
python web2py.py
There is also an anyserver.py file to help you run your web2py app in any wsgi application container.
No imports for any of the framework builtins is more magic than most frameworks I agree. When you start writing your own modules or using pip ones standard import rules apply.
Well since you are just trying to throw and interface for simple CRUD operations up, you can't go wrong with web2py.
They have everything you need pretty much built in for connecting to MSSQL server and displaying the stuff back on a webpage with a login in front.
Also they have a built in IDE and debugger to help with development.
Their documentation is pretty great as well.
For the mobile app you will want to expose a REST interface to let the mobile app just consume the data. web2py as added an easy to use feature to get a rest API for free.
Good luck and if you have any questions or need help feel free to reply or PM me.
Why would you use SQL CE?? Particularly for a web site/service?
Firstly it seems that DB has no ODBC drivers making hooking up to it a total pita from Python, PHP etc.
I would seriously suggest you look at sqlite instead. If that's not enough postgres/maria/ms sql are all viable alternatives.
If you have no idea what you are doing, start with web2py . It has everything you need to build your application as well as lots of documentation to get started. Also can easily connect to many databases as well. The MVC concepts are solid and useful in other stacks as well.
>I would say the most confusing thing about the database abstraction layer is the distinction between Set, Row, and Rows. I end up a lot of the time doing things to a Set that I should be doing to a Row or Rows object and vice versa. Python's dynamic typing makes this problem worse.
Perhaps this could be better explained, though this is the nature of object oriented programming and enables a lot of functionality. What alternative would you propose that would be easier to understand (without a significant sacrifice in functionality)?
>In the view you can mix javascript and python, and I think this can make the code into a mess if you are not careful.
Are you complaining about web framework template engines in general, or web2py in particular? This doesn't sound specific to web2py. Are you aware of a web framework that handles this better in your opinion?
> By source code documentation, I mean http://www.web2py.com/examples/static/epydoc/index.html
Yes, I agree, the source code could be better documented (it's good in some places, not so good in others).
let me say first that I come from a C/C++/Matlab background so pretty much everything is new for me.
I would say the most confusing thing about the database abstraction layer is the distinction between Set, Row, and Rows. I end up a lot of the time doing things to a Set that I should be doing to a Row or Rows object and vice versa. Python's dynamic typing makes this problem worse.
In the view you can mix javascript and python, and I think this can make the code into a mess if you are not careful. Especially for a beginner like myself, I'm not sure whether I should be using javascript or python to be performing a particular task. So I generally end up trying to combine the two to perform one operation , and it turns into a hideous spaghetti code that comprise of html, javascript, and python. I am now starting to understand javascript better so I'm using less and less python in the view.
Eventually in the view, I would just like to have a section of the code that loads all the necessary python variables from the controller into javascript variables so that I can minimize the mixing of python and javascript.
By source code documentation, I mean http://www.web2py.com/examples/static/epydoc/index.html
Sounds like you need a web framework.
I'm using web2py - it has a nice Database Abstraction Layer, which saves you from having to know SQL (mostly, anyhow - and the option's there if you want to). It is also trivially easy to connect, transfer, and just use, a large range of databases, with rarely (if any) change to your code (beyond your connection data).