Commits

Chris Beaven  committed 3043f12

Add the missing settings module. Fixes #1.

  • Participants
  • Parent commits 7733617

Comments (0)

Files changed (1)

File django_countries/settings.py

+from django.conf import settings
+
+
+def _build_flag_url():
+    if hasattr(settings, 'COUNTRIES_FLAG_URL'):
+        url = settings.COUNTRIES_FLAG_URL
+    else:
+        url = 'flags/%(code)s.gif'
+    prefix = getattr(settings, 'STATIC_URL', '') or settings.MEDIA_URL
+    if not prefix.endswith('/'):
+        prefix = '%s/' % prefix
+    return '%s%s' % (prefix, url)
+
+
+FLAG_URL = _build_flag_url()