GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.45k stars 1.13k forks source link

Change admin path #11418

Open eiacopini opened 1 year ago

eiacopini commented 1 year ago

Is it possible to change the path to access the administration area for example /admin to /administrator? I tried to change this code in urls.py but if I try to reach the page /administrator I get page not found error

urlpatterns += i18n_patterns(
    url(r"^grappelli/", include("grappelli.urls")),
    url(r"^administration/", admin.site.urls, name="administration"),
)
t-book commented 1 year ago

Have you tried to keep admin as name?

name="administration"

eiacopini commented 1 year ago

yes I try, and i do compose up -d but is the same.

eiacopini commented 1 year ago

urlpatterns += i18n_patterns( url(r"^grappelli/", include("grappelli.urls")), url(r"^administration/", admin.site.urls, name="admin"), )

It finally worked but after editing the urls.py file before the docker composed build. Then I did docker compose up -d and a reload of nginx.

Is there a faster way to apply changes to the urls.py file?

giohappy commented 1 year ago

@eiacopini once the Docker image is built you can only alter its (entrypoint) execution through environmental variables. A change to the code requires a new build.

If you want to experiment you can build and start GeoNode with docker-compose-dev, which mounts the source code from the host. This way you can change the code and restart the container without needing to build it again. I haven't tested it since a while but it should work fine.

An even quicker way to avoid restarting is to use the following command inside the django container:

touch geonode/wsgi.py

This will trigger the restart of the uWSGI server inside the container, and the reload of GeoNode.