Permalink
Browse files

v0.95, domain auto detect, add expose_time config, update README.txt

  • Loading branch information...
1 parent 6444432 commit 67a390dfc89f8198aac1896faae6395648788774 @nopri committed Oct 24, 2012
Showing with 51 additions and 60 deletions.
  1. +30 −43 README.txt
  2. +10 −8 app.py
  3. +2 −2 db.sql
  4. +6 −4 messages.py
  5. +3 −3 template/default/admin_system.html
View
@@ -3,10 +3,11 @@ onlinestore-multi, Simple Online Store application
2010
GPL
-Screenshots: https://github.com/nopri/onlinestore-multi/wiki
+SCREENSHOTS / USERS: https://github.com/nopri/onlinestore-multi/wiki
-Features:
+
+FEATURES:
- Run as WSGI Application
- Multi Language (currently English and Bahasa Indonesia)
- Pretty URL
@@ -29,7 +30,7 @@ Features:
- More
-Using:
+REQUIREMENTS:
- Python
- web.py
- jQuery/jQueryUI (bundled, old version)
@@ -38,58 +39,44 @@ Using:
- GeoIP or pygeoip (auto detect)
- Python Imaging Library
- MySQL (and MySQLdb)
+- Apache HTTP Server (and mod_wsgi)
-Default user/password: admin
+DEFAULT USER/PASSWORD: admin
-Installation (with Python already installed):
-- We will use Apache HTTP Server for WSGI.
-
-- Install: web.py, PyYAML, BeautifulSoup, Python GeoIP (or pygeoip, noted below),
- PIL, MySQL Server, Python MySQLdb
- Ubuntu-based distribution (put command in one line):
- $ sudo apt-get install python-webpy python-yaml python-beautifulsoup python-geoip python-imaging mysql-server python-mysqldb
-
-- Download onlinestore-multi source code, or clone from GitHub
- $ git clone https://github.com/nopri/onlinestore-multi.git
+INSTALLATION:
+1) Install all the requirements above (except for bundled)
-- Change into root directory of source code:
- $ cd onlinestore-multi
+2) Download / clone onlinestore-multi: https://github.com/nopri/onlinestore-multi.git
-- Create new MySQL database and restore from dump file:
- $ mysql -u root -p
- mysql> create database onlinestore;
- mysql> grant all privileges on onlinestore.* to onlinestore@localhost identified by 'onlinestore_password';
- mysql> flush privileges;
- mysql> quit;
+3) Change into application directory:
+ $ cd onlinestore-multi
- $ mysql -D onlinestore -u onlinestore -p < ./db.sql
+4) Create new MySQL database and restore from dump file:
+ $ mysql -u root -p
+ mysql> create database onlinestore;
+ mysql> grant all privileges on onlinestore.* to onlinestore@localhost identified by 'onlinestore_password';
+ mysql> flush privileges;
+ mysql> quit;
-- In root directory of source code:
- $ cp config.ini.dist config.ini
+ $ mysql -D onlinestore -u onlinestore -p < ./db.sql
-- Edit config.ini
-
-- Configure WSGI
- Ubuntu-based distribution:
- $ sudo apt-get install libapache2-mod-wsgi
-
- For default domain
- (replace /tmp/onlinestore-multi with your configuration):
+5) Copy config.ini.dist to config.ini, edit accordingly
- $ sudo nano /etc/apache2/sites-available/default
- (put these lines below DocumentRoot)
+6) Configure WSGI:
+ Ubuntu-based distribution: edit /etc/apache2/sites-available/default
+ (put these lines below DocumentRoot, adjust accordingly)
- WSGIScriptAlias / /tmp/onlinestore-multi/app.py/
- AddType text/html .py
- Alias /static /tmp/onlinestore-multi/static/
+ WSGIScriptAlias / /tmp/onlinestore-multi/app.py/
+ AddType text/html .py
+ Alias /static /tmp/onlinestore-multi/static/
- $ sudo service apache2 reload
+7) Restart Apache HTTP Server
-- If you are using pygeoip:
- - Download http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
- - Extract and put GeoIP.dat into application directory
+8) If you are using pygeoip:
+ - Download http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
+ - Extract and put GeoIP.dat into root directory of source code
-Thank you :)
+THANK YOU :)
View
@@ -232,17 +232,17 @@ def pget(option, default='', strip=True, callback=None):
############################### CONSTANT ###############################
-VERSION = '0.94'
+VERSION = '0.95'
NAME = 'onlinestore-multi'
PRECISION = 2
TEMPLATE_DIR = CURDIR + PS + 'template'
DOC_ADMIN = CURDIR + PS + 'README.txt'
-DOMAIN = pget('domain')
+DOMAIN = ''
BASEURL_DEFAULT = '/store'
HOME_DEFAULT = '/product'
TEMPLATE_DEFAULT = 'default'
LANG_DEFAULT = 'en_US'
-MAIL_DEFAULT = '%s <%s>' %(DOMAIN, pget('mail_default'))
+MAIL_DEFAULT = ''
FORCE_SINGLE_CURRENCY = True
CWIDTH = {'product': 42, 'qty': 8, 'price': 17, 'vat': 16, 'subtotal': 18}
CSPACE = ' '
@@ -1327,6 +1327,8 @@ def nrfloat(snumber, precision=PRECISION, round=decimal.ROUND_UP):
def rt(precision=4, show_second=True):
+ if not pget('expose_time') == '1': return ''
+ #
x = rendertime[1] - rendertime[0]
if x <= 0:
x = 0
@@ -2199,7 +2201,7 @@ def proc_set_res(handle):
#
FORCE_PROMOTE = res['promote']
PAYMENT_TYPE = res['payments']
- DOMAIN = pget('domain')
+ DOMAIN = web.ctx.env.get('HTTP_HOST', '')
MAIL_DEFAULT = '%s <%s>' %(DOMAIN, pget('mail_default'))
#
return handle()
@@ -2956,7 +2958,7 @@ def GET(self):
data['keywords'] = pget('site_keywords', default='')
data['news_max'] = pget('news_max')
data['message'] = smget()
- data['domain'] = pget('domain')
+ data['expose_time'] = pget('expose_time')
data['promote'] = pget('promote')
data['max_product_category'] = pget('max_product_category')
data['max_product'] = pget('max_product')
@@ -2987,7 +2989,7 @@ def POST(self):
logo_file='',
keywords='',
news_max='',
- domain='',
+ expose_time='',
promote='',
payments='',
max_product_category='',
@@ -3013,7 +3015,7 @@ def POST(self):
logo_file = i.logo_file
keywords = i.keywords
news_max = i.news_max
- domain= i.domain
+ expose_time= i.expose_time
promote= i.promote
payments= i.payments
max_product_category= i.max_product_category
@@ -3050,7 +3052,7 @@ def POST(self):
'logo_file' : logo_file,
'site_keywords' : keywords,
'news_max' : news_max,
- 'domain' : domain,
+ 'expose_time' : expose_time,
'promote' : promote,
'payments' : payments,
'max_product_category' : max_product_category,
View
@@ -127,8 +127,8 @@ CREATE TABLE `ms_config` (
LOCK TABLES `ms_config` WRITE;
/*!40000 ALTER TABLE `ms_config` DISABLE KEYS */;
INSERT INTO `ms_config` VALUES ('allow_user','',NULL),('another_email','',NULL),('blog_show_style','date',NULL),('cart_check_stock','',NULL),('currency','',NULL),('expose_error','1',NULL),('extra_info','',NULL),('general_error_message','',NULL),('homepage','',NULL),('invoice_extra_info','',NULL),('invoice_show_bank','',NULL),('invoice_show_paypal','',NULL),('lang','',NULL),('logo_file','',NULL),('news_max','5',NULL),('offline','1',NULL),('payment_month','12',NULL),('promo_host','',NULL),('secure','',NULL),('site_description','',NULL),('site_keywords','',NULL),('sticky_info','',NULL),('template','default',NULL),('template_param','',NULL),('use_cart','',NULL);
--- manually added on 22-October-2012 nop@tedut.com. Again, really sorry :(
-INSERT INTO `ms_config` VALUES ('domain','',NULL),('promote','1',NULL),('payments','1,2,3,',NULL),('max_product_category','100',NULL),('max_product','500',NULL),('max_file_size','512000',NULL),('max_files','500',NULL),('mail_smtp','',NULL),('mail_user','',NULL),('mail_pass','',NULL),('mail_default','',NULL),('url_base','/',NULL),('font_dir','/usr/share/fonts/truetype/freefont/',NULL);
+-- manually added on 22/24-October-2012 nop@tedut.com. Again, really sorry :(
+INSERT INTO `ms_config` VALUES ('expose_time','1',NULL),('promote','1',NULL),('payments','1,2,3,',NULL),('max_product_category','100',NULL),('max_product','500',NULL),('max_file_size','512000',NULL),('max_files','500',NULL),('mail_smtp','',NULL),('mail_user','',NULL),('mail_pass','',NULL),('mail_default','',NULL),('url_base','/',NULL),('font_dir','/usr/share/fonts/truetype/freefont/',NULL);
/*!40000 ALTER TABLE `ms_config` ENABLE KEYS */;
UNLOCK TABLES;
View
@@ -298,7 +298,7 @@
'header_sys_template' : 'site template',
'header_sys_logo_file' : 'logo file',
'header_sys_news_max' : 'maximum news display',
- 'header_sys_domain' : 'domain name',
+ 'header_sys_expose_time' : 'expose time',
'header_sys_promote' : 'promote (footer)',
'header_sys_payments' : 'payments',
'header_sys_max_product_category' : 'max product category',
@@ -429,7 +429,8 @@
'desc_sys_logo_file' : '',
'desc_sys_news_max' : 'empty for all news',
'desc_sys_payments': 'comma separated/ended: 1=cash, 2=COD, 3=bank/wire transfer',
- 'desc_sys_domain': 'without http/https protocol',
+ 'desc_sys_expose_time': '1=enabled',
+ 'desc_sys_promote': '1=enabled',
'desc_product_category_priority': 'descending sort',
'desc_product_category_name_info': 'please fill in at least one field',
'desc_product_group_name_info': 'please fill in at least one field',
@@ -742,7 +743,7 @@
'header_sys_template' : 'template situs',
'header_sys_logo_file' : 'file logo',
'header_sys_news_max' : 'jumlah berita maksimum',
- 'header_sys_domain' : 'nama domain',
+ 'header_sys_expose_time' : 'tampilkan waktu proses',
'header_sys_promote' : 'promosi (footer)',
'header_sys_payments' : 'pembayaran',
'header_sys_max_product_category' : 'maksimum kategori produk',
@@ -873,7 +874,8 @@
'desc_sys_logo_file' : '',
'desc_sys_news_max' : 'kosongkan untuk tampil semua',
'desc_sys_payments': 'dipisahkan/diakhiri koma: 1=cash, 2=COD, 3=transfer bank',
- 'desc_sys_domain': 'tanpa protokol http/https',
+ 'desc_sys_expose_time': '1=aktif',
+ 'desc_sys_promote': '1=aktif',
'desc_product_category_priority': 'besar ke kecil',
'desc_product_category_name_info': 'harap isikan paling tidak satu field',
'desc_product_group_name_info': 'harap isikan paling tidak satu field',
@@ -240,11 +240,11 @@
<tr>
<td width='20%' valign='top'>
- $msg['header_sys_domain'].capitalize()
- $:dkget(msg, 'desc_sys_domain', "&nbsp;<span class='systeminfo'>(", ')</span>&nbsp;')</span>
+ $msg['header_sys_expose_time'].capitalize()
+ $:dkget(msg, 'desc_sys_expose_time', "&nbsp;<span class='systeminfo'>(", ')</span>&nbsp;')</span>
</td>
<td>
- <input type='text' name='domain' size='4' value="$data['domain']">
+ <input type='text' name='expose_time' size='4' value="$data['expose_time']">
</td>
</tr>

0 comments on commit 67a390d

Please sign in to comment.