Hi,
Some month ago, I start learning Django and I could build an App.
Due to a new job opportunity, I had to postpone that job and additional, I had the replace my laptop (mac). I kept all my Django files, but I laso need to reinstall Django on my new laptop.
The problem, I do remember about some steps, because I stupidly badly kept some note grrr.
I remember of those two commands
python3 manage.py makemigrations
python3 manage.py migrate
For now,
- I installed Django 4.1.4
- I imported my database with existing tables and a lot of measures
- I configured my settings.py file to match to my database
My models.py file is still empty.
The first question:
I ran
./manage.py inspectdb
and I was surprised to have this error message
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried “gdal”, “GDAL”, “gdal3.4.0”, “gdal3.3.0”, “gdal3.2.0”, “gdal3.1.0”, “gdal3.0.0”, “gdal2.4.0”, “gdal2.3.0”, “gdal2.2.0”). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
gdal is geospacial library. Is a mandatory library??? What’s the reason of this message?
Second question:
As I want to update my models.py file according to my existing database, I do not remember of those commande work as well
python3 manage.py makemigrations
python3 manage.py migrate
As far as I remember, it will update my database acording to my models.py file, that right?
Is it
./manage.py inspectdb > models.py
or something close to it?
many thanks