## Prerequisites
Before you begin, ensure you have the following:
- A running instance of Ubuntu 24.04.1 LTS
- Sudo privileges
## Step 1: Update System Packages
Update your system packages to the latest version:
```sh
sudo apt update
sudo apt upgrade
Install Apache2 and its development package:
sudo apt install apache2
sudo apt install apache2-dev
Install the Python development package:
sudo apt install python3-dev
Download and install mod_wsgi:
wget https://files.pythonhosted.org/packages/e9/02/36597a3e2478e20ec55432dd153fd23067d2dc5ec736ae16ccc08905f8cb/mod_wsgi-5.0.1.tar.gz
tar -xvf mod_wsgi-5.0.1.tar.gz
cd mod_wsgi-5.0.1
export PYTHON_PATH=/usr/bin/python3
./configure
make
sudo make install
Set the correct permissions for the mod_wsgi module:
sudo chmod 644 /usr/lib/apache2/modules/mod_wsgi.so
Create the wsgi.load
file:
sudo vi /etc/apache2/mods-available/wsgi.load
Add the following line to the file:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
Enable the wsgi
module and restart Apache:
sudo a2enmod wsgi
sudo systemctl restart apache2
Verify that the wsgi
module is enabled:
apache2ctl -M | grep wsgi
Install Django and related packages:
python -m pip install Django djangorestframework django-cors-headers
Navigate to your project directory and set up a new Django project:
cd cloudb
django-admin startproject api_root .
python3 manage.py startapp api_rest
python3 manage.py runserver
Apply the initial migrations for your Django app:
python manage.py makemigrations api_rest
python manage.py migrate
Create a superuser for your Django admin:
python manage.py createsuperuser
Follow the prompts to set the username and password for the superuser.
Instalar o NODE JS
https://nodejs.org/dist/v22.11.0/node-v22.11.0-linux-x64.tar.xz
export NODEJS_HOME=/home/joao/django-cloudb/cloudboosting/node-v22.11.0-linux-x64/bin
export PATH=$NODEJS_HOME:$PATH
python cloudb/manage.py tailwind init
python cloudb/manage.py tailwind install
python cloudb/manage.py tailwind start
https://stackoverflow.com/questions/67938486/after-installing-npm-on-wsl-ubuntu-20-04-i-get-the-message-usr-bin-env-bash
chmod -R a+x node_modules
FOR PRODUCTION USE
python cloudb/manage.py tailwind build
https://pypi.org/project/django-q2/
python cloudb/manage.py qcluster