Problems with images and css
I know that I must load the diretory where I have my images and css, because otherwise nevow is not going to render it. Everything works well while this is running in my local machine, but in the server doesn't work. I have noticed that a simple '.' at the begining of a path, can destroy all my web, even the things that are not relate with that image. Why is this happening? Another problems is that even if I fix that problems, the website doesn't recover the information from my image directory or css directory, and I have to remove all the structure directory, upload again, close the web browser, etc. Is nevow keeping information in any kind of cache, and that is probably the reason because even if I fix the problems, still I can't see anything? Thank for the help.
On Wed, 2005-09-07 at 17:15 +0100, Alberto Trujillo wrote:
I know that I must load the diretory where I have my images and css, because otherwise nevow is not going to render it. Everything works well while this is running in my local machine, but in the server doesn't work. I have noticed that a simple '.' at the begining of a path, can destroy all my web, even the things that are not relate with that image. Why is this happening?
With the information you have given us, no one knows. First, simplify your system to the smallest possible, where the problem still occurs. Then, try to actually give us exact information on what you did, what happened, and what did you expect to happen.
Another problems is that even if I fix that problems, the website doesn't recover the information from my image directory or css directory, and I have to remove all the structure directory, upload again, close the web browser, etc. Is nevow keeping information in any kind of cache, and that is probably the reason because even if I fix the problems, still I can't see anything?
No, but your browser most likely is. Or a proxy is. It might even be a transparent proxy run by your ISP.
I don't know where is the exactly problem, only I know that is related with the path of the images I'll try to explain it better. The template that I'm working with is a html template, which load different fragments. The template has 3 fragments (head, body and footer), so depende where the user click, I will load one fragment or another. In this way I can change the template of all my pages just changing one file. The template (portal.html) is call by a nevow file (portal.py), that is the responsible of the calls to the others fragments. In portal.htm I have this two lines to load the images and the css files child_styles = static.File('./templates/styles') child_images = static.File('./templates/images') The fragment are place in different directories, I show a example: Main Directory: * portal.py * Fragments: o Fragment1: + file.py + file.html + Images: # image.jpg # ... + styles: # ... o Fragment2: + ... * templates: o portal.html o images: + ... o styles: + .... Probably the example is not very good, but at least you have an idea about my structure directory. As you can see the fragment can has their own images, and everything works well while I am running the application in my local machine, even without call the images directory like static file. But when I upload the application in the server, everything looks like nevow can't find the directories. Should I insert a line "child_styles = static.File('./styles')" and "child_images = static.File('./images')" in all my fragments, or should be the portal.py file who do this job. I hope this information should be enough. Thank you very much Tommi Virtanen wrote:
On Wed, 2005-09-07 at 17:15 +0100, Alberto Trujillo wrote:
I know that I must load the diretory where I have my images and css, because otherwise nevow is not going to render it. Everything works well while this is running in my local machine, but in the server doesn't work. I have noticed that a simple '.' at the begining of a path, can destroy all my web, even the things that are not relate with that image. Why is this happening?
With the information you have given us, no one knows. First, simplify your system to the smallest possible, where the problem still occurs. Then, try to actually give us exact information on what you did, what happened, and what did you expect to happen.
Another problems is that even if I fix that problems, the website doesn't recover the information from my image directory or css directory, and I have to remove all the structure directory, upload again, close the web browser, etc. Is nevow keeping information in any kind of cache, and that is probably the reason because even if I fix the problems, still I can't see anything?
No, but your browser most likely is. Or a proxy is. It might even be a transparent proxy run by your ISP.
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 9/8/05, Alberto Trujillo
child_styles = static.File('./templates/styles') child_images = static.File('./templates/images')
Since you're making relative references to files (by using the dot-slash './templates...'), are you sure that your twisted application on the server is run with the current working directory correctly set to the root of your application file system? If on your system you run the application with, say, twistd -noy server.tac, and on the server you run it with twistd -noy /myapp/server.tac, it would be no wonder if it didn't work. You wound have to first chdir /myapp, and then run twistd. Or, you change all the paths to absolute. that's my 2 cents, hope it helps, stefano
Thank you Stefano, I going to check my references, althoug in my system and in the server I allways run the applicattion from the directory where is the .tac file. I know that the problem is related with the references, so I'll check it again. Stefano Masini wrote:
On 9/8/05, Alberto Trujillo
wrote: child_styles = static.File('./templates/styles') child_images = static.File('./templates/images')
Since you're making relative references to files (by using the dot-slash './templates...'), are you sure that your twisted application on the server is run with the current working directory correctly set to the root of your application file system? If on your system you run the application with, say, twistd -noy server.tac, and on the server you run it with twistd -noy /myapp/server.tac, it would be no wonder if it didn't work. You wound have to first chdir /myapp, and then run twistd. Or, you change all the paths to absolute.
that's my 2 cents, hope it helps, stefano
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (3)
-
Alberto Trujillo
-
Stefano Masini
-
Tommi Virtanen