From: Yasin Date: Tue, 24 Sep 2013 15:48:35 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.onelab.eu/git/myslice X-Git-Tag: myslice-0.2-4~21^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8c6df7c2e324b1d81dcaf750cc14bcda4da668be;hp=4fa60d8ef5b10187b7535a9c36da9ef0164af115;p=unfold.git Merge branch 'master' of ssh://git.onelab.eu/git/myslice --- diff --git a/apache/myslice.conf b/apache/myslice.conf index 581b559c..712b8ad2 100644 --- a/apache/myslice.conf +++ b/apache/myslice.conf @@ -1,25 +1,14 @@ -## better use -# https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/modwsgi/ -# instead -# -# XXX this is very rough, was just pasted from the (wrong) web page -# and never tested, so feel free to rewrite completely if that sounds right -# -#Alias /robots.txt /usr/share/myslice/static/robots.txt -Alias /favicon.ico /usr/share/unfold/static/favicon.ico - -#AliasMatch ^/([^/]*\.css) /usr/share/myslice/static/styles/$1 - -Alias /static/ /usr/share/unfold/static/ - - -Order deny,allow -Allow from all - - -WSGIScriptAlias / /usr/share/unfold/apache/myslice.wsgi - - -Order allow,deny -Allow from all - + + WSGIScriptAlias / /usr/share/unfold/apache/myslice.wsgi + + + Order deny,allow + Allow from all + + + Alias /static/ /usr/share/unfold/static/ + + Order deny,allow + Allow from all + + diff --git a/debian/unfold.install b/debian/unfold.install index 6e546b06..4a43ef07 100644 --- a/debian/unfold.install +++ b/debian/unfold.install @@ -11,3 +11,5 @@ usr/share/unfold/myslice usr/share/unfold/sample usr/share/unfold/trash usr/share/unfold/debug_platform +myslice/manage.py usr/share/unfold/manage.py +/etc/apache2/sites-available/myslice.conf diff --git a/debian/unfold.postinst b/debian/unfold.postinst index c762a570..de85dd31 100644 --- a/debian/unfold.postinst +++ b/debian/unfold.postinst @@ -1,6 +1,10 @@ #!/bin/bash # if this requires a service to be running, add something like this # update-rc.d unfold defaults - -[ -f /etc/apache2/apache2.conf ] && echo "WSGIScriptAlias / /usr/share/unfold/apache/myslice.wsgi" >> /etc/apache2/apache2.conf +/usr/share/unfold/manage.py syncdb +/usr/share/unfold/manage.py migrate +chmod 777 /usr/share/unfold/myslice.sqlite3 +chmod 777 /usr/share/unfold +a2dissite default +a2ensite myslice.conf service apache2 restart diff --git a/manifold/manifoldproxy.py b/manifold/manifoldproxy.py index 9f014971..a63e4a8b 100644 --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -1,4 +1,6 @@ import json +import os.path + # this is for django objects only #from django.core import serializers from django.http import HttpResponse, HttpResponseForbidden @@ -52,7 +54,7 @@ with the query passed using POST""" manifold_query = Query() #manifold_query = ManifoldQuery() manifold_query.fill_from_POST(request.POST) - offline_filename="offline-%s-%s.json"%(manifold_query.action,manifold_query.object) + offline_filename="%s/../offline-%s-%s.json"%(os.path.dirname(__file__),manifold_query.action,manifold_query.object) # retrieve session for request # We allow some requests to use the ADMIN user account diff --git a/manifold/metadata.py b/manifold/metadata.py index 6f4c5ce6..420821c8 100644 --- a/manifold/metadata.py +++ b/manifold/metadata.py @@ -1,4 +1,5 @@ import json +import os.path from manifold.manifoldresult import ManifoldResult from manifold.manifoldapi import ManifoldAPI @@ -17,7 +18,7 @@ class MetaData: self.hash_by_object={} def fetch (self): - offline_filename="offline-metadata.json" + offline_filename="%s/../offline-metadata.json"%os.path.dirname(__file__) if work_offline: try: with file(offline_metadata) as f: