7f2e4d24dd
changes |
||
---|---|---|
.github/workflows | ||
CDC_Backend | ||
doc/setup | ||
.DS_Store | ||
.gitignore | ||
Email_service_README.md | ||
README.md | ||
nginx.conf | ||
requirements.txt | ||
setup.bat | ||
setup.sh | ||
start_backend_service.sh | ||
start_email_service.sh | ||
superuser.bat |
README.md
python# CDC - Backend
Setup
- Download the Repository to your local machine
- Make Sure u have downloaded python from python.org or windows store.
- Create a Virtual Environment in the CDC_Backend folder with this command below
python -m venv venv
- Activate the environment with this command
.\venv\Scripts\activate
(for WINDOWS)
source ./venv/bin/activate
(for LINUX) - Install the dependencies
pip install -r requirements.txt
- Ensure that you have the PostgreSQL installed on your machine and is running on PORT 5432
- Make sure to give the correct database credentials in settings.py(https://www.youtube.com/watch?v=bE9h6aAky4s&t=193s)
- 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
- Activate the environment with this command.
.\venv\Scripts\activate
(for WINDOWS)
source ./venv/bin/activate
(for LINUX) - Start the application by running this command (Run the command where manage.py is
located)
python manage.py runserver
Accessing the Admin Panel
- You can access the admin panel by running the server and opening http://localhost:8000/admin
- Run
python manage.py createsuperuser
to create a user to access the admin panel. - if there is an error due to time then sync your machine time .
- Set up the Username and Password
- You can log in and change the database values anytime.
- Create your id as insitute Roll No for both admin and student .
- 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
- Add the hosted domain name in
ALLOWED_HOSTS
in settings.py - Update the
CORS_ORIGIN_WHITELIST
list andCORS_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