Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
0d53086
let's try.....
arin17bishwa Dec 21, 2022
82c3fd7
updated requirements
arin17bishwa Dec 21, 2022
8b98beb
initial setup for django-prometheus
arin17bishwa Dec 21, 2022
9722583
added to models
arin17bishwa Dec 21, 2022
caf66a6
rebased after making events app live
arin17bishwa Dec 21, 2022
e2cbbcc
updated requirements
arin17bishwa Dec 21, 2022
d9605f6
initial setup for django-prometheus
arin17bishwa Dec 21, 2022
554929c
added to models
arin17bishwa Dec 21, 2022
85a9a65
final(hopefully) merge commit for rebasing
arin17bishwa Dec 23, 2022
8e7633a
modified behaviour of experience update.
arin17bishwa Dec 26, 2022
b9f3856
reformat
arin17bishwa Dec 26, 2022
a424efc
added base API url events
arin17bishwa Dec 26, 2022
2978603
fixed a misplaced ')'
arin17bishwa Dec 26, 2022
956a917
added get_absolute_url method
arin17bishwa Dec 27, 2022
71b24db
created API code
arin17bishwa Dec 27, 2022
54c11f2
added old mailing method(for future benchmarking)
arin17bishwa Dec 27, 2022
75cb8f8
added base URL for Team API
arin17bishwa Dec 27, 2022
3cab03c
added basic API for the team app
arin17bishwa Dec 27, 2022
0f2f354
Merge branch 'RECursion-NITD:testing' into trial_deployment
arin17bishwa Jan 2, 2023
a4a2774
added django-cors-headers and python-dateutil
arin17bishwa Jan 2, 2023
63e152e
added django-cors-headers specific configuration
arin17bishwa Jan 2, 2023
f09e72c
added home_view() for API
arin17bishwa Jan 22, 2023
84fa6db
added url for API home view
arin17bishwa Jan 22, 2023
825a9d2
reduced time range for upcoming_events to 7 days in future
arin17bishwa Jan 22, 2023
8df59ef
corrected authenticated user check
arin17bishwa Jan 22, 2023
8cb669c
increases max_events to 4
arin17bishwa Jan 22, 2023
b3d01dc
added postman API collection link
arin17bishwa Feb 9, 2023
ef33c22
Merge branch 'RECursion-NITD:testing' into trial_deployment
arin17bishwa Feb 12, 2023
133992b
Merge branch 'RECursion-NITD:testing' into trial_deployment
arin17bishwa Jun 5, 2023
bf3a91c
added django-rest-framework API
moinak878 Aug 8, 2023
a0eb788
added apis for content and subtopics
Sivam2313 Sep 28, 2023
bc5a746
[added] API for getting started
moinak878 Sep 29, 2023
c540fe1
api endpoints for google login
Sivam2313 Dec 4, 2023
13ba9e2
Merge branch 'dev-api' of https://github.com/Sivam2313/RECursionNITD-…
Sivam2313 Dec 4, 2023
8b6895e
added api endpoints for google login
Sivam2313 Dec 4, 2023
a9bf675
fixed api and route name
Sivam2313 Dec 6, 2023
c72ef9c
Merge branch 'RECursion-NITD:dev-api' into dev-api
Sivam2313 Dec 6, 2023
e455500
Merge pull request #190 from Sivam2313/dev-api
moinak878 Dec 8, 2023
e33486f
added views for roles and IE reviews filtering
Sivam2313 Mar 3, 2024
e330713
Merge branch 'dev-api' of https://github.com/Sivam2313/RECursionNITD-…
Sivam2313 Mar 3, 2024
429cc6d
changes
Sivam2313 Mar 5, 2024
5bdbd65
Merge pull request #192 from Sivam2313/dev-api
moinak878 Mar 5, 2024
50a6530
fix google login api
moinak878 May 29, 2024
4225ac0
created API to get alumni year wise
Shibshankar0909 Oct 27, 2024
d2d699e
Merge pull request #195 from Shibshankar0909/feature-shib-alumniAPI
Sivam2313 Oct 27, 2024
aa11ca4
deployment changes
apaul2077 Jan 9, 2025
d32babb
changes
apaul2077 Jan 9, 2025
4f08c83
New requirements for 3.11 python added,
apaul2077 Oct 20, 2025
7df4515
Login fixed
apaul2077 Oct 21, 2025
6067caf
changed footer content and fixed profile image problem
apaul2077 Oct 27, 2025
cc4a96f
missing profile picture fixed
apaul2077 Nov 12, 2025
9788dcc
content filter and rate limiting
apaul2077 Nov 29, 2025
7696f5f
Merge pull request #196 from apaul2077/dev-api
apaul2077 Nov 29, 2025
2008def
fixed team member icon hover and layout issue and some other change
apaul2077 Dec 11, 2025
785ee7e
Merge pull request #197 from apaul2077/dev-api
apaul2077 Dec 11, 2025
48f70d1
Made a few backend changes to facilitate registration and user creation
AayushAnand39 Dec 21, 2025
1f3d8fb
Password reset api fixed
ThunderEmperors Dec 24, 2025
e04f1ee
Merge pull request #198 from AayushAnand39/dev-api
apaul2077 Dec 25, 2025
e7ab379
fixed response for invalid password in password reset
ThunderEmperors Dec 25, 2025
d4626a6
fixed events_calendar api to send events in order
ThunderEmperors Dec 25, 2025
ea53ecc
Merge pull request #199 from ThunderEmperors/reset-api
apaul2077 Dec 28, 2025
4ee0fdf
made some changes to interview experience mailing
apaul2077 Jan 6, 2026
3c5766e
deployment changes
apaul2077 Jan 6, 2026
685ac78
Merge pull request #201 from apaul2077/dev-api
apaul2077 Jan 7, 2026
e57d532
fixed google login
apaul2077 Jan 9, 2026
e82af6d
Merge pull request #202 from apaul2077/dev-api
apaul2077 Jan 9, 2026
460d98b
finalised certain login/signup flow APIs, fixed password reset issue,…
apaul2077 Jan 18, 2026
71f8b1d
Merge pull request #203 from apaul2077/dev-api
apaul2077 Jan 18, 2026
304fd98
Feat: Add mobile client_type handling and deep-link redirects for use…
SuryaHalder Apr 12, 2026
4c3dfc2
Merge pull request #205 from SuryaHalder/dev-api
apaul2077 Apr 12, 2026
b03cde2
Revert "Feat: Add mobile client_type handling and deep-link redirects…
SuryaHalder Apr 14, 2026
f722106
Merge pull request #206 from SuryaHalder/dev-api
apaul2077 Apr 14, 2026
909bf7e
Feat: Enhance Google OAuth integration with client ID validation and …
asishghos Apr 17, 2026
909c091
Merge pull request #207 from SuryaHalder/dev-api
apaul2077 Apr 18, 2026
491e284
Feat: Improve Google Login validation by enhancing client ID checks a…
asishghos Apr 20, 2026
ce53b3a
Merge pull request #208 from SuryaHalder/dev-api
apaul2077 Apr 20, 2026
5789e4c
Update README with project setup and contribution instructions
Apr 29, 2026
8bf9367
Update README as per review suggestions
May 2, 2026
49886d5
Update README: add Python 3.11 install instructions
May 2, 2026
7ee60a4
Merge pull request #209 from Anin129/docs/update-readme
apaul2077 May 3, 2026
2d988f9
fix: media duplicacy code issue resolved
Master-Bruce-Wayne May 4, 2026
36d207a
Merge pull request #211 from Master-Bruce-Wayne/dev-api
apaul2077 May 5, 2026
290011e
Security patches: Fixed XSS via bleach sanitization and patched IDOR …
arpit000010 Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ website/db.sqlit
.env
.venv
env/
myEnv/
myenv/
venv/
ENV/
env.bak/
Expand All @@ -83,4 +85,7 @@ website/events_calendar/migrations/
website/migrations/

