The application system connects students to the internships they are interested in and gives companies a structured workflow for reviewing candidates. Students submit applications with a single click; companies receive instant in-app notifications and can then filter, review, and action each application. A database-level uniqueness constraint ensures a student can never accidentally submit two applications to the same internship, and the same protection is mirrored at the view level usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/unesexact/internship-portal-django/llms.txt
Use this file to discover all available pages before exploring further.
get_or_create.
Application Model
Every application is a record linking astudent user to an internship, with a status field that progresses from pending through to accepted or rejected.
Auto-incrementing primary key.
The student who submitted the application. Accessible in reverse as
user.applications.all(). Deleting the user cascades and removes all their applications.The internship being applied to. Accessible in reverse as
internship.applications.all(). Deleting the internship cascades and removes all related applications.Current state of the application. One of
"pending", "accepted", or "rejected". Defaults to "pending" on submission. Updated by the owning company via POST /applications/<id>/<status>/.Timestamp set automatically when the application is first submitted (
auto_now_add=True). Read-only after creation.unique_together constraint on (student, internship) that is enforced at the database level:
(student, internship) pair, regardless of how the insert originates.
URL Routes
All application routes are mounted under the/applications/ prefix.
| Method | Path | View | Description |
|---|---|---|---|
POST | /applications/apply/<internship_id>/ | apply_internship | Submit an application (student) |
GET | /applications/my/ | my_applications | Student’s own application list |
GET | /applications/company/ | company_applications | All applications received by the company |
POST | /applications/<id>/<status>/ | update_application | Set status to accepted or rejected (company) |
POST | /applications/notifications/read/ | mark_notifications_read | Mark all unread notifications as read |
Application Submission
When a student clicks Apply on a listing, theapply_internship view uses Django’s get_or_create to either create a fresh application or silently retrieve the existing one. This mirrors the database constraint at the application layer, so the view never raises an IntegrityError and can give the user a helpful feedback message instead:
- If
createdisTrue→ a newApplicationrow was inserted, a success message is shown, and the company receives a notification. - If
createdisFalse→ the student already has an application for this internship; an info message is shown and no duplicate is created.
Status Filtering
The company applications view atGET /applications/company/ accepts an optional ?status= query-string parameter. When present and not "all", it narrows the queryset to applications in that state:
| Value | URL | Result |
|---|---|---|
all (default) | GET /applications/company/ | Every application across all listings |
pending | GET /applications/company/?status=pending | Only unreviewed applications |
accepted | GET /applications/company/?status=accepted | Only accepted candidates |
rejected | GET /applications/company/?status=rejected | Only rejected candidates |
Accepting and Rejecting
A company updates an application’s status by posting toPOST /applications/<id>/<status>/. The view first verifies that the logged-in user owns the internship linked to this application, then validates the status value before saving:
- The
Application.statusfield is updated to"accepted"or"rejected". - A
Notificationrecord is created for the student informing them of the outcome.