Go to file
Jaya Surya P 4c248be3a5
Merge pull request #204 from CDC-IITDH/nitin
fixed stats
2024-09-26 17:00:02 +05:30
.github/workflows fixed errors 2023-10-19 04:29:52 +05:30
CDC_Backend fixed stats 2024-09-26 12:18:55 +05:30
doc/setup Update postgres.md 2023-05-02 00:49:01 +05:30
.DS_Store changes for new config 2024-07-25 19:58:26 +05:30
.gitignore resolved merge conflicts 2024-08-06 15:16:09 +05:30
Email_service_README.md Prod (#141) 2022-09-12 11:24:50 +05:30
README.md Merge branch 'main' into Abhishek28112002-patch-1 2023-05-30 15:03:39 +05:30
nginx.conf resolved merge conflicts 2024-08-06 15:16:09 +05:30
requirements.txt updated requirements.txt 2024-05-29 14:38:25 +05:30
setup.bat creating db command added 2022-06-06 19:03:04 +05:30
setup.sh resolved merge conflicts 2024-08-06 15:16:09 +05:30
start_backend_service.sh resolved merge conflicts 2024-08-06 15:16:09 +05:30
start_email_service.sh resolved merge conflicts 2024-08-06 15:16:09 +05:30
superuser.bat Update superuser.bat 2022-06-06 19:25:25 +05:30

README.md

python# CDC - Backend


Setup

  1. Download the Repository to your local machine
  2. Make Sure u have downloaded python from python.org or windows store.
  3. Create a Virtual Environment in the CDC_Backend folder with this command below
    python -m venv venv
  4. Activate the environment with this command
    .\venv\Scripts\activate (for WINDOWS)
    source ./venv/bin/activate (for LINUX)
  5. Install the dependencies
    pip install -r requirements.txt
  6. Ensure that you have the PostgreSQL installed on your machine and is running on PORT 5432
  7. Make sure to give the correct database credentials in settings.py(https://www.youtube.com/watch?v=bE9h6aAky4s&t=193s)
  8. Run these following commands below. (The same are there in setup.sh for linux users and setup.bat for windows users)
python manage.py flush --no-input
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic --noinput
mkdir Storage
python manage.py makemigrations APIs

Running the Application

  1. Activate the environment with this command.
    .\venv\Scripts\activate (for WINDOWS)
    source ./venv/bin/activate (for LINUX)
  2. Start the application by running this command (Run the command where manage.py is located)
    python manage.py runserver

Accessing the Admin Panel

  1. You can access the admin panel by running the server and opening http://localhost:8000/admin
  2. Run python manage.py createsuperuser to create a user to access the admin panel.
  3. if there is an error due to time then sync your machine time .
  4. Set up the Username and Password
  5. You can log in and change the database values anytime.
  6. Create your id as insitute Roll No for both admin and student .
  7. if you are still getting an error ,open inspect and see in network And then recognize it 8.Check the client link in dev.env in backend and .env in frontend is the same

Error

1.make sure that your machine time and google time are same ,if not go to setting of date and time and sync this 2.make sure u have used same id for both student and Admin that is your iitfh roll_no 3. same client link in .env of frontend or constants.py of bakcend

Deploying

  1. Add the hosted domain name in ALLOWED_HOSTS in settings.py
  2. Update the CORS_ORIGIN_WHITELIST list and CORS_ORIGIN_ALLOW_ALL variable

Starting the Email Server

Run the following command to start the email backend process
python manage.py process_tasks

API Reference

Check here for Api Reference

For Documentation with Postman Collection, click here