Posts Tagged ‘website’

Using CherryPy for webform authentication

Sunday, March 7th, 2010

If you are using CherryPy, I can recommend the webform-based authentication that Arnar Birgisson wrote for ease of use and extensability.

After trying out the included authentication models with CherryPy (I’m using 3.1.2, the last stable version at the moment of writing), I was disappointed in the results. Then I stumbled over a recommandation from someone on Nabble, a web-based programmar’s discussion forum, which pointed to the following wiki page on the CherryPy site:

http://tools.cherrypy.org/wiki/AuthenticationAndAccessRestrictions

The complete program code plus examples are on the page and are well explained.

You can have a skeleton login system (using a hardcoded dictionary) up and running in literally half an hour !

  • Just copy/paste the code on the page and save it as auth.py in your cherrypy script dir.
  • Add the hardcoded dictionary containing username and passwords to it (or script the db access, see the example included)
  • Put ‘require()’ everywhere on your cherrypy pages that need to have login protection – additionally, you can also have roles so that only admins can access certain pages.

Early last week I replaced that hardcoded dictionary and built the db lookup query for the login. Once that was working, I added a ‘my profile’ page to the application I’m working on.  Then I thought it would be nice for the admin to have a ‘create user’ form in the admin section to add users. Done that as well, using the jquery-ui to create tabs and seperate content in the admin section.

All in all, a nice week of nice work.

I’m starting to think this might make it’s way to my hosting server one of the coming weeks…  although I need to do some more work on showing the user only his keywords and not all the keywords, as well as doing something with the keywords to use them better.

Oh and one more thing: this works better under SSL than in the clear http: sky !

AWStats Tool that creates custom IIS log format lines

Saturday, October 24th, 2009

I recently ran into a problem where I needed to read a few IIS logs to find out the number of visits during the day. The tool I wanted to use was AWStats, a  free log file analyzer tool that can create some handy reports.

If you need to read an IIS log file where the admin has set up a custom log method, this tool for AWStats is very handy: in the top of your IIS log file it states which are the variables it uses. By selecting these on the web page, you get a custom awstat log format line that you can just copy / paste into your awstat config lines.

Dashalytics

Tuesday, October 23rd, 2007

I’ve set up Google Analytics for a website recently, to keep track of the visitor statictics. Free is hard to beat, after all.

What is even better is for mac users is a free widget called Dashalytics that allows you to keep track of the Google analytic reports, without you requiring to log in to the site ! So, by glimpsing your dashboard you can get an instant view of how your monitored website is doing, how many visitors, etc.

Real cool !

Uber Cool Nerd King !

Thursday, September 27th, 2007

Not as good as Michel Vuijlsteke, but not bad either!!!

NerdTests.com says I'm an Uber Cool Nerd King.  What are you?  Click here!

Can you do better than me ? Click the above link to try…

Archives
Search this blog
My Webhost