1

Is there any that I can have a catch all site with flatpage framework in Django?

I have one site but you can get to it through a few DNS names that change constantly. I need to map these all to a single site and flatpages seems bent on me pre-specifying my domain entries.

Zac Bowling
  • 6,508
  • 1
  • 27
  • 26
  • Sadly not, and it's a pain to get the Site set everytime you switch host/port or dev environment. – shuckc May 12 '16 at 13:43

1 Answers1

2

You need to configure your webserver correctly so that the requests from all domains get forwarded to your only django instance! You cannot run flatpages without having django.contrib.sites in your INSTALLED_APPS, but that is no problem for your case, the actual site will always be determined with the SITE_ID defined in your settings.py. The sites framework does not check the request to check which is the actual site. If you run multiple sites, you have to run multiple django instances that use different settings, which define different SITE_IDs! So just check your webserver to have everything directed to your django instance!

Bernhard Vallant
  • 49,468
  • 20
  • 120
  • 148
  • The issue I was actually having is that the domain is used to reconstruct urls in admin to preview the site. I didn't realize the site ID didn't matter. I patched flatpages in django to fix this by allowing their sites model to allow a blank domain entry and allow editing of site ids in the admin. Sites table is not a feature that should be editable by admin interface to me because it can break dependent code on specific IDs. Oh well. – Zac Bowling Sep 10 '10 at 18:06