Search code examples
djangodjango-flatpages

How to use Django's flatpages with multiple sites and the same url?


I have 5 sites, each on their own domain, running under one django project. Currently all the sites have the same contact page, as provided by flatpages under the url /contact/. However it would be far nicer to create a contact page for each site, using the same url on each domain.

How can I achieve this with django's flatpages? (or should I look at something else?)


Solution

  • For 5 distinct contact pages, you might need 5 different flatpages entries:

    URL          Sites      Content
    /contact/    Site #1    Unique contact page for Site #1
    /contact/    Site #2    Unique contact page for Site #2
    /contact/    Site #3    Unique contact page for Site #3
    /contact/    Site #4    Unique contact page for Site #4
    /contact/    Site #5    Unique contact page for Site #5
    

    I guess you could also bypass flatpage and have one view with 5 different templates.