Documentation for Django version of Rizz

Structure

When you extract the zip file you received after purchasing, you will find the following files and folders:


├── config
│   ├── settings
│   │    ├── base.py
│   │    ├── local.py
│   │    └── production.py
│   └── urls.py - all the urls
├── rizz
│   ├── static
│   │   └── source
│   │       ├── css
│   │       ├── fonts
│   │       ├── images
│   │       └── js
│   ├── templates
│   │   └── all the html pages
│   └── all the django apps
├── requirements
│   ├── base.txt
│   ├── local.txt
│   └── production.txt
├── utility
├── bun.lockb
├── db.sqlite3
├── gulpfile.js
├── manage.py
├── package-lock.json
├── package.json
└── yarn.lock
Prerequisites

Please follow below steps to install and setup all prerequisites:

  • Node.js

    In order to use build tools you will need to download and install Node.js. If you do not have Node.js installed already, you can get it by downloading the package installer from the official website. Please download the stable version of Node.js (LTS).

    Download Node.js
  • Gulp

    Make sure to have the Gulp installed & running in your computer. If you already have installed gulp on your computer, you can skip this step. In order to install, just run command npm install -g gulp from your terminal.

  • Python

    Make sure to have the Python installed & running in your computer. If you already have installed Python on your computer, you can skip this step. Please use Python version 3 or if you are using python version 2 then make sure to run all the below commands with python insted of python3.

    For windows

    • Download python from windows store
    • Select the Python's version to download.
    • Click on the Install Now
    • Installation in Process

    For Linux

    • sudo apt update
    • sudo apt install python3
  • Virtualenv

    Make sure to have the virtualenv installed globally & running on your computer. If you already have installed on your computer, you can skip this step.

    • Virtualenv installation command for linux & mac os
      python3 -m pip install --user virtualenv
    • Virtualenv installation command for Windows
      py -m pip install --user virtualenv
Installation

To setup, follow the below mentioned steps:

You can run the following commands to run project locally or build for production use:

You can run this app following package manager: Bun, Yarn or NPM

1. Bun

If you don't have bun installed on your PC, use the npm i -g bun or sudo npm i -g bun to install

Command Description
bun i
This would install all required dependencies in node_modules folder.
bun dev Runs the project locally, starts the development server.
bun run build It bundles assets into the static directory. Your app is now ready to be deployed. We recommend to run this command before starting django server.
2. Yarn

If you don't have yarn installed on your PC, use the next command npm i -g yarn or sudo npm i -g yarn

Command Description
yarn
This would install all required dependencies in node_modules folder.
yarn dev Runs the project locally, starts the development server.
yarn build It bundles assets into the static directory. Your app is now ready to be deployed. We recommend to run this command before starting django server.
3. NPM

npm comes preinstalled when you install Nodejs

Command Description
npm i or npm i --force
This would install all required dependencies in node_modules folder.
npm run dev Runs the project locally, starts the development server.
npm run build It bundles assets into the static directory. Your app is now ready to be deployed. We recommend to run this command before starting django server.

To spin up the Django development server, follow the below mentioned steps in a separate terminal:

Command Description
python3 -m venv environment_name
Create Virtual Environment on Linux & macOS
python -m venv environment_name
Create Virtual Environment on Windows OS
source environment_name/bin/activate
Activate Environment on Linux & macOS
environment_name/Scripts/activate
Activate Environment on Windows OS
pip install -r requirements/local.txt
This would install all the required python dependencies.
python3 manage.py migrate
Run the migration to sync the database on Linux & macOS
python manage.py migrate
Run the migration to sync the database on Windows OS
python3 manage.py runserver
Starts the local server on localhost:8000 on Linux & macOS
python manage.py runserver
Starts the local server on localhost:8000 on Windows OS

Note:

  • During Development, keep the Vite's development server running through any of the above dev commands and then run the python's runserver command in a separate terminal.
  • For Production, create a production build with any of the above build commands and then run the python's runserver command.