O'Reilly Forums: Page-240 Server Unable To Locate Index.html - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Page-240 Server Unable To Locate Index.html hence home page not showing!!!!

#1 User is offline   arc9010 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 22-August 12

Posted 27 August 2012 - 12:52 AM

hi ,

y is the server unable to locate the index.html, favicon.ico files??? is there a problem with the folder structure??

hence my home page is not showing on pg-240
0

#2 User is offline   paulbarry 

  • Advanced Member
  • PipPipPipPipPipPipPipPip
  • Group: O'Reilly Author
  • Posts: 306
  • Joined: 20-August 09

Posted 29 August 2012 - 12:03 AM

It sounds like you are missing some of the files (although you can generally forget about about the favicon.ico file, as it's optional).

Here's something to try: download the code from the headfirstlabs.com website for the chapter you are working on, and get it to run. Then compare the downloaded code with your code to see what's missing.

Hope this helps.

--Paul.
0

#3 User is offline   arc9010 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 22-August 12

Posted 29 August 2012 - 02:09 AM

View Postpaulbarry, on 29 August 2012 - 12:03 AM, said:

It sounds like you are missing some of the files (although you can generally forget about about the favicon.ico file, as it's optional).

Here's something to try: download the code from the headfirstlabs.com website for the chapter you are working on, and get it to run. Then compare the downloaded code with your code to see what's missing.

Hope this helps.

--Paul.


Hey Paul,

Thanks for your reply. I must say u've written a great book. I, as a user, love it.

For the problem above, i was able to solve it by myself. I'm confused about directories and the accordance of how programs read files in particular locations in them.

For example :- In chapter 8 - when u transfer the python script to the emulator via tools/adb push command.....the file to be transferred (lets say mydroidtest.py) has to be in the tools folder itself. So i have to copy it there and then execute the given command and then delete it from there. Is there a better way?????

Another example :- In chapter 7 - Following the webapp directory structure , when i try to execute a program in the cgi-bin folder in IDLE (lets say the program which includes include_header and include_footer commands to be exectuted) then the output gives an error saying "No such file or Directory: templates/header.html". Then i paste the templates folder in the cgi-bin folder , run the program and now IDLE gives no such error and the program is executed fine. But when the whole webapp runs there's no problem with the webapp directory structure given by you. Can You Please explain this to me as my previous problem was also due to confusion in understanding directories????????????
0

#4 User is offline   paulbarry 

  • Advanced Member
  • PipPipPipPipPipPipPipPip
  • Group: O'Reilly Author
  • Posts: 306
  • Joined: 20-August 09

Posted 29 August 2012 - 03:16 AM

The "problem" with IDLE is that when it starts up, it is generally not in the directory that you have your code in. This can cause problems when your code expects to find Python code in certain files in certain places (directories), and they aren't there... because IDLE starts looking from its current directory, which is very unlikely to be the one you have your code in.

When you run Python from the command-line, you are more than likely already in the directory that contains your code, so this issue pops up less.

To work out where Python or IDLE thinks it is, use these commands at the shell:

>>> import os
>>> os.getcwd()

That'll display the current working directory. To change this to the directory that contains your code (in "mycode", for instance) use:

>>> os.chdir('mycode')

or if you are on Windows:

>>> os.chdir("C://mycode")

Reissuing the os.getcwd() command should confirm that Python/IDLE is now working from your code directory.

Also: see the IDLE session on page 76. :-)

As regards the tools/adb command, that's how it works. You need to copy the file into the "tools" directory before you push it, or provide adb with the full path-name to your file. It's a little basic, but it works.

Thanks for the kind words on the book. Delighted to see you are enjoying yourself (and - hopefully - learning lots). :-)

I hope my explanation helps.

--Paul.
0

#5 User is offline   arc9010 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 22-August 12

Posted 29 August 2012 - 03:52 AM

Thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users