This Django project allows users to upload large CSV files, update the database with the uploaded file's contents, and filter the data using a web interface. The project includes features like dynamic form fields populated from the database and visual progress bars during file uploads.
- CSV Upload: Upload large CSV files to update the database.
- Dynamic Filtering: Filter data dynamically based on fields like industry, city, state, country, and year founded.
- Progress Bar: Visual progress bar during CSV file uploads.
- Admin Interface: View and manage uploaded data through the Django admin interface.
- Python 3.8+
- Django 3.2+
- PostgreSQL
Django-environfor environment variable management
-
Clone the repository:
git clone https://github.com/yourusername/django-csv-query-builder.git cd catalyst-count -
Create and activate a virtual environment:
python -m venv venv source venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables: Create a .env file in the project root and add the following environment variables:
SECRET_KEY=your_secret_key DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DBNAME
-
Run database migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the admin interface: Visit
http://127.0.0.1:8000/adminand log in with your superuser credentials. -
Upload CSV files: Go to the upload data page and select a file to upload. The progress bar will display the upload status

-
Filter data: Use the filter form on the main page to dynamically filter the data based on available options.

-
Download CSV: Click on the Download CSV button to download the CSV file of the API result.

- POST /query_builder/api/query-builder/: Filter data based on selected criteria.
- Navigate to the CSV upload page.
- Upload your CSV file and wait for the progress bar to complete.
- Filter Data
- Use the form to select your filter criteria.
- Submit the form to see the count of records matching the criteria.