# Media files
media/
media/

staticfiles/
.agent/
188 changes: 172 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,180 @@
# RECursionNITD-website
# RECursion NITD Website Backend

steps to install
## Project Title

1. create python virtualenv
2. install all packages from requirements.txt
3. create .env file in project root (website/) with dbdetails
**RECursion NITD Website Backend**

sample:
## Functionalities

- User registration, login, and profile management
- Forum with questions, answers, and discussions
- Event creation, listing, updating, and details
- Interview experience sharing and browsing
- Blog content management
- Team member pages and team-related data
- Calendar-related event APIs
- Google social authentication
- Email notification support using SMTP
- REST API endpoints for frontend integration

## Tech Stack

- Python 3.11
- Django 3.2
- Django REST Framework
- Django Filters
- Django MarkdownX
- Django Prometheus
- social-auth-app-django
- dj-database-url
- python-decouple / python-dotenv

## Project Structure

- `requirements.txt` — project dependencies
- `website/` — Django application root
- `manage.py` — Django management script
- `website/` — project settings and URL configuration
- `settings.py` — application settings
- `urls.py` — root URL routing
- `wsgi.py` — WSGI entrypoint
- `blog/` — blog application
- `events/` — event management application
- `events_calendar/` — calendar API application
- `forum/` — forum application
- `getting_started/` — onboarding and guides app
- `team/` — team management app
- `user_profile/` — user profile and account app
- `interview_exp/` — interview experience app
- `utils/` — shared utilities

