This Django backend application is designed to manage IP security cameras, facial recognition and handle API calls, particularly for processing Real-Time Streaming Protocol (RTSP) streams.
To ensure a clean and isolated environment, create and activate a virtual environment using the following commands:
python -m venv venv
venv\Scripts\activate.bat
Install the necessary project dependencies by running the command:
pip install -r requirements.txt
Redis is not officially supported on Windows, but you can install it through the Windows Subsystem for Linux (WSL). Here are the steps to get Redis running on WSL:
-
Enable WSL2
Microsoft provides detailed instructions for installing WSL. You can follow this guide here and take note of the default Linux distribution it installs. This guide assumes the default distribution to be Ubuntu.
-
Install Redis on WSL
Once you're running Ubuntu on Windows, follow the steps below to install recent stable versions of Redis from the official
packages.redis.io
APT repository:curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update sudo apt-get install redis
-
Start the Redis Server
Start the Redis server using the following command:
sudo service redis-server start
-
Connect to Redis
You can test that your Redis server is running by connecting with the Redis CLI:
redis-cli 127.0.0.1:6379> ping PONG
python manage.py makemigrations
python manage.py migrate
Redis is required for the server to run properly. After installing the dependencies, you can start the development server using the command:
python manage.py runserver