form.fields['Polygon'].widget.params['default_lon'] = -80.9
form.fields['Polygon'].widget.params['default_lat'] = 33.7
form.fields['Polygon'].widget.params['default_zoom'] = 11
form.fields['Polygon'].widget.params['wms_name'] = YOURWMSLayerName
form.fields['Polygon'].widget.params['map_width'] = 800
form.fields['Polygon'].widget.params['map_height'] = 600
form.fields['Polygon'].widget.params['map_srid'] = YOUR_SRID
form.fields['Polygon'].widget.params['modifiable'] = True
form.fields['Polygon'].widget.params['map_options'] = {}
form.fields['Polygon'].widget.params['map_options']['buffer'] = 0
return form
How to display data using openlayers with OpenStreetMap in geodjango?