In order to make a contribution, you'll need to clone and test your changes.
To clone the repo run the following command:
git clone https://github.com/rit-csc/CSCWebsite
Set up the database:
python3 manage.py migrate
Then run the server using the following command:
python3 manage.py runserver
-
Django -- backend (version 1.8.6)
pip3 install Django==1.8.6
-
icalendar -- for calendar stuff
pip3 install icalendar
-
dateutil -- for more calendar stuff, specifically repeat events
pip3 install python-dateutil
-
django-email-obfuscator -- to obfuscate emails from scrapers
pip3 install django-email-obfuscator
Making a page is as easy as creating a html file in csc_new/pages/templates/pages/
.
For backend-intensive pages, you will have to put a new url in csc_new/csc_new/urls.py
and a new view/context in csc_new/pages/views.py
.
Static files (images, CSS, JavaScript, etc.) go in staticfiles/PATH_TO_YOUR_FILE
.
To refer to a static file in a template, do the following (outside of a {% verbatim %}
block):
{% load static %}
<!-- other stuff -->
{% static PATH_TO_YOUR_FILE %}
Django will do the rest for you!
A base template exists for all pages.
All content that goes on every page should end up here.
To extend this template, put {% extends 'csc_new/base.html' %}
at the top of your file
and include your content in blocks that use the template correctly.
Note: All contributions from outside contributors will be code-reviewed by the projects committee chair and/or the Systems Administrator before being pushed to the live website.
To run tests, navigate to the csc_new/
directory and run the following:
python manage.py test
Our website is open-sourced using the MIT License.