Web2py instead of MS Access?

241 views
Skip to first unread message

jimbo

unread,
Feb 15, 2014, 9:35:49 AM2/15/14
to web...@googlegroups.com
Hi I am thinking of using web2py for a small database instead of MS Access. It is for a charity and would have only several hundred records of employees and a table for clients. It would run on a local network with probably only two computers using it. The usual name, address , tel no. and some certificate and photo. It would avoid licence fees for a start and I think easier to use via a browser

I know a little about Access but very basic. Are there any simple examples of where I could start, or some web2py appliance available?

If any you can help or have something I can look at I would be very grateful. It's as much a learing thing for myself  as I know virtually nothing aobut DB's.


Thanks, Jim

NeoToren

unread,
Feb 15, 2014, 5:22:59 PM2/15/14
to web...@googlegroups.com
Web2Py is the glue between a database and the user interface - say a web site, HTML pages.
It doesn't have a database, so you'll need to use either SQLite (built in every Mac) or some other DB.
Personally I suggest using MySQL - it is open source, industrial strength and will help you grow out of MS Access into a real-world database.

When you'll have everything up and running on your local machine - you'll need to deploy to a hosting service so people can access your app over the web.

Creating a phone book like you have mentioned is really easy - both on the DB side and the Web2Py side.
I have managed to create one in several hours when I've started learning Web2Py.
I have tried other "glue" frameworks before W2P, such as Django, PHP and others.

W2P is by far the most friendly one I have tried and it will take you from 0 to a reasonable level in literally a couple of days.

Good luck and have fun 

Anthony

unread,
Feb 15, 2014, 6:11:10 PM2/15/14
to web...@googlegroups.com
For a simple app like this on a local network, you can use the built-in web server and database (SQLite) -- so no external dependencies.

For a simple phonebook app:

Add the following model at the end of the /models/db.py that comes with the scaffolding app:

db.define_table('person',
   
Field('name', requires=IS_NOT_EMPTY()),
   
Field('photo', 'upload', requires=IS_EMPTY_OR(IS_IMAGE())),
   
Field('address', 'text'),
   
Field('email', requires=IS_EMAIL()),
   
Field('phone'),
    format
='%(name)s')

And in /controllers/default.py:

def index():
   
return dict(grid=SQLFORM.grid(db.person, user_signature=False))

And in /views/default/index.html:

{{extend 'layout.html'}}
{{=grid}}

Of course, there's a lot more you can do to customize and add functionality, but that should get you started.

To make it available on your local network, run the web2py file and specify 0.0.0.0 as the IP address. You can then access it from any computer on the network by going to the IP address of the computer where it is running.

Anthony


On Saturday, February 15, 2014 9:35:49 AM UTC-5, jimbo wrote:

jimbo

unread,
Feb 15, 2014, 6:14:01 PM2/15/14
to web...@googlegroups.com
Thank you very much NeoToren for your time in replying. Because the database will be so small and will be used within one building (probably one room in fact) I was thinking of using the built in rocket web server and Sqlite.

As I said it would avoid the cost of MS Access and should more users get involved would scale quite nicely. I probably need some sort of guide as to using web2py in place of Access. Once the database is built the only thing needed would be to add, delete and alter some records.

I think someone may have implemented something similar. 

Again, may thanks for your kind input. Jimmy.

jimbo

unread,
Feb 15, 2014, 6:15:21 PM2/15/14
to web...@googlegroups.com

Alexander Scarlat MD

unread,
Feb 15, 2014, 6:16:55 PM2/15/14
to web...@googlegroups.com
Hey Jimbo,

Anthony wrote the whole app for you a moment ago !

1. It is that easy. THANKS Anthony!
2. This group is really awesome

;-))
Enjoy


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/eSSEh_Em4Mw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jimbo

unread,
Feb 15, 2014, 6:49:05 PM2/15/14
to web...@googlegroups.com
Thanks Anthony, that looks like a very good starting point for what I need. Web2py could be immense for small business and charity etc. I like the idea that a database could grow from tiny to something accessible across the net. And on devices including tablets and phones.

Cheers, need to get my backside in gear. Not really used databases before, at least not for a long time. Of course there is a lot about web based stuff available, but web2py seems to be able to do much more. I am a bit old to be learning all this stuff, hopefully I will be able to get a grip and make some progress!

