/hypergen-djangocon-2022

The example code for our talk at Djangocon Europe 2022 in Porto

Primary LanguagePythonMozilla Public License 2.0MPL-2.0

Server-Side is back, baby!

This repository contains the example code from our workshop at Djangocon 2022 in Porto. Also available are:

Installation

Install the example code like so:

git clone https://github.com/runekaagaard/hypergen-djangocon-2022.git
cd hypergen-djangocon-2022
python3 -m venv venv
source venv/bin/activate
pip install Django==4.1.1 django-hypergen==0.9.10
python manage.py migrate
python manage.py runserver

Then navigate to http://127.0.0.1:8000 that logs you in automatically, then redirects to the free liveview.

Interesting files

booking/models.py
The Doctor and Timeslot models.
booking/urls.py
The autourls() function that creates urls for all liveviews and actions automatically.
booking/views.py
Skeleton of liveviews, actions, template functions and base templates where we will build the app.
booking/views_finished.py
The finished app, that was build in the 30 minutes long live-coding part.

Less interesting files

djangocon2022/settings.py
The main settings file. booking is added to INSTALLED_APPS. hypergen.context.context_middleware is added to MIDDLEWARE.
djangocon2022/urls.py
The main urls file. The booking app is added. / logs the user in automatically.
booking/pasta.py
Some stuff we might copy/paste during the presentation.