The official Blender Extensions platform. https://extensions.blender.org
Go to file
Dalai Felinto 41c4ae35e9 Implement basic robots.txt (#264)
It basically makes sure that the approval queue does not get crawled.

Ref: !264
2024-10-21 16:49:19 +02:00
.gitea/issue_template Gitea: update bug report template 2024-07-19 17:13:16 +02:00
abuse Reject rating when an abuse report gets resolved (#223) 2024-07-22 13:42:54 +02:00
access Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
apitokens Profile: Add page titles 2024-05-29 15:59:09 +02:00
assets_shared@c6cc2d73f8 Chore: Update git submodule web-assets to v2.0.0-alpha.43 2024-10-03 17:04:58 +02:00
blender_extensions Implement basic robots.txt (#264) 2024-10-21 16:49:19 +02:00
common UI: Implement web-assets v2 component nav-pills 2024-09-27 10:51:52 +02:00
constants generate_fake_data: more variety 2024-07-14 22:51:51 +02:00
emails Abuse reports: moderator form for resolving/dismissing + notification (#173) 2024-06-07 17:04:52 +02:00
extensions Implement basic robots.txt (#264) 2024-10-21 16:49:19 +02:00
files Fix #241: 500 Error when submitting extension without "type" 2024-08-29 12:51:19 +02:00
notifications Notifications: keep read/unread tab selection on "mark read" 2024-08-26 18:28:03 +02:00
playbooks Playbooks: update to latest shared 2024-09-06 13:45:15 +02:00
public/media Partial Revert "Feat: Add Open Graph image placeholder and improve image_url conditionals" 2024-06-24 15:14:53 +02:00
ratings Fix: Cropped ratings stars filling 2024-10-03 16:49:08 +02:00
releases models: simplify VersionStringField 2024-07-12 22:52:17 +02:00
reviewers Consistent hero-tabs navigation (#244) 2024-09-03 11:55:33 +02:00
stats Stop recording extension view counts 2024-07-17 17:05:31 +02:00
teams Fix teams tests: add missing __init__.py 2024-07-22 13:48:26 +02:00
users UI: Improve template layout component nav-pills markup semantics 2024-09-27 11:30:30 +02:00
.env.example Settings: use dotenv in development; DEBUG off by default 2024-09-12 16:12:53 +02:00
.eslintignore Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
.eslintrc.js Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
.gitignore Git: ignore DS_Store files 2024-05-29 16:01:20 +02:00
.gitmodules Playbooks: move everything to web-playbooks submodule 2024-07-29 19:53:18 +02:00
.pre-commit-config.yaml Revert "Run API schema update as part of the pre-commit hook" 2024-02-20 19:25:56 +01:00
AUTHORS Add license and authors 2024-06-03 17:17:43 +02:00
deploy.sh Playbooks: move everything to web-playbooks submodule 2024-07-29 19:53:18 +02:00
LICENSE Add license and authors 2024-06-03 17:17:43 +02:00
logo-source.svg Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
manage.py Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
pyproject.toml Initial models, tests and other boilerplate 2022-08-25 17:37:48 +02:00
README.md Fix staging URLs on README 2024-10-14 14:33:20 +02:00
requirements_dev.txt Settings: use dotenv in development; DEBUG off by default 2024-09-12 16:12:53 +02:00
requirements_prod.txt Replace gunicorn with uwsgi, use persistent db connections (#90) 2024-04-25 15:11:07 +02:00
requirements.txt move metrics_middleware to web-backend-shared 2024-09-09 14:19:30 +02:00
setup.cfg PEP: flake8 no longer supports inline comments in setup.cfg 2024-04-04 12:04:44 +02:00
utils.py Fix X-Forwarded-For parsing 2024-09-02 14:09:40 +02:00

Table of Contents

Blender Extensions

Free and open source add-ons and themes for Blender.

Requirements

  • Python 3.10
  • virtualenv
  • libmagic: sudo apt-get install libmagic1 in Debian/Ubuntu, brew install libmagic on OSX.

Development

Setup

Create and activate a virtual environment using your favourite method, e.g.

python3.10 -m venv .venv
source .venv/bin/activate

Install required packages:

pip install -r requirements_dev.txt

Make a copy of example .env:

cp .env.example .env

Initialise submodules included into this repo:

git submodule update --init

Create the database tables and load some basic data to work with using the following commands:

./manage.py migrate
./manage.py loaddata **/fixtures/*.json

It's also possible to generate fake add-on data using the following command:

./manage.py generate_fake_data

Update /etc/hosts to point to extensions.local, e.g.:

127.0.0.1	extensions.local

Run development server

./manage.py runserver 8111

Now http://extensions.local:8111 should be ready to work with and it should be possible to log into http://extensions.local:8111/admin/ with admin/admin.

Blender ID

Blender Extensions, as all other Blender web services, uses Blender ID. Blender Extensions can also receive Blender ID account modifications such as badge updates via a webhook.

For development, Blender ID's code contains a fixture with an OAuth app and a webhook that should work without any changes to default configuration. To load this fixture, go to your development Blender ID and run the following:

./manage.py loaddata blender_extensions_devserver

N.B.: the webhook view delegates the actual updating of the user profile to a background task, so in order to see the updates locally, start the processing of tasks using the following:

./manage.py process_tasks

Blender ID and staging/production

For staging/production, create an OAuth2 application in Blender ID using Admin Blender-ID OAuth2 applications -> Add:

  • Redirect URIs: https://extensions.staging.blender.org/oauth/authorized (https://extensions.blender.org for production);
  • Client type: "Confidential";
  • Authorization grant type: "Authorization code";
  • Name: "Blender Extensions Staging" (or "Blender Extensions" for production);

Copy client ID and secret and save them as BID_OAUTH_CLIENT and BID_OAUTH_SECRET into a .env file:

export BID_OAUTH_CLIENT=<CLIENT ID HERE>
export BID_OAUTH_SECRET=<SECRET HERE>

Create a webhook using Admin Blender-ID API Webhooks > Add:

  • Name: "Blender Extensions Staging" (or "Blender Extensions" for production)";
  • URL: https://extensions.staging.blender.org/webhooks/user-modified/ (or https://extensions.blender.org/webhooks/user-modified/ for production);
  • App: choose the app created in the previous step;

Copy webhook's secret into the .env file as BID_WEBHOOK_USER_MODIFIED_SECRET:

export BID_WEBHOOK_USER_MODIFIED_SECRET=<WEBHOOK SECRET HERE>

Pre-commit hooks

Make sure to enable pre-commit hooks after installing requirements from requirements_dev.txt:

pre-commit install

This will enable formatting pre-commit checks for Django templates, Python and JS modules.

Testing

To simply run the test suit use

./manage.py test

To run tests and generate a coverage report use

coverage run manage.py test && coverage html

and then open htmlcov/index.html with your favourite browser.

Deploy

See playbooks.

License and Copyright

The platform source code is available under the GPLv3 or later. Early versions of the platform are inspired by Mozilla Addons Server. List of authors is available in the AUTHORS file.