Assignments, previous year quies, exam papers and everything that you will need to master your college courses uploaded to one place!
Watch this video for a quick demo:
https://www.youtube.com/watch?v=yLyamBgmdCw
Highly recomended to watch this before going through the documentation.
Refer to the idea list at idea_list.md
Server: Django 4.0.1, SQLite3
Client: BootStrap5, HTML, CSS, JS
1)Run Locally
2)Basic structure and URL paths
3)URL paths
4)Database
5)Forms
6)Views
7)Static and Templates
Make sure that computer has Python 3.8 or higher version and Django 4.0.1 or higher version
Clone the project
git clone https://github.com/nitheezkant/iiitbONE.git
Create Superuser
python3 manage.py createsuperuser Database Migrations
python3 manage.py makemigrations python3 manage.py migrate Start the server
python3 manage.py runserveriiitbOne is the project file that contains the settings.py.
core is the core app of the whole website.
static contains all the static files.
media/rc stores all the user uploaded files.
templates contains the main templete that is extended to all the pages.
urls.py in iiitbOne directly points to urls.py inside the core directory.
If you use /admin, you can access the Django admin panel.
All the URLs in core/urls.py has been listed below.
| URL | Use |
|---|---|
| / | Landing page |
| login/ | Login page |
| signup/ | Sign up page |
| home/ | Home page after signup/signin |
| upload/ | Upload form page |
| clist/ | List of courses |
| semc/< str:pk>/ | Change semester of user to pk |
| tlist/< str:pk>/ | List of Types of Resourses, pk is course name |
| lisst/< str:pk>/< str:pkk> | List of resourses of course pk and type pkk |
| info/< str:pk>/ | Information page of resourse with id pk |
| srh/ | Search engine page |
| atf/ | Add to favourites |
| fav/ | Favourites list page |
| logout/ | Logout |
There are 6 models, location of python code: core/models.py
1)Django USER Model
This model stores
-
Roll number in
usernamefield -
Password in
passwordfield
2)Profile Model
This model has a one one relation to USER model, through user field.
This model stores
- Name of user in
namefield - currrent semester of user in
csemfield - Favourite resourses in the many to many
favfield
3)Course model
This model stores
-
Course name in
cnamefield -
Link to display image in
imgfield -
Semester to which the Course belongs in
semfield 4)Typee model
This model stores
-
Type of resourse name in
tnamefield -
Link to display image in
imgfield
5)rc model
This model is the model that stores all the resourses
This model stores
-
User who posted in foreign
cnamefield -
Semester of the resourse in
semfield -
Course in foreign
coursefield -
Type of resourse in foreign
typeefield -
Description in
desfield -
Resourse file in
pdffield
6)Message field
This model stores comments
This model stores
-
User who posted in foreign
userfield -
Resourse under which it was commented in
rrcfield -
Body of comment in
bodyfield -
Time of creation in
createdfield -
Time of Updation in
updatedfield
There are 2 forms, python code in location core/forms.py
1)rcf form
This form is used to upload a resourse, it contains all the fields of rc model, except for poster.
2)SignUpForm form
This form is used to signup a user, and contains username, password1, and password2(confirm password) for the USER model. csem and name for profile model.
There are 14 views in total in the core/views.py
In most cases, views have been given the same name as the corresponding URL that refers to it.
The views are simple and easy to understand on glancing through the code.
Refer to the documentation of models, urls and forms whenever needed.
Note: decorator login_required imported from django.contrib.auth.decorators has been used to restrict the pages that are meant for logged in users only.
Static files are stored in the directory static present in the main directory.
static/img contains images used throughout the website.
static/styles contains the css files.
templates directory of the main directory contains main.html that is extended at all pages using Django templating engine.
All the other HTML files are stored in core/templetes/core.
Templates use Bootstrap5, given below is the GitHub repo for the same
https://github.com/twbs/bootstrap
Templates are inspired by the following template
https://startbootstrap.com/theme/creative
Contributions:
More contributions are most welcome
