User:Little green rosetta/sandbox
Appearance
This stub application is designed to get a sample python application installed onto the tools-project as quickly as possible. The application is written in python using the flask framework. The application uses the tool's local mysql database instance whose credentials are located in .my.cnf
- Login to IRC on the Freenode network. Join the labs channel by executing
/join #wikimedia-labs. You don't need IRC to work on tools, but you won't get very far without assistance from other developers. - Register for an account on Wikimedia labs
- After creating an account, you need to request access to one of the projects that will host your tool. Requesting via IRC is probably faster, but you can also follow these instructions. You also need to request which project you want to work on. This guide assumes you will be using the tools project.
- Once you have received access to your shell, SSH into
tools-login.wmflabs.organd make sure you can login. - Now you need to create a project in which your application will reside. Go to the projects list and click "Add service group" (top right) and give your project a name and then press submit. This guide uses
foobarfor the project name, so you will need to replace that with your project name accordingly. - Login into
tools-login.wmflabs.organd type
become fubar
- You should now be logged into your project's shell account. Now fire up your favorite text editor and create a file called stubinstall and paste the following code:
prjdir=$HOME
prjdir=${prjdir/\data\/project\//}
prjdir=${prjdir/\//}
prjdir=${prjdir/\//}
rm -rf $prjdir
hg clone https://bitbucket.org/littlegreenrosetta/stub stub
cp ~/stub/setup/wmf/stubinit .
chmod 755 stubinit
./stubinit $prjdir $prjdir
mysql < ~/$prjdir/setup/sql/world.sql
rm stubinit
- Now modify the file so it can run then start the script.
chmod 755 stubinstall ./stubinstall
The script will download the stub application and set the application up to use the name of your tool. Your tool should now be available at http://tools.wmflabs.org/fubar/cgi.py. You can now modify the python and html files to add functionality to your application.
This application is maintained by little green rosetta (wikipedia-en)