xahin96 / GenZ

0 stars 0 forks source link

Install bootstrap

GenZ Project

This project is a Django application with Celery for background task processing and Redis as the message broker.

Requirements

Installation

macOS

  1. Install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install Redis:

    brew install redis
    brew services start redis
  3. Clone the repository and navigate to the project directory:

    git clone <repository-url>
    cd <project-directory>
  4. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
  5. Install Python dependencies:

    pip install -r Requirements.txt
  6. Run database migrations:

    python manage.py migrate
  7. Start the Django development server:

    python manage.py runserver
  8. Start Celery worker:

    celery -A GenZ worker -l info

Linux

  1. Install Redis:

    sudo apt update
    sudo apt install redis-server
    sudo systemctl enable redis-server.service
    sudo systemctl start redis-server.service
  2. Clone the repository and navigate to the project directory:

    git clone <repository-url>
    cd <project-directory>
  3. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
  4. Install Python dependencies:

    pip install -r Requirements.txt
  5. Run database migrations:

    python manage.py migrate
  6. Start the Django development server:

    python manage.py runserver
  7. Start Celery worker:

    celery -A GenZ worker -l info

Windows

  1. Install Redis:

  2. Clone the repository and navigate to the project directory:

    git clone <repository-url>
    cd <project-directory>
  3. Create and activate a virtual environment:

    python -m venv .venv
    .venv\Scripts\activate
  4. Install Python dependencies:

    pip install -r Requirements.txt
  5. Run database migrations:

    python manage.py migrate
  6. Start the Django development server:

    python manage.py runserver
  7. Start Celery worker:

    celery -A GenZ worker -l info

Configuration

Ensure the following settings are present in your settings.py:


# Celery settings
CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'UTC'