Skip to main content

MVC Web Application Framework with Tornado.

Project description

# dp-tornado

MVC Web Application Framework with Tornado, Python 2 and 3

To install the package run:

pip install dp-tornado


## Run

# -*- coding: utf-8 -*-


import os

from dp_tornado import Bootstrap

kwargs = {
'initialize': True, # If this value specified True, create default directories and files.
'application_path': os.path.join(os.path.dirname(os.path.realpath(__file__))),
'scheduler': [
('* * * * *', 'scheduler.foo')
]
}

bootstrap = Bootstrap()
bootstrap.run(**kwargs)


## Requisites

- [Python 3.x](https://www.python.org)
- [Python 2.7](https://www.python.org)
- [Minifier](https://www.npmjs.com/package/minifier) Minify CSS, Javascript


## Dependencies

* [tornado](http://www.tornadoweb.org) Network Library
* [SQLAlchemy](http://www.sqlalchemy.org) Model Implementation
* [redis](https://github.com/andymccurdy/redis-py) Redis Cache
* [Croniter](https://pypi.python.org/pypi/croniter/) Scheduler
* [Boto](http://docs.pythonboto.org) AWS Helper
* [Requests](http://docs.python-requests.org) HTTP Reuqest


### Deployment

**NGINX Configuration**

upstream dp_proxy {
server 127.0.0.1:8080;
}

server {
listen 80;
server_name dp_for_tornado;

client_max_body_size 50M;

rewrite ^/s/(.*)$ /static/$1 last;

location ~ /\. { deny all; }

location ~ /pp_(?:40[345]|5xx)[.]html$ {
root /data/dist/prepared-pages/;
}

location ^~ /s/ {
access_log off;
log_not_found off;
expires max;

add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";

root /data/dist/dp-tornado/;
}

location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Proxy-Prefix '/foo/';
proxy_pass http://dp_proxy/foo/;
}

error_page 403 /pp_403.html;
error_page 404 /pp_404.html;
error_page 405 /pp_405.html;
error_page 500 501 502 503 504 /pp_5xx.html;
}

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dp-tornado-0.1.9.tar.gz (38.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page