-1
- I am using Ubuntu
- I put (Ctrl + v) the image I want on the input screen (desktop)
- I open the terminal (Ctrl + alt + t)
- On the terminal, do: ls (image does not appear)
- I then do: Desktop cd
- Now I see the image file name, let’s assume it is: Woods.png
- I do: pwd
- The return of my terminal is: /home/my-user/Desktop
- I copy that feedback and concatenate with: /Woods.png
- I go into css, and try to use the image
Code
body {
height: 100%;
width: 100%;
/*background-image: url('/static/images/woods.png');*/
background-image: url('/home/meu-user/Desktop/woods.png');
background-attachment: fixed;
background-position: bottom;
background-size: cover;
}
- In Django, the image opened normally, using the path specified above (commented)
- The same doesn’t happen when I try the image locally, even using its exact location
- What am I doing wrong?
The image is . png even? tried to take that first
/
image walk? Leaves alonehome/meu-user/Desktop/woods.png
– hugocsl
Yes, it is in her settings, and yes, I have also tried to remove /, but there is some syntax error which I am unable to identify :(
– Lucas Farias
First of all, can’t you put this image in your project directory? It’s already bad practice to try to access data outside the project...
– Vitor Ceolin
I already have the configuration of Django (it is commented in the code). I wanted to know two ways to do, among them, pulling out of the project folder. It works on Windows, but I can’t get any form on Ubuntu. In short, that’s it.
– Lucas Farias
What is the directory path of your project (
pwd
)? So I can improve my response so it fits better with your scenario.– Vitor Subhi