stephenmcd / mezzanine

CMS framework for Django
http://mezzanine.jupo.org
BSD 2-Clause "Simplified" License
4.75k stars 1.64k forks source link

"View on site" links don't respect dev server port #2043

Closed ccurvey closed 1 year ago

ccurvey commented 2 years ago

Is there an existing issue for this?

Current Behavior

if you start mezzanine with the django dev server on a non-standard port (e.g. 5000), then the "view on page" links within the admin don't work. (The redirects seem to send you to port 8000)

Expected Behavior

pages should be shown on the production site

Steps To Reproduce

  1. start mezzanine with python manage.py runserver 0.0.0.0:5000
  2. Edit a page in the admin
  3. Click on the "view on site" button in the upper right

You will get a 404

Environment

* Mezzanine 6.0.0
* Django 4.0.5
* Python 3.10.4
* SQLite 3.37.2
* Linux 5.15.0-40-generic

(distro is Ubuntu 2022.04)

Anything else?

No response

jerivas commented 1 year ago

The links are generated according to your Site records, not the port on which Django is listening. You'll need to update the domain and port in the "Sites" section of the admin sidebar.