GeoNode / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
79 stars 174 forks source link

Changes in site_index.html are not showing in the browser #276

Closed PauloJhonny closed 2 years ago

PauloJhonny commented 2 years ago

Hey, I need some help, please.

I installed the geonode-project from branch 3.3.x using docker. I can open the url in the browser but when i try to change something in the site_index.html the changes doesn't happen in the browser. I'm wondering what am I doing wrong?

Thank you so much!

frafra commented 2 years ago

You need to rebuild the image to see the change and make it permanent. Otherwise, you can just mount the folder containing the templates in your container, to see the changes in real time.

PauloJhonny commented 2 years ago

Hey, @frafra. Thank you for your help.

I tried to rebuild the image in order to see the changes, but I got the following error. Also, now, even though I don't change anything in the templates files, I got the same error:

Error during template rendering In template /usr/src/geonode/geonode/templates/base.html, error at line 113 relation "layers_layer" does not exist LINE 1: ...COUNT("layers_layer"."storeType") AS "count" FROM "layers_la... ^

Line 113:

103 {% if custom_theme.navbar_text_hover_focus %} 104 .navbar-inverse .navbar-nav > .open > a, 105 .navbar-inverse .navbar-nav > .open > a:hover, 106 .navbar-inverse .navbar-nav > .open > a:focus { 107 background-color: {{ custom_theme.navbar_text_hover_focus }}; 108 } 109 {% endif %} 110 111 {% if custom_theme.navbar_dropdown_menu %} 112 .navbar-nav .dropdown-menu { 113 background-color: {{ custom_theme.navbar_dropdown_menu }}; 114 border-top: 1px solid {{ custom_theme.navbar_dropdown_menu }}; 115 } 116 {% endif %} 117 118 {% if custom_theme.navbar_dropdown_menu_text %} 119 .navbar-nav .dropdown-menu a { 120 color: {{ custom_theme.navbar_dropdown_menu_text }}; 121 } 122 {% endif %} 123

Thank you!

frafra commented 2 years ago

Such error has nothing to do with your template. There are some tables missing from the database. I guess your database has not been initialized.

PauloJhonny commented 2 years ago

You are right, @frafra.

There is something wrong with the database. I coudn't figure it out yet.

image

frafra commented 2 years ago

As you are testing, I suggest to destroy/delete your volumes and launch docker-compose up again.

PauloJhonny commented 2 years ago

Hey, @frafra. Thank you for your help.

I can access the geonode home page now. As I was testing, I uploaded one example layer the first time. When I deleted the containers and imagens using docker system prune -a, I thought the volumes were deleted (and that layer as well). As you suggested, I ran docker system prune --volumes and then the database error is gone.

About my main question, the changes in site_index.html are finally showing up in the browser, even though I don't rebuild the images. I'm using the geonode-project from branch 3.2.x, for testing.

Thank you.

frafra commented 2 years ago

You can just use docker-compose down -v to remove the volume: there is no need to delete everything else (like images or volumes belonging to other docker projects).

I still think that you rebuilt the images, since you executed a system prune.

Have fun!