I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| from fabric.api import * | |
| """ | |
| Base configuration | |
| """ | |
| env.project_name = '$(project)' | |
| env.database_password = '$(db_password)' | |
| env.site_media_prefix = "site_media" | |
| env.admin_media_prefix = "admin_media" | |
| env.newsapps_media_prefix = "na_media" |
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
| from geventwebsocket.handler import WebSocketHandler | |
| from gevent.pywsgi import WSGIServer | |
| from flask import Flask, request, render_template | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def index(): | |
| return render_template('index.html') |
| .idea/* | |
| *.pyc |
| test: | |
| clear | |
| nosetests --with-coverage --cover-package name_utils test_name_utils.py | |
| clean: | |
| find -regex '.*\.pyc' -exec rm {} \; | |
| find -regex '.*~' -exec rm {} \; | |
| .PHONY: test clean |
| <VirtualHost *> | |
| ServerName example.com | |
| WSGIDaemonProcess www user=max group=max threads=5 | |
| WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
| <Directory /home/max/Projekte/flask-upload> | |
| WSGIProcessGroup www | |
| WSGIApplicationGroup %{GLOBAL} | |
| Order deny,allow |
| # Answer to a question on Flask mailing list | |
| # http://librelist.com/browser//flask/2012/6/30/using-ajax-with-flask/ | |
| # NOTE: *REALLY* don't do the thing with putting the HTML in a global | |
| # variable like I have, I just wanted to keep everything in one | |
| # file for the sake of completeness of answer. | |
| # It's generally a very bad way to do things :) | |
| # | |
| from flask import (Flask, request, jsonify) | |
| app = Flask(__name__) |
| A warning occurred (42 apples) | |
| An error occurred |