blob: 119636b864a7655a88f6b6f15b1063108219f433 [file] [log] [blame]
Rushabh Mehtabd7f7232012-06-15 14:00:06 +05301#!/usr/bin/env python
2
Anand Doshi51146c02012-07-12 18:41:12 +05303# ERPNext - web based ERP (http://erpnext.com)
4# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
Anand Doshi76ec66d2012-07-20 18:11:30 +053019"""
20 return a dynamic page from website templates
21
22 all html pages related to website are generated here
23"""
Anand Doshi486f9df2012-07-19 13:40:31 +053024from __future__ import unicode_literals
Rushabh Mehtabd7f7232012-06-15 14:00:06 +053025import cgi, cgitb, os, sys
26cgitb.enable()
27
28# import libs
29sys.path.append('..')
30import conf
31sys.path.append('../lib/py')
32sys.path.append(conf.modules_path)
33
Anand Doshi5d9fc722012-06-21 11:48:51 +053034def init():
Anand Doshi76ec66d2012-07-20 18:11:30 +053035 import webnotes.handler
36 webnotes.handler.get_cgi_fields()
Anand Doshi5d9fc722012-06-21 11:48:51 +053037 webnotes.connect()
38
39def respond():
Anand Doshi72c945b2012-06-22 20:01:07 +053040 import webnotes
Anand Doshi51146c02012-07-12 18:41:12 +053041 import website.utils
Rushabh Mehtaa4fe7182012-08-02 13:07:23 +053042 return website.utils.render(webnotes.form_dict.get('page'))
Anand Doshi51146c02012-07-12 18:41:12 +053043
Rushabh Mehtabd7f7232012-06-15 14:00:06 +053044if __name__=="__main__":
Anand Doshi5d9fc722012-06-21 11:48:51 +053045 init()
Anand Doshi51146c02012-07-12 18:41:12 +053046 respond()