assets_shared@d520d54265 | ||
conference | ||
conference_main | ||
emails | ||
playbooks | ||
templates/admin/tickets | ||
tickets | ||
.arcconfig | ||
.eslintrc.yml | ||
.gitignore | ||
.gitmodules | ||
.pre-commit-config.yaml | ||
customjsmin.py | ||
deploy.sh | ||
manage.py | ||
manage.sh | ||
mypy.ini | ||
poetry.lock | ||
Procfile | ||
pyproject.toml | ||
README.md | ||
requirements.txt | ||
runtime.txt | ||
test.sh |
Blender Conference
Development quick start
- Checkout the
main
branch mkvirtualenv -a
pwdblender-conference -p /usr/bin/python3.11
pip3 install 'poetry==1.4.2'
poetry install
cp settings.example.py settings.py
and uncommentos.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';
Load production snapshot (recommended) or start with an empty database
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.