-
Use Django admin site to import data from different sources (CSV, JSON, ...) into the database.
-
Importing and Exporting the data from the website directly (without using the Django Admin Site).
-
Use the power of Folium to visualize data generated from Django Database on a Leaflet JS map.
-
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 django_and_folium
cd django_and_folium
-
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/local.txt
-
Create the database by running the following commands:
python manage.py makemigrations
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.
In this version I added the support of Importing and Exporting the data from the website directly (without using the Django Admin Site).