## Local Setup

### 1. Prerequisites

- Python 3.11
- pip
- Git
- Optional: Microsoft Visual C++ Build Tools if package compilation fails

#### Install Python 3.11

- Download Python 3.11 from the official website:
https://www.python.org/downloads/release/python-3110/
- *Windows (via winget)*: winget install -e --id Python.Python.3.11
- *macOS (via Homebrew)*: brew install python@3.11
- *Linux (Ubuntu/Debian)*: sudo apt update && sudo apt install python3.11 python3.11-venv


Verify Python version:

```python --version```

Expected output:

```Python 3.11.x```

### 2. Fork and Clone the Repository

- Go to:
https://github.com/RECursion-NITD/RECursionNITD-website

- Click Fork to create your own copy

- Clone your fork:

```
git clone https://github.com/<your-username>/RECursionNITD-website.git
cd RECursionNITD-website

Add upstream remote:

git remote add upstream https://github.com/RECursion-NITD/RECursionNITD-website.git
git remote -v

Checkout development branch:

git checkout dev-api
```
DB_NAME=HELLO_DJANGO
DB_USER=U_HELLO
DB_PASSWORD=hA8(scA@!fg3*sc&xaGh&6%-l<._&xCf
DB_HOST=127.0.0.1
DB_PORT=""

SOCIAL_AUTH_GOOGLE_OAUTH2_KEY='googlekey'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET='googleSECRET'
### 3. Create a virtual environment

```powershell
python -m venv venv
```

4. run ```python manage.py makemigrations```
5. run ```python manage.py migrate```
6. run ```python manage.py runserver```
### 4. Activate the virtual environment

```powershell
.\venv\Scripts\Activate.ps1
```

If you are using Command Prompt:

```cmd
venv\Scripts\activate.bat
```

### 5. Install dependencies

```powershell
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
```

### 6. Add the database file

Place the downloaded database file here:

```text
website/db.sqlite3
```

### 7. Extract media files

Extract the downloaded `media.zip` into the `website/` folder.

### 8. Create `website/.env`

Create the env file and add the required configuration values. Do not commit secrets.

### 9. Apply database migrations

```powershell
cd website
python manage.py makemigrations
python manage.py migrate
```

### 10. Collect static files

```powershell
python manage.py collectstatic --noinput
```

### 11. Run the development server

```powershell
python manage.py runserver
```

Open the site at:

```text
http://127.0.0.1:8000/
```

## Contribution

- Create a separate branch for each change: `git checkout -b feature/your-change`
- Keep pull requests focused and small
- Add a clear title and description for each PR
- Include testing or setup steps in the PR description
- Request review from the team or maintainer

## Notes

- Environment variables should be stored in `website/.env` and kept private.
- If `DATABASE_URL` is not provided, the project defaults to SQLite at `website/db.sqlite3`.
- If using SQLite locally, database host/user/password settings are not required.
- The frontend repository is separate: `https://github.com/RECursion-NITD/RECursionNITD-Frontend`
Binary file added old_requirements.txt
Binary file not shown.
Binary file modified requirements.txt
Binary file not shown.
7 changes: 0 additions & 7 deletions website/.env.example

This file was deleted.

9 changes: 5 additions & 4 deletions website/blog/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.contrib.auth.forms import UserCreationForm
from markdownx.fields import MarkdownxFormField
from markdownx.utils import markdownify
from utils.content_filter import sanitize_markdown

class Postform(forms.ModelForm):
title = models.CharField(max_length=100)
Expand All @@ -16,7 +17,7 @@ def clean_description(self):
data = self.cleaned_data['description']
if len(data)<20:
raise forms.ValidationError("Description too Short! Less than 20 words!")
data = markdownify(data)
data = sanitize_markdown(markdownify(data))
return data

class Meta:
Expand All @@ -42,7 +43,7 @@ class Replyform(forms.ModelForm):

def clean_description(self):
data = self.cleaned_data['description']
data = markdownify(data)
data = sanitize_markdown(markdownify(data))
return data


Expand All @@ -55,7 +56,7 @@ class Commentform(forms.ModelForm):

def clean_body(self):
data = self.cleaned_data['body']
data = markdownify(data)
data = sanitize_markdown(markdownify(data))
return data

class Meta:
Expand All @@ -67,7 +68,7 @@ class Comment_Replyform(forms.ModelForm):

def clean_body(self):
data = self.cleaned_data['body']
data = markdownify(data)
data = sanitize_markdown(markdownify(data))
return data

class Meta:
Expand Down
73 changes: 41 additions & 32 deletions website/blog/templates/blog/blog_list.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% load static %}
{% load blog_tags %}

