Django's default site needs to be properly configured and returned

Bug #1456177 reported by Caio Begotti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Committed
High
Caio Begotti

Bug Description

Checking projects/tasks.py's: get_base_url() during the last upgrade I noticed it has some problems:

196 """
197 Get the base URL for the site.
198 """
199 current_site = Site.objects.get_current()
200 return urlparse.urlunparse(("http", current_site.domain, "/", "", "", ""))

1. Django's default site is still example.com when we deploy Capomastro, we don't have a fixture for it and we possibly should ship saner defaults using the production/staging domains.

2. This get_base_url() should IMHO clear out the cache of site objects (Site.objects.clear_cache()) to force Django to query the current site for real otherwise it'll always return the old default example.com cached in the DB, right?

3. It should return HTTPS by default (and it should be safe enough as we have redirects and we always want HTTPS)

As a sidenote, I had to file a RT so IS would workaround these during the last upgrade, via https://rt.admin.canonical.com/Ticket/Display.html?id=81195

Related branches

Daniel Manrique (roadmr)
Changed in capomastro:
milestone: none → 2015-06
importance: Undecided → High
status: New → Triaged
Caio Begotti (caio1982)
Changed in capomastro:
assignee: nobody → Caio Begotti (caio1982)
status: Triaged → In Progress
Caio Begotti (caio1982)
Changed in capomastro:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.