[ANN]Uliweb 0.2.4 released!

limodou limodou at gmail.com
Mon Jan 13 10:33:42 CET 2014


## About Uliweb

Uliweb is a full-stacked Python based web framework. It has three main
design
goals, they are: reusability, configurability, and replaceability. All the
functionalities revolve around these goals.

This project was created and lead by Limodou <mailto:limodou at gmail.com>.


## License

Uliweb is released under BSD license.

## Change Log

* Fix ORM is not compatible with SQLAlchemy 0.9.1. Old style:

    ```
    cond = None
    cond = (Blog.c.id==5) & None
    ```

    will not right in 0.9.1, because None will not be skipped, so you can
change
    above code `cond = None` to :

    ```
    from sqlalchemy.sql import true
    cond = true()
    ```

    or

    ```
    from uliweb.orm import true
    cond = true()
    ```

* add `__contains__` to functions, so you can test if an API is already
defined, just
  use:

    ```
    'flash' in functions
    ```
* Refact generic.py, remove `functions.flash` and
`functions.get_fileserving` dependencies by default.

* Fix `yield` support in view function, you can also used in gevent
environment, for example:

    ```
    @expose('/test')
    def test():
        yield "<ul>"
        for i in range(10):
            yield "<li>%d</li>" % (i + 1)
            sleep(1)
        yield "</ul>"
    ```

* Fix `rawsql()` bug for different database engine
* Fix `jsonp()` dumps Chinese characters bug
* Add `trim_path()` function to `utils/common.py`, it can trim a file path
to
  limited length, for example:

    ```
    >>> a = '/project/apps/default/settings.ini'
    >>> trim_path(a, 30)
    '.../apps/default/settings.ini'
    ```

    Default limited length is 30.
* Add ORM connection information output when given `-v` option in command
line. And
  the password will be replace with `'*'`. For example:

    ```
    $>uliweb syncdb -v
    Connection : mysql://blog:***@localhost/blog?charset=utf8

    [default] Creating [1/1, blog] blog...EXISTED
    ```
* Add multiple apps support for `makeapp` command, so you can use :

    ```
    uliweb makeapp a b c
    ```

    to create `a`, `b`, `c` apps at once time.
* Refactor `save_file()` process, add `headers` and `convertors` parameter.

    `headers` used to create csv header instead of using column name, but
you can
    create alias name like this:

    ```
    User.c.username.label(u"Name")
    ```

    and `convertors` used to convert column value, for example:

    ```
    def name(value, data):
        """
        value is the column value
        data is the current record object
        """
        return value + 'test'
    save_file(do_(select([User.c.name])), 'test.csv',
convertors={'name':name})
    ```
* Fix `call_view()` invoke `wrap_result` bug. Missing pass `handler`
parameter to wrap_result.



## Features

* Project Organization

    * MVT(Model View Template) development model.
    * Distributed development but unified management. Uliweb organizes a
project with
        small apps. Each app can have its own configuration
file(settings.ini), template
        directory, and static directory. Existing apps can be easily
reused, but are treated as a compound.
        web application project if configured as such. Developers can also
        reference static files and templates between apps, thus easing
inter-application data exchange.
        All apps in a project are loaded by default if INSTALLED_APPS is
not configured in
        the configuration file. All separate app configuration files are
automatically processed at
        project startup.

* URL Mapping

    * Flexiable and powerful URL mapping. Uliweb uses werkzeug's routing
module.
        User can easily define a URL, which in turn can be easily bound
with a view function.
        URLs can also be created reversely according to the view function
name. It supports
        argument definitions in URLs and default URL mapping to a
        view function.

* View and Template

    * View templates can be automatically applied. If you return a dict
variable from
        view function, Uliweb will automatically try to match and apply a
template according
        to the view function name.
    * Environment execution mode. Each view function will be run in an
environment,
        which eliminates the need to write many import statements. Plus
there are already many
        objects that can be used directly, for example: request, response,
etc. This is DRY and saves a lot of coding
    * Developers can directly use Python code in a template, the Python
code does not neede to be indented
        as long as a pass statement is added at the end of each code block.
        Uliweb also supports child template inclusion and inheritance.

* ORM

    * Uliorm is the default ORM module but not configured by default.
Developers are free to use any
        ORM module as preferred.
    * Uliorm supports model creation and automatic database
migiration(table creation
        and table structure modification).

* I18n

    * Can be used in python and template files.
    * Browser language and cookie settings are supported including
automatic language switching.
    * Provides a command line tool that developers can use to extract .po
files.
        This can happen either at the app level or project level process.
It can automatically merge .pot files to existing
        .po files.

* Extension

    * Dispatch extension. This is a dispatch processing mechanism that
utilizes different
        types of dispatch points. So you can write procedures to carry out
        special processes and bind them to these dispatch points. For
example, database
        initicalization, I18n process initialization, etc.
    * middleware extension. It's similar to Djangos. You can configure it
in configuration
        files. Each middleware can process the request and response objets.
    * Special function calls in the views module initial process. If you
write a special
        function named __begin__, it'll be processed before any view
function can be processed,
        this allows developers to do some module level processing at that
point, for example:
        check the user authentication, etc.

* Command Line Tools

    * Creates project, creates apps, and include the basic essential
directory
        structure, files and code.
    * Export static files, you can export all available apps' static files
to a
        special directory. Also supports css and js combinition and
compress process.
    * Startup a development web server thats supports debugging and
autoreload.
    * Apps can also have its own command line tools. For example: orm,
auth, etc.

* Deployment

    * Supports mod_wsgi in Apache.
    * Supports uwsgi.

* Development

    * Provide a development server, and can be automatically reload when
some
        module files are modified.
    * Enhanced debugging, you can check the error traceback, template
debugging is also supported.


## Commuity

* Mailing List: http://groups.google.com/group/uliweb

## Links

* **Uliweb** Project Homepage https://github.com/limodou/uliweb
* **Uliweb-doc** Documentation Project http://github.com/limodou/uliweb-doc
* **Uliweb-doc Online** Document http://limodou.github.com/uliweb-doc/
* **plugs** Uliweb Apps Collection Project https://github.com/limodou/plugs

-- 
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou


More information about the Python-announce-list mailing list