Skip to content

Commit

Permalink
Update docs (#3)
Browse files Browse the repository at this point in the history
* Update README

* Add command to activate venv

---------

Co-authored-by: Jay Qi <[email protected]>
  • Loading branch information
jayqi and jayqi authored Jul 19, 2024
1 parent 6a9891d commit 37c319a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ ALLOW_ROBOTS=False

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY=secret

# Used by 'just createsuperuser' to create a superuser
DJANGO_SUPERUSER_EMAIL="[email protected]"
DJANGO_SUPERUSER_PASSWORD="hohohomerrychristmas!"
DJANGO_SUPERUSER_USERNAME="admin"
DJANGO_SUPERUSER_TEAM_NAME="Admin"

# Used by create_demo_data to generate mock puzzle URLs
BASE_URL = "http://127.0.0.1:8000"
68 changes: 62 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,82 @@ pip install -r dev-requirements.txt

...

## Development
## Development and deployment

...
> [!NOTE]
> This project uses [Just](https://github.com/casey/just) as a command runner. Several convenience commands are defined in [`justfile`](./justfile). You can print available commands by running:
>
> ```bash
> just
> ```
### Setup
1. Create and activate a Python 3.11.9 virtual environment. You can do this with your virtual environment tool of your choice. For example:
```bash
python -m venv .venv
source .venv/bin/activate
```
2. Install dependencies:
```bash
just requirements
# or
python -m pip install -r dev-requirements.txt
```
3. Set up environment variables. This project can read from a `.env` file. Copy `.env.example` to `.env` and populate it according to the comments.
4. Create and migrate the database:
```bash
just migrate
# or
python manage.py migrate
```
### justfile
### Running the hunt site locally
```bash
just run
# or
python manage.py runserver
```
This project uses [Just](https://github.com/casey/just) as a command runner. Several convenience commands are defined in [`justfile`](./justfile). You can print available commands by running:
### Creating a superuser
If you have `
```bash
just
just createsuperuser
# or
python manage.py createsuperuser
```
### Creating demo data

```bash
just demo-data
# or
python manage.py create_demo_data
```

### Making migrations

If you change any of the database models, you'll need to generate database migrations. Run:

```bash
just migrate
# or
python manage.py makemigrations
python manage.py migrate
```

### Compiling requirements (lockfile)

This requires either uv or pip-tools. Depending on which you're using, run:
If you update any of the dependencies required by the application, you'll need to update the lockfiles. This requires either uv or pip-tools. Depending on which you're using, run:

```bash
just compile-requirements # requires uv
# or
uv pip compile requirements.in -o requirements.txt
uv pip compile dev-requirements.in -o dev-requirements.txt
# or
pip-compile requirements.in -o requirements.txt
pip-compile dev-requirements.in -o dev-requirements.txt
```

0 comments on commit 37c319a

Please sign in to comment.