0
0
The first NA blender conference
Go to file
2023-12-17 12:23:24 -06:00
assets_shared@d520d54265 Update shared assets 2023-11-30 14:18:22 -06:00
conference Add Storage backends for S3 2023-12-17 12:23:24 -06:00
conference_main Tests: update out-of-date checks 2023-12-12 14:46:33 +01:00
emails Fetch Stripe's product to display in templated; fix templates; tests 2023-12-13 09:24:52 +01:00
playbooks Playbooks: remove dumpdata cron job 2023-12-15 08:05:30 +01:00
templates/admin/tickets CSV report for attendees 2022-10-03 13:22:26 +02:00
tickets Unintended change undone 2023-12-13 10:25:17 +01:00
.arcconfig Make master the new default development branch 2019-10-16 10:29:18 +02:00
.eslintrc.yml Tickets checkout and transactional emails 2022-06-10 16:50:43 +02:00
.gitignore Allow settings.py to be tracked 2023-12-17 12:08:31 -06:00
.gitmodules Make web_assets an absolute url 2023-09-14 13:37:53 -05:00
.pre-commit-config.yaml Hooks: update flake8 URL (the old one is no more) 2023-12-12 12:47:13 +01:00
customjsmin.py Tickets checkout and transactional emails 2022-06-10 16:50:43 +02:00
deploy.sh Replace Docker deploy with playbooks 2022-05-27 16:43:15 +02:00
manage.py Fix type errors 2019-09-27 09:28:45 +02:00
manage.sh Add speakers grid and profile detail pages 2019-10-02 15:13:02 +02:00
mypy.ini Add Mypy and Black as dependencies 2019-09-27 09:28:45 +02:00
poetry.lock Fetch Stripe's product to display in templated; fix templates; tests 2023-12-13 09:24:52 +01:00
Procfile Add Procfile for heroku 2023-12-17 12:17:20 -06:00
pyproject.toml Fetch Stripe's product to display in templated; fix templates; tests 2023-12-13 09:24:52 +01:00
README.md Fetch Stripe's product to display in templated; fix templates; tests 2023-12-13 09:24:52 +01:00
requirements.txt Freeze requirements 2023-12-17 12:08:41 -06:00
runtime.txt Add runtime for heroku python buildpack 2023-09-14 13:55:11 -05:00
test.sh Add Mypy and Black as dependencies 2019-09-27 09:28:45 +02:00

Blender Conference

Development quick start

  • Checkout the main branch
  • mkvirtualenv -a pwd blender-conference -p /usr/bin/python3.11
  • pip3 install 'poetry==1.4.2'
  • poetry install
  • cp settings.example.py settings.py and uncomment os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'

Setup database

Blender Conference requires PostgreSQL set up and running.

If you have the createuser and createdb utilities:

createuser conference -P
createdb -O conference conference

Alternatively, to create a new Blender Conference database, run this as the PostgreSQL root user:

CREATE USER conference CREATEDB PASSWORD 'conference';
CREATE DATABASE conference OWNER conference;
\c conference
CREATE SCHEMA conference;
GRANT ALL ON schema conference TO conference;

In case of production, omit CREATEDB and make sure that both postgres and conference users have secure hard to guess passwords set. You can change the password using:

ALTER ROLE conference WITH PASSWORD 'new_password';
1. `docker exec --user postgres -i postgres psql conference < conference_prod_dump`
or
2. `manage.py migrate`

Create superuser

echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@blender.org', 'password')" | ./manage.py shell

Create system user

Conference uses a special system user to log various changes via admin LogEntry.

In order for this to work locally, SYSTEM_USER_ID must be set in the settings. The following will create a user and print out its ID, which you can then copy-paste into your settings.py:

echo "from django.contrib.auth import get_user_model; User = get_user_model(); print(User.objects.create_user('system', 'system@blender.org', 'password').id)" | ./manage.py shell

Start development server

Setup application to run on port 8009:

manage.py runserver

Setup OAuth application in Blender ID

Create an OAuth2 app with the following configuration:

* Confidential
* Authorization Code
* Use http://conference.local:8009/oauth/authorized as redirect url
* Skip authorization

You can always bypass Blender ID by logging in via the admin portal:

* URL: `http://conference.local:8009/admin/`
* User: `admin`
* Password: `password`

Running tests

Tests can be run by issuing ./test.sh in the repository root directory.

Update BWA (assets_shared/)

For updating the base styling provided by Blender Web Assets, navigate to assets_shared/ and pull latest changes:

cd assets_shared/
git checkout master && git pull
cd ..

N.B.: because project's static assets depend on BWA SASS modules, and "compiling" those can fail due to, e.g., incorrect font paths or missing files, always check that collectstatic works before committing this kind of update:

./manage.py collectstatic  --noinput

After making sure everything looks as expected, commit the updated submodule reference:

git add assets_shared
# add and commit the rest of the changes

Panel setup

  • The panel is available at /<edition>/panel
  • Set the Twitter hashtag in the admin view of the current Edition

Deploy to production

In order to put commits in production, they need to be moved from the master branch into the production branch:

git checkout production && git merge --ff-only master

Use ./deploy.sh production to deploy to production.

Payment Backend

Currently, we support Saleor and Stripe as payment backends. In order to use Stripe, set the following:

  • STRIPE_API_KEY
  • STRIPE_PRICING_TABLE_ID
  • STRIPE_PUBLISHABLE_KEY: publishable key of the pricing table

N.B.: Tickets will store Stripe's product names and then use those to look up products when sending confirmation emails and displaying the ticket page to an attendee. Due to this, the names of the products used in Stripe's pricing table should be unique.