diff options
author | Ankita <ankita@ankita-Inspiron-N5010.(none)> | 2012-07-03 12:42:57 -0400 |
---|---|---|
committer | Ankita <ankita@ankita-Inspiron-N5010.(none)> | 2012-07-03 12:42:57 -0400 |
commit | ef3793b349be5744d6ef98a034f0c009159ed85b (patch) | |
tree | 04a873d770c330ce97eef3e78d43edb2d619d1a3 /demo | |
parent | e5c470536ee2d3571817b1a60f6b910f17a33f31 (diff) | |
parent | 471a772b4d2e1430a3a119593e8694c4af2c951a (diff) | |
download | gnowsys-ef3793b349be5744d6ef98a034f0c009159ed85b.tar.gz |
Merge branch 'master' of https://github.com/gnowgi/gnowsys-studio
Conflicts:
django_gstudio.egg-info/PKG-INFO
django_gstudio.egg-info/requires.txt
Diffstat (limited to 'demo')
-rw-r--r-- | demo/settings.py | 69 | ||||
-rw-r--r-- | demo/urls.py | 56 | ||||
-rw-r--r-- | demo/views.py | 16 |
3 files changed, 41 insertions, 100 deletions
diff --git a/demo/settings.py b/demo/settings.py index a325258..2935520 100644 --- a/demo/settings.py +++ b/demo/settings.py @@ -1,50 +1,3 @@ -# Copyright (c) 2011, 2012 Free Software Foundation - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. - -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -# This project incorporates work covered by the following copyright and permission notice: - -# Copyright (c) 2009, Julien Fache -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of the author nor the names of other -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. # Copyright (c) 2011, 2012 Free Software Foundation @@ -78,9 +31,14 @@ DATABASES = {'default': STATIC_URL = '/static/' MEDIA_URL = '/static' -MEDIA_ROOT = '/static' +#MEDIA_ROOT = '/static' +MEDIA_ROOT = os.path.join(os.path.dirname(__file__), '../gstudio/static') +PYSCRIPT_URL_GSTUDIO = os.path.join(os.path.dirname(__file__), '../gstudio/createhtml.py') +PYSCRIPT_URL_OBJECTAPP = os.path.join(os.path.dirname(__file__), '../objectapp/createhtml.py') +GSTUDIO_UPLOAD_TO = 'img/' + ADMIN_MEDIA_PREFIX = STATIC_URL + "grappelli/" SECRET_KEY = 'jo-1rzm(%sf)3#n+fb7h955yu$3(pt63abhi12_t7e^^5q8dyw' @@ -92,10 +50,11 @@ SITE_ID = 1 LANGUAGE_CODE = 'en' -GRAPPELLI_ADMIN_TITLE = '<a href="/">Gnowledge Studio</a>' +GRAPPELLI_ADMIN_TITLE = '<a href="/nodetypes/" title="Gnowledge Studio">Gnowledge Studio</a>' GRAPPELLI_INDEX_DASHBOARD = "demo.dashboard.CustomIndexDashboard" +GSTUDIO_RDF_FILEPATH = os.path.join(os.path.dirname(__file__), 'rdffiles.rdf') # Authentication related ACCOUNT_ACTIVATION_DAYS = 2 @@ -103,6 +62,14 @@ EMAIL_HOST = 'localhost' DEFAULT_FROM_EMAIL = 'webmaster@localhost' LOGIN_REDIRECT_URL = '/' +# fourstore related +FOURSTORE_KBNAME = "demo" # Name of 4store knowledge base +FOURSTORE_PORT = 8067 # Port for 4store HTTP server +SPARQL_ENDPOINT = "http://localhost:8067/sparql/" + + + + LANGUAGES = (('en', gettext('English')), @@ -159,6 +126,7 @@ INSTALLED_APPS = ( 'mptt', 'reversion', 'tagging', + 'markitup', 'django_xmlrpc', 'grappelli.dashboard', 'grappelli', @@ -171,6 +139,9 @@ INSTALLED_APPS = ( 'registration', 'graphviz', 'demo', + 'fourstore', + 'HTTP4Store', + 'html5lib', # Uncomment the south entry to activate south for database migrations # Please do install south before uncommenting # command: sudo pip install south diff --git a/demo/urls.py b/demo/urls.py index 635bc28..9a16e61 100644 --- a/demo/urls.py +++ b/demo/urls.py @@ -14,53 +14,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -# This project incorporates work covered by the following copyright and permission notice: - -# Copyright (c) 2009, Julien Fache -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of the author nor the names of other -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. - -# Copyright (c) 2011, 2012 Free Software Foundation - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. - -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - """Urls for the demo of Gstudio""" from django.conf import settings @@ -78,7 +31,7 @@ from objectapp.sitemaps import GbobjectSitemap # import gstudio.regbackend from gstudio.forms import * from registration.views import register - +from views import home_view, more_view admin.autodiscover() @@ -88,12 +41,15 @@ handler404 = 'django.views.defaults.page_not_found' urlpatterns = patterns( '', (r'^$', 'django.views.generic.simple.redirect_to', - {'url': '/nodetypes/'}), + {'url': '/home/'}), + url(r'^home/', home_view), + url(r'^more/',more_view), url(r'^nodetypes/', include('gstudio.urls')), url(r'^objects/', include('objectapp.urls')), url(r'^comments/', include('django.contrib.comments.urls')), - url(r'^xmlrpc/$', 'django_xmlrpc.views.handle_xmlrpc'), + #URL for XMLRPC + url(r'^xmlrpc/$','django_xmlrpc.views.handle_xmlrpc'), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/gstudio/', include('gstudio.urls.ajaxurls')), diff --git a/demo/views.py b/demo/views.py index bf23bda..2476a3a 100644 --- a/demo/views.py +++ b/demo/views.py @@ -50,7 +50,10 @@ from django.conf import settings from django.template import loader from django.template import Context from django.http import HttpResponseServerError - +from django.shortcuts import render_to_response, get_object_or_404 +from django.contrib.auth.models import User +from django.contrib.sites.models import Site +from gstudio.models import Nodetype def server_error(request, template_name='500.html'): """ @@ -63,3 +66,14 @@ def server_error(request, template_name='500.html'): t = loader.get_template(template_name) return HttpResponseServerError( t.render(Context({'STATIC_URL': settings.STATIC_URL}))) + +def __init__(self): + self.site = Site.objects.get_current() + +def home_view(request): + site = Site.objects.get_current() + return render_to_response('gstudio/home.html', {'user':request.user,'data':request.POST , 'site':site}) + +def more_view(request): + return render_to_response('gstudio/more.html', {'user':request.user,'data':request.POST }) + |