Thanks again.

jimbo

unread,
Feb 16, 2014, 4:24:55 PM2/16/14
to web...@googlegroups.com
Anthony that is really good, very impressive and just what I want! From memory that so far actually seems to be both simpler and better than what MS Access would offer.

A lot of people and companies could make good use of web2py as a database, Especially small businesses and charities etc. I need to do a bit more delving and get myself up to speed hopefully. However those precise instructions are a base for progress, thanks to both yourself and Neo for your time.

I will leave this open for a few more days in case anybody else has something to add. Many thanks. Jimmy.


On Saturday, 15 February 2014 14:35:49 UTC, jimbo wrote:

Massimo Di Pierro

unread,
Feb 17, 2014, 2:33:17 AM2/17/14
to web...@googlegroups.com
Anthony's example is great. Anyway, I would recommend replacing this:

def index():
    
return dict(grid=SQLFORM.grid(db.person, user_signature=False))

with this:

@auth.requires_login()
def index():
    
return dict(grid=SQLFORM.smartgrid(db.person))

user_signature=False will expose all data to users of the system without requiring a registration/password. Apart for security implications, that will prevent versioning and auditing database changes.

Anthony

unread,
Feb 17, 2014, 8:49:51 AM2/17/14
to web...@googlegroups.com
Good advice. Sounded like this was going to be used on a local network by a couple people sitting in a room together, so didn't want to complicate things with Auth and logins, but yes this is the way to go if you need to control access and permissions.

Anthony

Derek

unread,
Feb 19, 2014, 1:48:05 PM2/19/14
to web...@googlegroups.com
friends don't let friends use mysql. It's not standards compliant, and has a lot more gotchas. use Postgres, 

example:

NeoToren

unread,
Feb 19, 2014, 6:07:40 PM2/19/14
to web...@googlegroups.com
The gotchas on MySQL are quite scary but also ...quite old.
They relate to version 4.1 and most of us are using 5.x so I am not sure how relevant these gotchas are.
I feel I am pretty good with SQL in general - but not that good as to start  a discussion on which DB is better: Postgres vs. MySQL
besides - W2P is not the forum for that, right ?

Hope you'll agree though, that for somebody coming from MS Access (been there, done that) - ANY RDBMS is better and a true opportunity to grow...
;-)) 

Derek

unread,
Feb 20, 2014, 11:33:07 AM2/20/14
to web...@googlegroups.com
Well, I wouldn't say that any RDBMS is better, msaccess is good, and if they are coming from access, SQL Express is probably a better choice than MySQL or Postgres just because it's similar.

jimbo

unread,
Feb 20, 2014, 3:02:57 PM2/20/14
to web...@googlegroups.com
Right, had a play with Anthony's suggestion and it is brilliant, just what I needed. A lot easier than I remember MS Access being.

Two questions, rather than use 0.0.0.0 should I set a fixed IP and connect to that one, like 192.168.1.66 as 0.0.0.0 might be exposed externally?

Also the photo upload is immense, that really is a killer! Does it handle PDF's or is there another command for those, also I will need to upload .doc files, do they just upload as a file.

This has been a revelation to me and I will continue to explore web2py for other database use.

Many thanks to all. Jim.




On Saturday, 15 February 2014 14:35:49 UTC, jimbo wrote:

Jim S

unread,
Feb 20, 2014, 4:35:53 PM2/20/14
to web...@googlegroups.com
If you're really interested in hitting the ground running I'd highly recommend reading the entire book BEFORE getting started.  I've read through it cover to cover twice now and am constantly using it as a reference.  It will really open your eyes to how web2py works and what it can do for you out-of-the-box.


-Jim

jimbo

unread,
Feb 20, 2014, 6:57:55 PM2/20/14
to web...@googlegroups.com
Point taken Jim thanks, I honestly have found learning by doing better. I have sorted out uploading docs now and I am going to compare what I have done with the book, which is v good but maybe a bit deep for me at the moment. At least I now know the power of web2py for the future.

Thanks to all.


On Saturday, 15 February 2014 14:35:49 UTC, jimbo wrote:
Reply all
Reply to author
Forward
0 new messages