wheezy.web is a lightweight, high performance, high concurrency WSGI web framework with the key features to
build modern, efficient web. Here we will use an empty project quick start to build a new project.
-
Download quickstart-empty.zip and extract.
-
Rename extracted directory `quickstart-empty` to meet your project name, e.g. mysite and open terminal in that directory.
The empty project quick start comes with Makefile with several handy targets. Setup development environment:
make env
Let run test, look at coverage and finally benchmark tests:
$ make test nose-cover benchmark
....................................
..........
Name Stmts Miss Cover Missing
--------------------------------------------------
public 3 0 100%
public.web 0 0 100%
public.web.profile 5 0 100%
public.web.urls 10 0 100%
public.web.views 20 0 100%
--------------------------------------------------
TOTAL 38 0 100%
--------------------------------------------------
Ran 10 tests in 0.423s
OK
public: 5 x 1000
baseline throughput change target
100.0% 5041rps +0.0% test_root
81.3% 4097rps -18.7% test_home
99.4% 5008rps -0.6% test_error_400
100.3% 5055rps +0.3% test_error_403
98.7% 4975rps -1.3% test_error_404
static: 3 x 1000
baseline throughput change target
100.0% 4846rps +0.0% test_static_files
49.8% 2415rps -50.2% test_static_file_not_found
55.0% 2663rps -45.0% test_static_file_forbidden
-----------------------------------------------------
Ran 2 tests in 2.375s
OK
The tests are passed let run it in web browser:
$ make run
Visit http://localhost:8080/
Alternatively you can run it using uwsgi
env/bin/easy_install uwsgi
make uwsgi
Enjoy!
Awesome. I could have used this weeks ago when I was trying to hobble together something like that for starting with but it had way less features :) I'll probably change my current website to use this, I like the way you have everything laid out.
ReplyDeleteps. What is your thinking for the public/web structure? Is that so you could add public/api, private/web, private/api, etc if needed?
Thank you. I will add another quick start with i18n support shortly.
DeleteTypically any project can be split into several business areas, e.g. public (contact us, feedback, etc), membership (work with user profile and settings), funds, messages, etc. These areas perfectly map to python packages. Thus at the level where you see `public` package, there are those areas setup, then each area is layered `technically`: models, validation, repository, service and web. As an example you can take a look here:
https://bitbucket.org/akorn/wheezy.web/src/tip/demos/template/src/membership
Hi, nice work!
ReplyDeleteHow do you build the benchmark test?
Take a look at `benchmark` make target and unit test located at src/public/web/tests/benchmark_views.py
Delete