This is a Django app powered by the Django Rest Framework (DRF) that provides a sample of a simple streaming endpoint with HTTP streaming of a CSV file generation.
These instructions will help you set up and run the project on your local machine for development and testing purposes.
Before you begin, make sure you have the following installed:
- Python (3.x recommended)
- pip (Python package manager)
- Virtual environment (optional but recommended) like pipenv
-
Clone the repository:
git clone https://github.com/megatux/drf-streaming-csv-example.git
1. Navigate to the project directory:
```bash
cd drf-streaming-csv-example
- Create a virtual environment (optional but recommended):
python -m venv venv
- Activate the virtual environment (if created):
On Windows:
venv\Scripts\activate
On macOS and Linux:
source venv/bin/activate
- Install project dependencies:
pipenv install --dev
- Run database migrations:
python manage.py migrate
- Create a superuser account for admin access (follow the prompts):
python manage.py createsuperuser
- Running the Development Server
Start the development server:
python manage.py runserver
The app will be available at http://localhost:8000/.
You can use a tool like curl to hit the endpoint, for example:
curl -vv --raw "http://127.0.0.1:8000/users/streaming_view/"
To run tests, use the following command:
pytest
If you would like to contribute to this project, please follow our contribution guidelines.
This project is licensed under the GNU General Public License (GPL) version 3.
Django Django Rest Framework
If you have any questions or need assistance, please contact me.