{% for post in posts %}
<li class="col-sm-12 col-lg-12 ques_div mt-2 mb-1" id="content">
<ul id="attributeList">
Expand All @@ -7,56 +9,63 @@
<div class="col-sm-1 col-lg-1 mr-2">
{% for p in profile %}
{% if p.user == post.user_id %}
<img src="{{ p.image.url }}" class="rounded-circle mt-2 mb-1" width="55px" height="55px" alt="img">
{% if p.image %}
<img src="{{ p.image.url }}" class="rounded-circle mt-2 mb-1" width="55px" height="55px" alt="img">
{% else %}
<img src="{% static 'image/profile_pic/default.png' %}" class="rounded-circle mt-2 mb-1" width="55px" height="55px" alt="default">
{% endif %}
{% endif %}
{% endfor %}
</div>

<div class="col-lg-6 col-sm-12">
<div>
<a id="questionDetail" href="{% url 'blog:detail_blogs' post.id %}">
<a id="questionDetail" href="{% url 'blog:detail_blogs' post.id %}">
<strong>{{ post.title }}</strong>
</a>
<br>
</div>

<div id="addedBy" class="text-muted">
<li>Posted by <a href="{% url 'user_profile:view_profile' post.user_id.id %}">{{post.user_id}}</a> on</li>
<li>Posted by <a href="{% url 'user_profile:view_profile' post.user_id.id %}">{{ post.user_id }}</a> on</li>
</div>
<li id="postedOn" class="text-muted">{{post.created_at}}</li>

<li id="postedOn" class="text-muted">{{ post.created_at }}</li>
<br>

<li id="tagList">
<ul>
{% for tagging in taggings %}
{% if tagging.post == post %}
{% for tag in tags %}
{% if tagging.tag == tag %}
{% comment %} <li class="tagName" class="font-italic text-muted">{{tag.name}}</li> {% endcomment %}
<li style="display:inline-block;"><a class="tagName" href="{% url 'blog:filter_blog' tag.id %}">{{ tag.name }}</a></li>
{% endif %}
{% endfor %}
{%endif%}
{% for tagging in taggings %}
{% if tagging.post == post %}
{% for tag in tags %}
{% if tagging.tag == tag %}
<li style="display:inline-block;">
<a class="tagName" href="{% url 'blog:filter_blog' tag.id %}">{{ tag.name }}</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</li>
</div>
<!-- <div id="AnswerFollow_block" style="display: inline-block;"> -->
<div class="col-sm-5 col-md-3 col-lg-3 mt-auto mb-auto" id="answerBox" style="display: inline-block;">
<div class="row">
<div class="col-sm-6">
{%if post.reply_set.count == 1 %}
<span id="followValue" style="font-size:70%;">{{ post.reply_set.count }} comment
{%else %}
<span id="followValue" style="font-size:70%;">{{ post.reply_set.count }} comments
{%endif%}
</span>
</div>
<div class="col-sm-5 col-md-3 col-lg-6" id="followBox" style="display: inline-block;">
<span id="followValue" style="font-size:70%;">{{post.id|postlike_count}} vote(s)</span>
</div>
</div>

<div class="col-sm-5 col-md-3 col-lg-3 mt-auto mb-auto" id="answerBox" style="display:inline-block;">
<div class="row">
<div class="col-sm-6">
{% if post.reply_set.count == 1 %}
<span id="followValue" style="font-size:70%;">{{ post.reply_set.count }} comment</span>
{% else %}
<span id="followValue" style="font-size:70%;">{{ post.reply_set.count }} comments</span>
{% endif %}
</div>
<!-- </div> -->
</div>
<div class="col-sm-5 col-md-3 col-lg-6" id="followBox" style="display:inline-block;">
<span id="followValue" style="font-size:70%;">{{ post.id|postlike_count }} vote(s)</span>
</div>
</div>
</div>
</div>
</ul>
</li>
<hr>
{% endfor %}
<hr>
{% endfor %}
Loading