Commits

Anonymous committed 25985cf

Now works with built-in CherryPy server via app.run(), related settings added in config.rc

Comments (0)

Files changed (3)

 admin_email = alecwh@gmail.com
 site_online = True
 domain = http://localhost
-base_url = http://localhost/quack/
+base_url = http://localhost/me/alecwh/
 base_path = /var/www/me/alecwh/
 
+[deployment]
+# choices: built-in, wsgi
+type = built-in
+
+[database]
+# according to Storm API
+url = mysql://root:root@localhost/web_log
+
 [users]
 # key is username, value is md5 hash
 alecwh=c2264384e6a218fcbbb1b655f5166386
 KyleO=21312423094832059u32jlkesfja0es9jf
 
-[database]
-# according to Storm API
-url = mysql://root:root@localhost/web_log
-table_prefix = 
-
 [display]
 items_per_page = 5
 date_format = %a %B %d, %Y at %H:%M
 # can be 'asc' or 'desc' or 'alpha'
 order = desc
 
-[filters]
-filter1 = [code]|<pre><span>Code:</span>
-filter2 = [/code]|</pre>
-
 [comments]
-# ban impersonators
-ban = alec,alec henriksen,alecwho
+# stop impersonators
+reserved_names = alec,alec henriksen,alecwho
 date_format = %m/%d/%Y %H:%M%p
 
 [feed]
 		else:
 			return open(config.general.base_path+"static/"+location,"rb").read() 
 		
-		
-# create WSGI app, finished
+	
+# Create web.py app
 app = web.application(urls, globals())
-
 session = web.session.Session(app, web.session.DiskStore(config.general.base_path + 'sessions'), initializer={'auth': 0, 'username':'', 'email':'', 'website':''})
-
-application = app.wsgifunc()
+	
+# Deploy application based on settings
+if config.deployment.type == "built-in":
+	app.run()
+elif config.deployment.type == "wsgi":
+	application = app.wsgifunc()

templates/article.html

 			<!-- Content -->
 			$article['content']
 			<!-- /Content -->
-			<h4 class="article_link">Link: <a href="$article['base_url']$article['year']/$article['month']/$article['day']/$(article['url_id']).html">$article['base_url']$article['year']/$article['month']/$article['day']/$article['url_id']</a></h4>
+			<h4 class="article_link">Link: <a href="$article['base_url']$article['year']/$article['month']/$article['day']/$(article['url_id']).html">$article['base_url']$article['year']/$article['month']/$article['day']/$(article['url_id']).html</a></h4>
 			<h4 class="available_formats">Available formats: <a href="$article['base_url']$article['year']/$article['month']/$article['day']/$(article['url_id']).html">HTML</a> <a href="$article['base_url']$article['year']/$article['month']/$article['day']/$(article['url_id']).markdown">Markdown</a>
 		</div>
 		<h1 id="comments" class="comments">Comments</h1>