summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2013-12-01 23:52:49 +0100
committerasciimoo <asciimoo@gmail.com>2013-12-01 23:52:49 +0100
commit5c8382c1ba46ddef8d58c01b7517a156b305635c (patch)
tree85805b0e1ad2e2833371a1188f0ca5105c80eda1 /searx/webapp.py
parent5351104244da929b18309fe868877fcd0a024517 (diff)
[enh] favicon added
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index deb99995e..bd1528390 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -17,10 +17,10 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
+import os
if __name__ == "__main__":
from sys import path
- from os.path import realpath, dirname
- path.append(realpath(dirname(realpath(__file__))+'/../'))
+ path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))+'/../'))
from flask import Flask, request, render_template, url_for, Response, make_response
from searx.engines import search, categories, engines, get_engines_stats
@@ -28,6 +28,8 @@ from searx import settings
import json
import cStringIO
from searx.utils import UnicodeWriter
+from flask import send_from_directory
+
app = Flask(__name__)
@@ -133,10 +135,6 @@ def index():
return resp
-@app.route('/favicon.ico', methods=['GET'])
-def fav():
- return ''
-
@app.route('/about', methods=['GET'])
def about():
global categories
@@ -172,6 +170,13 @@ def opensearch():
mimetype="application/xml")
return resp
+@app.route('/favicon.ico')
+def favicon():
+ print os.path.join(app.root_path, 'static/img'), 'asdf'
+ return send_from_directory(os.path.join(app.root_path, 'static/img'),
+ 'favicon.png', mimetype='image/vnd.microsoft.icon')
+
+
if __name__ == "__main__":
from gevent import monkey
monkey.patch_all()