python的WEB框架很多,這回又出來(lái)一個(gè)新的WEB框架:
web2py是一個(gè)開(kāi)源的全站式企業(yè)敏捷開(kāi)發(fā)框架,能夠打造安全的數據庫驅動(dòng)的WEB應用程序.它基于PYTHON,是一個(gè)很有創(chuàng )意的新型的MVC WEB開(kāi)發(fā)框架.
web2py不用安裝,不用配置,不用碰 command line,沒(méi)有其它相關(guān)依賴(lài),開(kāi)個(gè)瀏覽器就可以在線(xiàn)編程.甚至可以運行在USB驅動(dòng)器上.
web2py是一站式的解決方案,整個(gè)開(kāi)發(fā)過(guò)程都可以在游覽器上進(jìn)行,提供了WEB版的在線(xiàn)開(kāi)發(fā),HTML模版編寫(xiě),靜態(tài)文件的上傳,數據庫的編寫(xiě).其它的還有日志功能,以及一個(gè)自動(dòng)化的admin接口.
下載web2py運行后會(huì )自動(dòng)打開(kāi)一個(gè)ADMIN界面,這個(gè)界面即用來(lái)開(kāi)發(fā)web2py.可以在線(xiàn)創(chuàng )建多個(gè)web項目,并且可以把項目打包成.war,方便布署;也可以將整個(gè)項目在線(xiàn)編譯成.pyc
web2py 看起來(lái)確實(shí)相當先進(jìn)。差別只在 community 、信任度上 . 如果早一年出來(lái)可能注目度會(huì )完全不同,現在出來(lái)的話(huà)要給點(diǎn)時(shí)間
官方:
http://mdp.cti.depaul.edu/
Why web2py?
- No installation, No configuration, No console scripting, No dependencies. It even runs off a USB drive.
- Everything is done through the provided web interface (including development, debugging, testing, maintenantce, deployment, internationalization, and database administration)
- It is portable. Runs on Windows, Mac, Linux, Unix and some cellphones.
- No limitation on licensing of the applications you develop. web2py even allows you to bytecode compile them and distribute in closed-sorce format (as long they do not contain web2py source code, read the license)
- web2py prevents the most common types of vulnerabilities: Cross Site Scripting, Injection Flaws, and Malicious File Execution.
- web2py includes libraries to handle JSON, AJAX, RSS, ATOM, CSV, RTF, XML, XML-RPC, REST, and WIKI markup and can talk to SQLite, MySQL, PostgreSQL and Oracle databases.
- web2py can handle upload and download of very large files.
- web2py also works with third party python libraries. For example, it can talk to Falsh via PyAMF. Here is a tutorial.
- web2py guides the developer to follow well established software engineering patterns such as the Model-View-Controller and testing.
- web2py is really easy to use. To develop with web2py you only need to know Python (the easiest of programing languages) and HTML (compare web2py with PHP).
- web2py includes a web interafce to doctests (the python testing library) which tests functions in your application and generates real-time reports.
- web2py has an appliances repository where new free and ready to use apps are added daily.
A taste of web2py
Consider the following complete application which consists a model (which describes the data representation): db.py
1.2. | db=SQLDB('sqlite://images.db')db.define_table('image',SQLField('file','upload')) |
a controller (which describes the application logic and workflow): images_examples.py
and a view (which describes the data presenation): images_examples/index.html:
1.2.3. | {{extend 'layout.html'}}<h1>Upload page</h2>{{=form}} |
What does it do?
- Creates the database db in file 'images.db'
- Creates the table 'image' which contains a field called 'file'. If the table exists but does not match the definition it is altered accordingly.
- Creates a web-based database administrative interface for db.image
- Creates a web page called index with upload form for db.image. Try it here
- On upload the file is renamed in a secure way, saved, and the name of the file is stored in a new field db.image record.
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請
點(diǎn)擊舉報。