Base URL #2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there a way to run this with a base URL, for example, at
https://URL/hrss/
?Hello @kmlucy,
with the latest commit I have just pushed, you can edit
hrss/urls.py
and prepend the urls with a custom prefix such ashrss
.For example,
will become
Please confirm that it worked (or not!).
Thanks for the quick update. It kinda works, but with a few issues. I also had to change
/static/
to/hrss/static/
inhrss/settings.py
.In addition, the
HRSS
link in the top left redirects to the root of the domain, as does theNew
link in the top right.And when I try to add a feed, it throws a
MethodNotAllowedHttpException
error. I think there is something else that is trying to redirect to the root. Do I also need to updateweb/urls.py
?The
HRSS
link redirection on the top left has been fixed in my last commitf61a6c42c5
. Are you sure you updated your instance to this commit?No need to update
web/urls.py
. If you have other errors, can you please send me the logfile?That was my bad, I didn't have the latest commit. I do still have to change the static path, but the other problems went away.
I also had to revert the changes to
context_processor.py
, otherwise I got this error:I have modified the way BASE_URL could be implemented. Please pull latest commit (
af9b1f0c5d
) and be sure to change the BASE_URL setting in hrss/setting.py.Every other modification you made should be cleared to make it work (hopefully).
context_processor
now use a completely different way to determine the variable. Be sure to reset this file as well.Please let me know if this worked (tested in dev+demo website and seems to be working, so...).
I like this solution a lot more. I was able to remove every modification bar one. The
STATIC_URL
variable insettings.py
still needs to be updated since it is hardcoded. So to make it work, I have to setBASE_URL = "https://FQDN/hrss"
andSTATIC_URL = '/hrss/static/'
.Is there a way to make the static url relative?
I have never edited
STATIC_URL
for any of my servers. Local uses python integrated webserver and works fine, and demo is behind nginx+uwsgi and works also fine out of the box. Are you perhaps using Apache?I use
python3 manage.py collectstatic
after my pull.I'm using nginx. If I don't edit
STATIC_URL
, none of the css or images load. Are you running in a subdirectory?I don't, but for the sake of this issue I added a subdirectory and it worked without editing
STATIC_URL
. If I add a subdirectory toSTATIC_URL
, the assets stop loading on my end.Does it work when using the debug webserver
python manage.py runserver
?This is using the debug server. It's not super important, it's easy enough to change both places.
Autoclosed the issue by mistake.
2876fe663d
should fix your issue. Can you confirm that you only have to change theBASE_URL
now?That did the trick, only
BASE_URL
needs to be changed. Thanks for the fix!