Before installing any packages, activate your virtual environment:
# Activate your virtual environment (example command)
source /path/to/your/venv/bin/activate
Install the required packages listed in requirements.txt
using pip:
pip install -r requirements.txt
Due to lack of support for Django 3.1.3, apply the following hotfix:
sed -i 's/from django.contrib.staticfiles.templatetags.staticfiles import static/from django.templatetags.static import static/g' "/path/to/your/venv/lib/python3.10/site-packages/fontawesome/templatetags/fontawesome.py"
Follow these steps to install Redis:
-
Download and Build Redis:
wget https://download.redis.io/redis-stable.tar.gz tar xzvf redis-stable.tar.gz cd redis-stable make make install
- For shared hosting, use:
PREFIX=$HOME/.local make PREFIX=$HOME/.local make install
-
Add Redis to your Bash Configuration:
echo "alias redis-server=$HOME/.local/bin/redis-server" >> ~/.bashrc source ~/.bashrc
-
Create a Configuration File: Create a file named
6379.conf
with the following content:port 6379 daemonize yes save 60 1 bind 127.0.0.1 tcp-keepalive 300 dir /home/username/my-path/my-folder dbfilename dump.rdb rdbcompression yes pidfile redis.pid logfile "redis.log"
-
Parameters Explained:
port
: The port Redis will use (default is 6379).daemonize
: Use this option to run Redis in the background.bind
: The address the Redis server will bind to.dir
: Directory to store Redis files.dbfilename
: Name of the Redis database file.pidfile
: File to store the Redis server process ID.logfile
: File to store Redis logs.
-
Start Redis:
redis-server /path/to/conf/6379.conf
- Check Redis Logs:
head -20 /home/username/my-path/my-folder/redis.log
-
-
Install the Redis Python Connector: With your virtual environment activated, run:
pip install redis
-
Start a New Celery Worker: Make sure you are in the
src
folder and execute:python -m celery -A app_dq_kit worker --loglevel=INFO --concurrency=1
Define the following environment variables:
export REDIS_ADDR=
export REDIS_PORT=
Start the Django application:
python src/manage.py runserver
- Install Python 3.10.
- Install Microsoft Build Tools for C++.
- Ensure you have Microsoft Visual C++ 14.0 or greater.
Make sure to use a virtual environment.
Install the required packages listed in requirements.txt
:
pip install -r requirements.txt
Manually change a line in the FontAwesome package. Open the file:
PATH_TO_VENV/Lib/site-packages/fontawesome/templatetags/fontawesome.py
and change:
from django.contrib.staticfiles.templatetags.staticfiles import static
to:
from django.templatetags.static import static
Since Windows doesn't support the official Redis build, follow the instructions at: Install Redis on Windows.
Make sure you are in the src
folder and run:
python -m celery -A app_dq_kit worker --loglevel=INFO --concurrency=1
Set the following script path and parameters:
- Script path:
src/manage.py
- Parameter:
runserver
You need to set some environment variables. Open the system settings on Windows, navigate to User Accounts, and change your personal environment settings without admin privileges.