Skip to content

Latest commit

 

History

History
86 lines (50 loc) · 2.22 KB

README.md

File metadata and controls

86 lines (50 loc) · 2.22 KB

2025.djangocon.africa

Website for DjangoCon Africa 2025

Installation

To get up and running do the following:

  1. Create a virtual environment.
python3.12 -m venv venv 

Of course there are many ways to make a virtual environment. We are following the simplest method. If you like to use a different thing then go for it.

  1. Install the requirements

Activate your virtual env

source venv/bin/activate 

Then install the requirements:

pip install -r requirements.txt
  1. Install npm dependencies
npm install 

Running the application

  1. Get the development database up and running:

See: dev_db/README.md

Remember to run the migrations!

  1. Run the server

Before using the runserver command, you need to load up some environmental variables. .env_example has some sensible defaults that just work in a dev environment:

source .env_example
python manage.py runserver

Working with tailwind

You can learn about tailwind here. It is installed in this project using the standard "Tailwind CLI" installation.

The Tailwind CLI is used to build a css file. The build process takes in a few inputs:

  1. HTML files: It will look at what tailwind classes you are referencing inside your html files. The final built css file will contain only those css classes that are actually being used.

  2. An input CSS file. In our case we are using website/static/src/tailwind_input.css. This file contains any extra classes or default styles.

  3. tailwind.config.js. This file contains exra configuration. For example if you want to create new colours or define a primary colour or anything like that it will go in there.

The output of the tailwind build is: website/static/dist/tailwind_final.css. You can see that we reference this file in our base template, website/templates/website/_base.html

Building the tailwind css file

There are 2 commands you can use:

This builds the final CSS file:

npm run tailwind

Sometimes if you are doing a lot of editing of multiple files (html files as well as the other build inputs), then it is useful to watch for file changes and rerun the build automatically.

In this case use:

npm run tailwind_watch