Browse Source

update makefile and ini file for uwsgi

master
wes 9 years ago
parent
commit
6a7e9be30c
  1. 5
      Makefile
  2. 15
      search.ini
  3. 2
      src/scripts/search.js
  4. 2
      src/scripts/search.tag
  5. 7
      src/website.py

5
Makefile

@ -14,3 +14,8 @@ default:
clean:
rm -r ./build;
install:
$(MAKE) clean;
$(MAKE);
cp -r ./build /srv/http/build;

15
search.ini

@ -0,0 +1,15 @@
[uwsgi]
wsgi_file = /srv/http/build/website.py
module = website
callable = app
uid = http
gid = http
master = true
processes = 5
socket = /tmp/search.sock
chown-socket = http:http
chmod-socket = 660
vacuum = true
die-on-term = true

2
src/scripts/search.js

@ -7,7 +7,7 @@ function makeResourceGetter(self) {
"title" : this.booktitle,
"author" : this.bookauthor
};
var url = "/resources";
var url = "/search/resources";
console.log(params);
$.getJSON(url, {
data : JSON.stringify(params)

2
src/scripts/search.tag

@ -21,7 +21,7 @@
function submit(ev) {
console.log("submitted");
var params = $(ev.currentTarget).serialize();
$.getJSON("/fc?"+params,
$.getJSON("/search/fc?"+params,
function(courses) {
var fcourses = filterCourses(courses);
var cgroups = groupsof(4, fcourses);

7
src/website.py

@ -85,7 +85,6 @@ def ClassSearch(configfile=None):
@blueprint.route("/", methods=("GET", "POST"))
def index():
print "never reached?"
return render_template("search.html")
@blueprint.route("/fc", methods=("GET", "POST"))
@ -144,5 +143,7 @@ def ClassSearch(configfile=None):
app.config["styles"] = "./styles"
return app
if __name__ == "__main__":
ClassSearch("./appconfig").run(host="localhost", port=8001, debug=True)
app = ClassSearch("./appconfig")
#if __name__ == "__main__":
#ClassSearch("./appconfig").run(host="localhost", port=8001, debug=True)

Loading…
Cancel
Save