An App for a Pitch
Let’s move on to the next section of Killer Web Development. We are going to create an application from the command line, and not through the web2py interface.
1. Creating a Pitch App
Creating the pitch app confused me a bit because I didn’t install web2py following his tutorial, remember? So I have no idea on where is my web2py.py file located.
$ cd /your/web2py/folder # on Windows use backslashes
$ ./web2py.py -S pitch # web2py.exe on Windows and web2py.app on OS X
I spent some time searching for “how to find a file on Linux” and finally I found some clues of using “find”.
$find / -name 'web2py.py'
It searched for a while and found its directory –
So I typed in
./web2py.py -S pitch (no idea what is -S, couldn’t find it on web)
Now it is time for Mercurial.
“In the terminal go to the directory of the pitch app; create a repository; then create a .hgignore-file; add files to the repository and make your initial commit:
$ cd applications/pitch
$ gedit .hgignore
Line 1 is misleading because it should be the complete directory.
For my case:
$ cd /home/www-data/web2py/applications/pitch
Then at $ /home/www-data/web2py/applications/pitch $ type in
A gedit file will be created. I typed in as instructed but realized that it could not be saved. Yes, I am not the super user!
So, I should type in
sudo gedit .hgignore at the terminal. Now, another gedit file is created but without the index 1 2 3 etc at the front when the codes are typed in. The file is saved. Interestingly, this reminds me of Chemistry! Hg is mercury periodic symbol.
Again, at the next few command in the terminal, “sudo” has to be included at the front;
sudo hg init
sudo hg add .
sudo hg commit -m”Initial commit”
– no username supplied. Well seems like the .hgrc file in the previous section comes to use here? I saved it in home/www-data/web2py/applications/pitch (since it says save in home directory).
– still the same though. May be I should save it with the web2py pitch file.
– Could not save the file as I do not have the permission to save the file in that directory.
– Try to save in /home/ – no permission too
Found this under the comment: Hg Init
More things to read up here!
So in the end, I use the terminal to open up a new file.
sudo gedit .hgrc
I typed in the username and such and save it.
Now, try out the hg commit. It is still the same. Well then, till tomorrow!