Add Wand into requirements.txt
file, and simply import wand
.
It would just work. (See requirements.txt
in this repository.)
Created
June 20, 2012 16:57
-
-
Save dahlia/2960924 to your computer and use it in GitHub Desktop.
Using Wand on Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import environ | |
from flask import Flask | |
from wand.image import Image | |
app = Flask(__name__) | |
@app.route('/') | |
def hi(): | |
with Image(filename='iu.jpg') as i: | |
return 'width: {0}, height: {1}'.format(i.width, i.height) | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=int(environ.get('PORT', 5000))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: python app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flask | |
Wand |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment