yes I also have the folder name “OSGeo4W”.
i have tried to change the envirnoment variables as suggested Geodjango Documentation
set OSGEO4W_ROOT=C:\OSGeo4W64
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%OSGEO4W_ROOT%\bin
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /f /d "%PATH%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v GDAL_DATA /t REG_EXPAND_SZ /f /d "%GDAL_DATA%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROJ_LIB /t REG_EXPAND_SZ /f /d "%PROJ_LIB%"
to
set OSGEO4W_ROOT=C:\OSGeo4W
set GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%OSGEO4W_ROOT%\bin
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /f /d "%PATH%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v GDAL_DATA /t REG_EXPAND_SZ /f /d "%GDAL_DATA%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROJ_LIB /t REG_EXPAND_SZ /f /d "%PROJ_LIB%"
but still i have the same problem
GDAL_ERROR 1: b'PROJ: proj_create_from_database: Cannot find proj.db'
Internal Server Error: /admin/world/worldborder/add/
Traceback (most recent call last):
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\core\handlers\exception.py", line 56, in inner
response = get_response(request)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\admin\options.py", line 686, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\utils\decorators.py", line 134, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\views\decorators\cache.py", line 62, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\admin\sites.py", line 242, in inner
return view(request, *args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\admin\options.py", line 1891, in add_view
return self.changeform_view(request, None, form_url, extra_context)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\utils\decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\utils\decorators.py", line 134, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\admin\options.py", line 1751, in changeform_view
return self._changeform_view(request, object_id, form_url, extra_context)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\admin\options.py", line 1797, in _changeform_view
form_validated = form.is_valid()
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\forms\forms.py", line 205, in is_valid
return self.is_bound and not self.errors
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\forms\forms.py", line 200, in errors
self.full_clean()
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\forms\forms.py", line 437, in full_clean
self._clean_fields()
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\forms\forms.py", line 449, in _clean_fields
value = field.clean(value)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\forms\fields.py", line 90, in clean
geom.transform(self.srid)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\geos\geometry.py", line 496, in transform
g = gdal.OGRGeometry(self._ogr_ptr(), srid)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\geometries.py", line 123, in __init__
self.srs = srs
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\geometries.py", line 289, in _set_srs
sr = SpatialReference(srs)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\srs.py", line 114, in __init__
self.import_epsg(srs_input)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\srs.py", line 300, in import_epsg
capi.from_epsg(self.ptr, epsg)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\prototypes\errcheck.py", line 120, in check_errcode
check_err(result, cpl=cpl)
File "C:\Users\Utente\Desktop\imparare_django\geodjango\v_env\lib\site-packages\django\contrib\gis\gdal\error.py", line 59, in check_err
raise e(msg)
django.contrib.gis.gdal.error.GDALException: OGR failure.