This is a web application built with Django 4.2 and MySQL that allows users to search for cars based on various criteria (length, weight, velocity, color) and download the search results in XML format.
- Search for cars using multiple criteria simultaneously.
- Download the search results as an XML file.
- Pagination support for search results.
- Fully tested to ensure software quality and execution.
- Python 3.x
- Django 4.2
- MySQL
-
Clone the repository:
git clone git@github.com:russell310/project_car.git cd project_car
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Configure the env:
Copy
.env.example
with.env
and add necessary settings for your environment -
Apply migrations:
python manage.py migrate
-
Load initial data:
python manage.py populate_cars 100
-
Run the development server:
python manage.py runserver
-
Access the application:
Open your web browser and go to http://localhost:8000/.
-
Search for Cars:
- Use the search form to filter cars based on length, weight, velocity, and color.
- Click the search button to view the results.
-
Download Search Results:
- Perform a search using the desired criteria.
- Click the "Export to XML" button to download the search results as an XML file.
To run the tests, use the following command:
coverage run manage.py test
coverage report
This will run the tests and provide a coverage report.
Run Flake8 to check for code style issues:
flake8 car
Run Bandit to check for security issues:
bandit -r car
locust -f car/locustfile.py --host=http://localhost:8000
Open your web browser and go to http://localhost:8089.
- Set the Number of total users to simulate (e.g., 100).
- Set the Hatch rate (number of users to spawn per second, e.g., 10).
- Click the Start swarming button to start the load test.
Monitor the performance metrics in the Locust web interface, including requests per second, response times, and number of failures.
Hamim Al Mahdi Russell
- Email: russell310@gmail.com
- LinkedIn: linkedin.com/in/russell310
- GitHub: github.com/russell310
- Web: hamim.dev
For any further questions or contributions, please contact me via email or LinkedIn.