Django

Code

Ticket #8960 (assigned)

Opened 2 months ago

Last modified 3 weeks ago

"View on site" does not work if contrib.sites is not installed

Reported by: bmihelac Assigned to: adrian (accepted)
Milestone: post-1.0 Component: Core framework
Version: 1.0 Keywords:
Cc: matthijs Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Code in django.conf.urls.defaults.shortcut expect that contrib.sites is installed and throws error "no such table: django_sites" otherwise.

Attachments

8960_View_on_site_does_not_work_if_contrib_sites_is_not_installed.diff (3.0 kB) - added by bmihelac on 09/08/08 02:35:06.
8960_View_on_site_does_not_work_if_contrib_sites_is_not_installed.2.diff (3.1 kB) - added by matthijs on 10/31/08 13:45:17.
Updated version

Change History

09/08/08 02:35:06 changed by bmihelac

  • attachment 8960_View_on_site_does_not_work_if_contrib_sites_is_not_installed.diff added.

09/08/08 02:36:25 changed by bmihelac

  • needs_better_patch changed.
  • has_patch set to 1.
  • needs_tests changed.
  • needs_docs changed.

Patch is attached - it only checks if Sites application is installed before introspecting current site.

09/10/08 00:29:22 changed by adrian

  • owner changed from nobody to adrian.
  • status changed from new to assigned.
  • stage changed from Unreviewed to Accepted.

Note that the patch includes a print statement.

I'm going to review this and check it in.

09/11/08 00:48:51 changed by bmihelac

print statement is left accidentally - thanks for noting it

10/31/08 13:45:17 changed by matthijs

  • attachment 8960_View_on_site_does_not_work_if_contrib_sites_is_not_installed.2.diff added.

Updated version

10/31/08 13:48:52 changed by matthijs

I just run into the issue as well, so I'd be grateful if the patch could be committed.

I've added an updated version, since code in question was moved to a different file in r9001. Since the patch is slightly hard to read: All this does is put a big if around all the Site-related code. This increases the indent of that code a bit, making the diff so messy... If you apply the patch and run svn diff -x -b, you can see the changes a lot more clearly (ignore space change).

10/31/08 13:50:21 changed by matthijs

  • cc set to matthijs.

Add/Change #8960 ("View on site" does not work if contrib.sites is not installed)




Change Properties
Action