2022-11-29 17:45:00 +01:00
|
|
|
Prelom
|
2022-11-29 17:27:36 +01:00
|
|
|
================
|
2022-11-29 16:23:44 +01:00
|
|
|
|
2022-11-29 17:27:36 +01:00
|
|
|
Django site for managing an online publication.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
Before running pip install make sure the following packages are installed:
|
|
|
|
* postgresql-devel (libpq-dev in Debian/Ubuntu, libpq-devel on Centos/Fedora/Cygwin/Babun.)
|
|
|
|
* libjpeg (libjpeg-dev, zlib1g-dev)
|
|
|
|
|
|
|
|
On a Debian/Ubuntu system run:
|
|
|
|
```bash
|
|
|
|
sudo apt install libpq-dev libjpeg-dev zlib1g-dev
|
|
|
|
```
|
|
|
|
|
|
|
|
Within a virtualenv, run the following commands, in order:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install -r requirements.txt
|
|
|
|
cd django
|
2022-12-06 17:48:20 +01:00
|
|
|
python3 manage.py makemigrations journal cms uploads blog
|
2022-11-29 17:27:36 +01:00
|
|
|
python3 manage.py migrate
|
|
|
|
python3 manage.py createsuperuser
|
|
|
|
python3 manage.py loaddata initial_fixtures.json
|
|
|
|
```
|
|
|
|
|
|
|
|
Finally:
|
|
|
|
|
|
|
|
`python3 manage.py runserver`
|
|
|
|
|
|
|
|
You can find the admin interface at <http://localhost:8000/sudo/> (for the
|
|
|
|
superuser) or <http://localhost:8000/editor/> (the link to give to editors).
|
|
|
|
You can create users with editor permissions via the /sudo/ admin site:
|
|
|
|
set `is_staff` to True, and give them any necessary permissions (there will
|
|
|
|
be a permission group eventually, but for now you'll have to select them
|
|
|
|
manually).
|
|
|
|
|
2022-12-23 13:39:17 +01:00
|
|
|
With the updated initial_fixtures you will create all the required objects:
|
2022-12-23 13:34:41 +01:00
|
|
|
|
2022-12-23 13:39:17 +01:00
|
|
|
* 2 issues (first-issue, second-issue)
|
2022-12-23 13:34:41 +01:00
|
|
|
* 3 categories (inquiry, theory, bulletins)
|
|
|
|
* 5 pages (homepage, about, support, contribute, lom)
|
|
|
|
|
2022-12-23 13:39:17 +01:00
|
|
|
These objects are all required for the cms (header links, index etc.) to work.
|
2022-11-29 17:27:36 +01:00
|
|
|
|
|
|
|
## Deploying in production
|
|
|
|
|
|
|
|
To deploy in production with Postgres, a custom secret key, and DEBUG=False,
|
|
|
|
set the following environment variables within the virtualenv:
|
|
|
|
|
|
|
|
* `POSTGRES_PASSWORD`: the password for PostgreSQL
|
|
|
|
* `DJANGO_SECRET_KEY`: the `SECRET_KEY` used by Django (set to a random string)
|
|
|
|
* `ALLOWED_HOST`: e.g., 'notesfrombelow.org'
|
2022-11-29 17:48:00 +01:00
|
|
|
|
|
|
|
Original fork from: <https://github.com/dellsystem/notes-from-below>
|
2022-12-23 13:39:17 +01:00
|
|
|
|
2022-11-29 17:56:27 +01:00
|
|
|
Source code for: <https://prelom.je>
|