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 hardcoded until a full fork and release.
It's recommended to use the supplied Dockerfile
and docker-compose.yml
. Simply clone the repository and run docker-compose up
and the site will be up and running.
You have to install Python 3+, pip, sass, and pipenv. The version of sass
that's installable via gem
is outdated and will not work. If using postgres, the postgres server development libraries need to be installed (postgresql-server-dev-12
on Ubuntu).
- Clone this repository:
git clone https://github.com/mbhs/silverchips.git
. cd
intosilverchips
:cd silverchips
.- Run
pipenv --three install --dev
to install the environment. If this doesn't work, runpipenv lock --pre --clear
beforehand. - Run
pipenv shell
to enter the new environment. - Make migrations and apply:
python manage.py makemigrations
python manage.py migrate
- Make an appropriate
secure_settings.py
in thesilverchips
folder. An example can be found insilverchips/secure_settings.py.postgres_example
. - If using postgres, you can load the
sco.sql
database dump into the database. If not, you can load a fixture:python manage.py loaddata core/fixtures/recent.json
. Note that the database dump is preferred since the fixture is missing many things, such as permissions. - Run the server:
python manage.py runserver
. - Visit in browser:
localhost:8000
.
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 Silver Chips Online. Models live here.home
: Public-facing functionality that any user can see when they load the site.staff
: Private functionality that only Silver Chips staff accesses to administer the newspaper.
Simply run the command python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes.contenttype -e auth.permission > core/fixtures/recent.json
.
The core/fixtures/testing.json
fixture and sco.sql
database dump has a superuser with username admin
and password password
.