Silver Chips Online is an award-winning school newspaper from Montgomery Blair High School in Silver Spring, MD. Further specifications for things like data models, site maps, and feature wishlists are stored in the boards and issues. Note that while the intent is to keep this framework generic as to support news sites for different organizations, parts may be hardocoded until a full fork and release.
Prequisites: Python 3+, pip
, and pipenv
. Ruby, gem
, and sass
for static precompilation.
pip
should come shipped with Python 3 when you install it (just make sure it's on PATH); to install virtualenv
and virtualenvwrapper-win
, run (on the command line):
pip install pipenv
- Clone this repository:
git clone https://github.com/mbhs/silverchips.git
. cd
intosilverchips
:cd silverchips
.- Run
pipenv --three install --dev
to make a new virtualenv/pipenv - Run
pipenv shell
to enter the new environment - Make migrations and apply:
python manage.py makemigrations core
python manage.py migrate --run-syncdb
- Load test data:
python manage.py loaddata core/fixtures/recent.json
. - Run server:
python manage.py runserver
. - Visit in browser:
localhost:8000
And voila!
Django code is organized broadly into models, which store data in the database and you can interact nicely with in Python; views, which perform server-side logic on models data, possibly making changes or organizing data for display; and templates, which render view results to HTML. For more information, see the excellent official Django tutorial.
This code is organized into three main Django apps and a number of auxiliary scripts. The apps are:
core
: Shared functionality between all aspects of SilverChips Online. Models live here.home
: Public-facing functionality that any user can see when they load the site.staff
: Private functionality that only SilverChips staff accesses to administer the newspaper.
Simply run the command python3 manage.py dumpdata --natural-foreign --natural-primary -e contenttypes.contenttype -e auth.permission > core/fixtures/recent.json
.