Index: docs/ref/contrib/flatpages.txt
===================================================================
--- docs/ref/contrib/flatpages.txt	(revision 16906)
+++ docs/ref/contrib/flatpages.txt	(working copy)
@@ -134,6 +134,14 @@
 "Flatpages" section on the admin index page. Edit flatpages as you edit any
 other object in the system.
 
+.. admonition:: Manually check for duplicate flatpage URLs, if you are writing custom views for flatpages
+
+    In case you want to write custom views for manipulating flatpages, you
+    will need to check for duplicate flatpage URLs. You can add
+    ``from django.contrib.flatpages.forms import FlatPageForm`` in your
+    custom view to use a FlatPage ModelForm that throws a ValidationError
+    on finding flatpages with the same URL within a site.
+
 Via the Python API
 ------------------
 
@@ -148,6 +156,11 @@
 
 .. currentmodule:: django.contrib.flatpages
 
+.. admonition:: Manually check for duplicate flatpage URLs.
+
+    You will need to manually check for duplicate flatpage URLs within a site,
+    if you are adding flatpages via the Python API.
+
 Flatpage templates
 ==================
 
Index: django/contrib/flatpages/admin.py
===================================================================
--- django/contrib/flatpages/admin.py	(revision 16906)
+++ django/contrib/flatpages/admin.py	(working copy)
@@ -1,20 +1,8 @@
-from django import forms
 from django.contrib import admin
 from django.contrib.flatpages.models import FlatPage
 from django.utils.translation import ugettext_lazy as _
+from django.contrib.flatpages.forms import FlatpageForm
 
-
-class FlatpageForm(forms.ModelForm):
-    url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
-        help_text = _("Example: '/about/contact/'. Make sure to have leading"
-                      " and trailing slashes."),
-        error_message = _("This value must contain only letters, numbers,"
-                          " dots, underscores, dashes, slashes or tildes."))
-
-    class Meta:
-        model = FlatPage
-
-
 class FlatPageAdmin(admin.ModelAdmin):
     form = FlatpageForm
     fieldsets = (
Index: django/contrib/flatpages/tests/forms.py
===================================================================
--- django/contrib/flatpages/tests/forms.py	(revision 16906)
+++ django/contrib/flatpages/tests/forms.py	(working copy)
@@ -1,5 +1,5 @@
 from django.conf import settings
-from django.contrib.flatpages.admin import FlatpageForm
+from django.contrib.flatpages.forms import FlatpageForm
 from django.test import TestCase
 
 class FlatpageAdminFormTests(TestCase):
@@ -11,7 +11,7 @@
         }
 
     def test_flatpage_admin_form_url_validation(self):
-        "The flatpage admin form validates correctly validates urls"
+        "The flatpage admin form correctly validates urls"
         self.assertTrue(FlatpageForm(data=dict(url='/new_flatpage/', **self.form_data)).is_valid())
         self.assertTrue(FlatpageForm(data=dict(url='/some.special~chars/', **self.form_data)).is_valid())
         self.assertTrue(FlatpageForm(data=dict(url='/some.very_special~chars-here/', **self.form_data)).is_valid())
@@ -21,3 +21,9 @@
         self.assertFalse(FlatpageForm(data=dict(url='/a ! char/', **self.form_data)).is_valid())
         self.assertFalse(FlatpageForm(data=dict(url='/a & char/', **self.form_data)).is_valid())
         self.assertFalse(FlatpageForm(data=dict(url='/a ? char/', **self.form_data)).is_valid())
+
+    def test_flatpage_admin_form_url_uniqueness_validation(self):
+        "The flatpage admin form correctly enforces url uniqueness among flatpages of the same site"
+        FlatpageForm(data=dict(url='/myflatpage1', **self.form_data)).save()
+
+        self.assertFalse(FlatpageForm(data=dict(url='/myflatpage1', **self.form_data)).is_valid())
Index: django/contrib/flatpages/forms.py
===================================================================
--- django/contrib/flatpages/forms.py	(revision 0)
+++ django/contrib/flatpages/forms.py	(revision 0)
@@ -0,0 +1,26 @@
+from django import forms
+from django.utils.translation import ugettext_lazy as _
+from django.contrib.flatpages.models import FlatPage
+
+class FlatpageForm(forms.ModelForm):
+    url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
+        help_text = _("Example: '/about/contact/'. Make sure to have leading"
+                      " and trailing slashes."),
+        error_message = _("This value must contain only letters, numbers,"
+                          " dots, underscores, dashes, slashes or tildes."))
+
+    class Meta:
+        model = FlatPage
+
+    def clean(self):
+        url = self.cleaned_data.get('url', None)
+        sites = self.cleaned_data.get('sites', None)
+
+        flatpages_with_same_url = FlatPage.objects.filter(url=url)
+
+        if flatpages_with_same_url.filter(sites__in=sites).exists():
+            for site in sites:
+                if flatpages_with_same_url.filter(sites=site).exists():
+                    raise forms.ValidationError(_('Flatpage with url %s already exists for site %s' % (url, site)))
+
+        return super(FlatpageForm, self).clean()
