-
Use the power of Folium to visualize data generated from Django Database on a Leaflet JS map.
-
Use Django Admin Site to Import and Export data into and from the database.
-
Visualize data using Folium's Simple Markers and Marker Cluster.
The data used in this project is downloaded from the Seattle City Open Data website, The following Datasets are used:
-
Clone the repository: git clone https://github.com/MoustafaShaaban/Django_and_Folium.git
-
Change directory to Version_1
cd Version_1
-
Open the terminal or CMD to create a virtual environment like Python virtual environment (venv) or pipenv and activate it.
-
python -m venv venv
Create the venv -
source venv/bin/activate
On Linux -
venv/Scripts/activate
On Windows -
source venv/Scripts/activate
Git Bash on Windows
-
-
Install requirements.txt:
python -m pip install -r requirements.txt
-
Create the database by running the following commands:
python manage.py makemigrations seattle
python manage.py migrate
-
Create a super user:
python manage.py createsuperuser
-
Login to the admin site with your super user and add the data in 'seattle/data' folder using the import functionality in each model.
-
Run the project:
python manage.py runserver
In this version I improved the code by combining all the data in one Django Function View to show it in one map.
Added Layer Control functionality to switch between different layers.
Changed the default style of the Markers and used font awesome icons:
* ` h-square ` Icon for Hospitals Layer.
* ` graduation-cap ` Icon for Public Schools Layer.
* ` book ` Icon for Public Libraries Layer.