update readme: add virtualenv step #104348

Closed
Oleg-Komarov wants to merge 1 commits from (deleted):oleg-komarov-patch-1 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 19 additions and 14 deletions

View File

@ -13,39 +13,44 @@ that poetry takes care of -- there's no need to install anything manually.
## Set up instructions
1. Clone the repo: `git clone git@projects.blender.org:studio/blender-studio.git`
2. Run `poetry install`
1. Setup and activate virtualenv:
```
virtualenv .venv -p `which python`
source .venv/bin/activate
```
1. Run `poetry install`
- if the installation of psycopg2 fails, make sure that you have the required
apt packages installed ([more details](https://www.psycopg.org/docs/install.html#build-prerequisites)).
3. Create a PostgreSQL user named `studio`:
1. Create a PostgreSQL user named `studio`:
```sudo -u postgres createuser -d -l -P studio```
4. Create a database named `studio`:
1. Create a database named `studio`:
```sudo -u postgres createdb -O studio studio```
5. Add `studio.local` to `/etc/hosts` as an alias of 127.0.0.1:
1. Add `studio.local` to `/etc/hosts` as an alias of 127.0.0.1:
```
127.0.0.1 localhost studio.local # studio.local can be added on the same line as localhost
...
```
5. Create a `.env` file (`cp .env.example .env`). This file is gitignored, and it must not be committed.
1. Create a `.env` file (`cp .env.example .env`). This file is gitignored, and it must not be committed.
- Set `DEBUG=True`;
6. Fill in AWS S3 and CloudFront credentials in your `.env`:
1. Fill in AWS S3 and CloudFront credentials in your `.env`:
- Set values of `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` values to your access keys;
- Download the CloudFront key file and save it to the project directory (it should be named `pk-APK***.pem`);
- Set `AWS_CLOUDFRONT_KEY_ID='APK***'` where `APK***` is from the name of the key file above.
6. In the command line, activate the virtual environment created by poetry:
1. In the command line, activate the virtual environment created by poetry:
```poetry shell```
- Configure your IDE to use the venv by default.
7. In the project folder, run migrations: `./manage.py migrate`
8. Create a superuser: `echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')" | python manage.py shell`
9. Run the server: `./manage.py runserver 8001`. The project will be available at
1. In the project folder, run migrations: `./manage.py migrate`
1. Create a superuser: `echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')" | python manage.py shell`
1. Run the server: `./manage.py runserver 8001`. The project will be available at
`studio.local:8001`.
10. (Optional) Install pre-commit hooks (see [pre-commit details](docs/development.md#before-commiting)):
1. (Optional) Install pre-commit hooks (see [pre-commit details](docs/development.md#before-commiting)):
```pre-commit install```
11. In the admin panel (http://studio.local:8001/admin), edit the `Site` object's domain.
1. In the admin panel (http://studio.local:8001/admin), edit the `Site` object's domain.
The default domain is `example.com`; change it to `studio.local:8001`. This will make
it possible to immediately view objects created/edited via admin on site.
12. Set up the [Blender ID server](#blender-id-authentication) for authentication
1. Set up the [Blender ID server](#blender-id-authentication) for authentication
and [MeiliSerach server](#search) for the search functionality.
13. Setup for video processing jobs. Download ngrok (https://ngrok.com/).
1. Setup for video processing jobs. Download ngrok (https://ngrok.com/).
- Run `./ngrok http 8010`
- Update `.env`:
- Set `COCONUT_API_KEY` to a valid value