Skip to content

jvzammit/cph22

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cph22

Repo backing talk at Django Day CPH 2022.

Talk link here.

Installation

Set up virtual environment. And then:

pip install -r requirements.txt

Database setup

The code by default talks to a postgres instance on a local Docker container. You will have to set that up yourself. Then change the variables within the connection string DATABASES setting.

If you want to avoid setting up and just run the code against sqlite replace the DATABASES setting. Here's the code:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}

Loading sample data

Can be done using pizzas.tests.utils.load_data function. This is also used to set up data for unit tests.

Run the below:

python manage.py shell_plus

In the terminal:

from pizzas.tests.utils import load_data
load_data()

Running tests

python manage.py test

Talk References

Django docs

Third-party Packages

Related Articles & Blog posts

Postgres-specific articles

Tools used

Both free to use at time of writing.

About

Django Day CPH 2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published