This is the website for the CodeAnon organization.
- Python 3.8 with
poetry
installed - Node v12 or v14 with
yarn
installed docker
anddocker-compose
(optional; for testing the production environment only)
- Setup the project with
poetry install
- Setup the front-end dependencies with
yarn install
- Open a shell with the python dependencies available with
poetry shell
:-
Create the SQLite database with
./manage.py migrate
-
Either:
- Add a dump of the live site data with
./manage.py loaddata codeanon/fixtures/dump.json
- Create your local superuser account to manage the admin with
./manage.py createsuperuser
In either case the data will only be changed on your own computer and not in the live site.
- Add a dump of the live site data with
-
Run the development server with
./manage.py runserver
-
The website uses Bulma as the CSS framework. It was chosen because it is most easily themeable.
The style files are written in Sass and are available in /codeanon/static/css.
Dockerfile-based development is supported through Wagtail's default Dockerfile. You need to fill in the required environment variables as environment when building the Docker image.
On top of the required environment variables below, there are two more variables required by the build script:
ADMIN_USER
: Username of the admin userADMIN_EMAIL
: Admin user email addressADMIN_PASSWORD
: Admin user password
You can use the Dockerfile as a reference on how to deploy the project.
- Install system dependencies:
- A recent C++ compiler as
libsass
needs GCC 4.7+ or any compatible compiler.
- A recent C++ compiler as
- Install Python 3.8 and pipenv
- Run
pipenv install --deploy
(add--system
if the system's sole purpose is to run the web server) - Run
./manage.py migrate
from within the virtualenv if one was created - Run
./manage.py createsuperuser
to create the first user of the website - it will be given admin rights. Use a strong password! - Run
gunicorn codeanon.wsgi:application --bind 0.0.0.0:8000
SECRET_KEY
: Sets the secret key used to encrypt cookies and generate CSRF tokens. Must be cryptographically generated, otherwise the security of the web server is compromised.DATABASE_URL
: Database URL to use, in Database URL format.EMAIL_HOST
: Host name of the mail serverEMAIL_PORT
: Port to use when sending mails to the mail serverEMAIL_HOST_USER
: Mail server userEMAIL_HOST_PASSWORD
: Mail server password
EMAIL_USE_TLS
: (default false) - Use TLS when connecting to the mail server.EMAIL_USE_SSL
: (default false) - Use SSL when connecting to the mail server.EMAIL_TIMEOUT
: (default none) - Set the connection timeout to the mail server.EMAIL_SSL_KEYFILE
: (default none) - Set the file to the public keys to use.EMAIL_SSL_CERTIFICATE
: (default none) - SSL certificate to use when connecting to the mail server.