@@ -0,0 +1,1228 @@
+# -*- coding: utf-8 -*-%0A%0Aimport os%0Afrom aldryn_client import forms%0A%0Aclass Form(forms.BaseForm):%0A%0A    def to_settings(self, cleaned_data, settings_dict):%0A%0A    %09country_mw = 'country_segment.middleware.ResolveCountryCodeMiddleware'%0A    %09if country_mw not in settings_dict%5B'MIDDLEWARE_CLASSES'%5D:%0A    %09%09for position, mw in enumerate(settings_dict%5B'MIDDLEWARE_CLASSES'%5D):%0A    %09%09%09#%0A    %09%09%09# Its not a strict requirement that the%0A    %09%09%09# ResolveCountryCodeMiddleware go after SessionMiddleware,%0A    %09%09%09# but, it seems like a pretty nice place.%0A    %09%09%09#%0A    %09%09%09if mw == 'django.contrib.sessions.middleware.SessionMiddleware':%0A%09%09    %09%09settings_dict%5B'MIDDLEWARE_CLASSES'%5D.insert(position + 1, country_mw)%0A    %09%09%09%09break;%0A    %09%09else:%0A    %09%09%09#%0A    %09%09%09# B'okay, not sure how this CMS installation works, but...%0A    %09%09%09# let's just put it at the top.%0A    %09%09%09#%0A    %09%09%09settings_dict%5B'MIDDLEWARE_CLASSES'%5D.insert(0, country_mw)%0A%0A    %09#%0A    %09# Now, add the location of the GeoIP.dat file, which needs to be%0A    %09# sync'ed to Aldryn. in the same parent folder that contains the%0A    %09# project folder.%0A    %09#%0A        settings_dict%5B'GEOIP_PATH'%5D = os.path.join(os.path.dirname(os.path.dirname(__file__)), '/GeoIP.dat', )%0A        return settings_dict

Add settings via aldryn_config.py