If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

Introduction

Since version 1.92 you can setup web2py in a multiuser or teaching mode. There is one instance of Web2py installed on a system, one account is the admin (or teacher), the other account are the students. Student can only see their own apps. It works like this: the admin page is changed and now contains a login & register header. The first user to log in in this mode gets the role of teacher. Subsequent registrations will become students, after approval by the teacher. Below I assume running web2py locally at 127.0.0.1 on port 8000. The teacher and the students will need a SSL secured web2py instance see chapter 11

Security

Note that in multi-user mode there is no security mechanism to prevent interference between administrators.

Steps to install and use the setup

  • install web2py in a folder, let's say web2py_mu
  • change in admin/appadmin/0.py : MULTI_USER_MODE = True
  • start web2py in the usual way en click on the link for the administrative interface Now you see the adapted administrative login
  • click register to create teacher account You now enter the admin app.
  • click logout and click register to create first student account (you can let the students do this, provide them with the link )

After a student registers his/her status is 'Pending'.

Approving the students

  • enter the admin's appadmin (http://127.0.0.1:8000/admin/appadmin)
  • click on the auth_user table

You're now looking at the teacher and students accounts. For each approved student: + click on its id (leftmost column) + remove the word pending in the field registration_key

Alternative procedure

If available you can also import a list of students by using a csv file (to be expanded upon)

Wish list, work in progress

(1) = essential (2) = nice to have

  • (2) a button to go to admin/appadmin would be nice DONE!
  • (2) in MU-mode the starting app should be the administrative interface for the teacher, instead of the Welcome app. DONE!

Hiding complexity

For students just starting with python and webapps starting with a minimal application could be helpfull. No Ajax, minimal templating...

  • (1) On right side we need a extra option to load a minimal app based on a file 'minimal.w2p' DONE!

The components of appadmin are not relevant for the beginning student and intimidating, a configuration option BASIC_STUDENT default False could help. The teacher can turn this on, and at a later stage off. When False these files can be hidden from sight, and also on the admin screen, the wizard and other advanced options.

We're working an a few patches here. Here you can get the patched code and updated install documentation

Comments (0)


Hosting graciously provided by:
Python Anywhere