fix: use versioned python3 instead of python

environments/review-docs-docs-p5xm4f/deployments/16617
jo 2023-01-13 15:22:05 +01:00
rodzic 95d8ab5dd4
commit efbdc027ab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B2FEC9B22722B984
26 zmienionych plików z 122 dodań i 122 usunięć

Wyświetl plik

@ -91,7 +91,7 @@ review_docs:
- git switch stable && git pull
- git switch $CI_COMMIT_BRANCH && git pull
script:
- poetry run python -m sphinx . $BUILD_PATH
- poetry run python3 -m sphinx . $BUILD_PATH
cache:
key: "$CI_PROJECT_ID__sphinx"
paths:
@ -260,9 +260,9 @@ build_openapi_schema:
- cd api
- pip3 install poetry
- poetry install
- poetry run python manage.py migrate
- poetry run python3 manage.py migrate
script:
- poetry run python manage.py spectacular --file ../docs/schema.yml
- poetry run python3 manage.py spectacular --file ../docs/schema.yml
artifacts:
expire_in: 2 weeks
paths:

Wyświetl plik

@ -18,8 +18,8 @@ tasks:
gp ports await 5432
poetry run python manage.py migrate
poetry run python manage.py gitpod init
poetry run python3 manage.py migrate
poetry run python3 manage.py gitpod init
command: |
echo "MEDIA_URL=`gp url 8000`/media/" >> ../.gitpod/.env
echo "STATIC_URL=`gp url 8000`/staticfiles/" >> ../.gitpod/.env
@ -28,8 +28,8 @@ tasks:
docker-compose up -d
gp ports await 5432
poetry run python manage.py collectstatic --no-input
poetry run python manage.py gitpod dev
poetry run python3 manage.py collectstatic --no-input
poetry run python3 manage.py gitpod dev
- name: Celery Worker
env:

Wyświetl plik

@ -41,7 +41,7 @@ RUN set -eux; \
python3-dev
# create virtual env for next stage
RUN python -m venv --system-site-packages /venv
RUN python3 -m venv --system-site-packages /venv
# emulate activation by prefixing PATH
ENV PATH="/venv/bin:/root/.local/bin:$PATH" VIRTUAL_ENV=/venv

Wyświetl plik

@ -26,7 +26,7 @@ class Command(BaseCommand):
script = available_scripts[name]
except KeyError:
raise CommandError(
"{} is not a valid script. Run python manage.py script for a "
"{} is not a valid script. Run python3 manage.py script for a "
"list of available scripts".format(name)
)
@ -43,7 +43,7 @@ class Command(BaseCommand):
def show_help(self):
self.stdout.write("")
self.stdout.write("Available scripts:")
self.stdout.write("Launch with: python manage.py <script_name>")
self.stdout.write("Launch with: python3 manage.py <script_name>")
available_scripts = self.get_scripts()
for name, script in sorted(available_scripts.items()):
self.stdout.write("")

Wyświetl plik

@ -55,7 +55,7 @@ services:
install_dev_deps: 1
image: funkwhale-api
command: >
bash -c "python manage.py collectstatic --no-input
bash -c "python3 manage.py collectstatic --no-input
&& uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir=funkwhale_api/"
volumes:
- ./api:/app
@ -158,7 +158,7 @@ services:
docs:
build: docs
command: python serve.py
command: python3 serve.py
volumes:
- ".:/app/"
ports:

Wyświetl plik

@ -3,7 +3,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = funkwhale
SOURCEDIR = .
BUILDDIR = _build

Wyświetl plik

@ -28,7 +28,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:sync: debian
```{code-block} sh
poetry run python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
poetry run python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
```
:::
@ -37,7 +37,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
docker-compose run --rm api python3 manage.py fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
```
:::

Wyświetl plik

@ -90,7 +90,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:sync: debian
```{code-block} sh
poetry run python manage.py mrf_check --list
poetry run python3 manage.py mrf_check --list
```
:::
@ -99,7 +99,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py mrf_check --list
docker-compose run --rm api python3 manage.py mrf_check --list
```
:::
@ -114,7 +114,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh
export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox - -p blocked_follow_domains
echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox - -p blocked_follow_domains
```
:::
@ -124,7 +124,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh
export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox - -p blocked_follow_domains
echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox - -p blocked_follow_domains
```
::::
@ -138,7 +138,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh
export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox - -p blocked_follow_domains
echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox - -p blocked_follow_domains
```
:::
@ -148,7 +148,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh
export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox - -p blocked_follow_domains
echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox - -p blocked_follow_domains
```
:::
@ -163,7 +163,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh
export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039"
echo $MRF_MESSAGE | poetry run python manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
echo $MRF_MESSAGE | poetry run python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
```
:::
@ -175,7 +175,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039"
echo $MRF_MESSAGE | docker-compose run --rm api python manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
echo $MRF_MESSAGE | docker-compose run --rm api python3 manage.py mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
```
@ -190,7 +190,7 @@ There are extra options for testing MRF policies. Check the command help for mor
:sync: debian
```{code-block} sh
poetry run python manage.py mrf_check --help
poetry run python3 manage.py mrf_check --help
```
:::
@ -199,7 +199,7 @@ poetry run python manage.py mrf_check --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py mrf_check --help
docker-compose run --rm api python3 manage.py mrf_check --help
```
:::

Wyświetl plik

@ -15,7 +15,7 @@ To see a full list of options, run the command with the `--help` flag.
:sync: debian
```{code-block} sh
poetry run python manage.py import_files --help
poetry run python3 manage.py import_files --help
```
:::
@ -24,7 +24,7 @@ poetry run python manage.py import_files --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py import_files --help
docker-compose run --rm api python3 manage.py import_files --help
```
:::
@ -91,7 +91,7 @@ Once you have your library ID, you can copy content from your server and import
3. Run the `import_files` command to copy your files. In this example, the music is stored in `data/music`. Replace this with your music directory.
```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput
poetry run python3 manage.py import_files $LIBRARY_ID "data/music" --recursive --noinput
```
Funkwhale copies your files to your media store.
@ -174,7 +174,7 @@ To use the in-place import method, follow these steps:
4. Run your import command against your music storage directory. In this example, the storage directory is `/srv/funkwhale/data/music/nfsshare`. Replace this with your storage directory.
```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
```
Funkwhale imports the music in your storage directory into the specified library.
@ -188,7 +188,7 @@ Funkwhale imports the music in your storage directory into the specified library
2. Run your import command against your music storage directory:
```{code-block} sh
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
```
Funkwhale imports the music in your storage directory into the specified library.
@ -241,7 +241,7 @@ The `import_files --watch` command watches for changes to the following metadata
:sync: debian
```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
```
:::
@ -250,7 +250,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
```
:::
@ -272,7 +272,7 @@ You can use the `--prune` flag with the `--watch` flag. This means Funkwhale rem
:sync: debian
```{code-block} sh
poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
poetry run python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
```
:::
@ -281,7 +281,7 @@ poetry run python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
docker-compose run --rm api python3 manage.py import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
```
:::

Wyświetl plik

@ -244,7 +244,7 @@ Funkwhale uses a [PostgreSQL](https://www.postgresql.org/) database to store inf
```{code-block} sh
cd /srv/funkwhale/api
sudo -u funkwhale poetry run python manage.py migrate
sudo -u funkwhale poetry run python3 manage.py migrate
```
````{note}
@ -272,7 +272,7 @@ You can create several superusers.
To start using Funkwhale, you need to create a superuser for your pod. This user has all the permissions needed to administrate the pod. Follow these steps to create a superuser.
```{code-block} sh
sudo -u funkwhale poetry run python manage.py createsuperuser
sudo -u funkwhale poetry run python3 manage.py createsuperuser
```
That's it! You can log in as this user when you finish setting up Funkwhale.
@ -282,7 +282,7 @@ That's it! You can log in as this user when you finish setting up Funkwhale.
Funkwhale uses several static assets to serve its frontend. Use `manage.py` to collect these files so that the webserver can serve them.
```{code-block} sh
sudo poetry run python manage.py collectstatic
sudo poetry run python3 manage.py collectstatic
```
## 8. Set up systemd unit files

Wyświetl plik

@ -140,7 +140,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
3. Run the database migrations.
```{code-block} sh
docker-compose run --rm api python manage.py migrate
docker-compose run --rm api python3 manage.py migrate
```
````{note}
@ -156,7 +156,7 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
4. Create your superuser.
```{code-block} sh
docker-compose run --rm api python manage.py createsuperuser
docker-compose run --rm api python3 manage.py createsuperuser
```
5. Launch all the containers to bring up your pod.

Wyświetl plik

@ -140,7 +140,7 @@ When the import finishes, run the `manage.py migrate` command to set up the data
```{code-block} sh
cd /srv/funkwhale/api
poetry run python manage.py migrate
poetry run python3 manage.py migrate
```
:::
@ -169,7 +169,7 @@ You need to initialize the postgres container on your {term}`destination server`
3. When the import finishes, run the `manage.py migrate` command to set up the database.
```{code-block} sh
docker-compose run --rm api python manage.py migrate
docker-compose run --rm api python3 manage.py migrate
```
:::

Wyświetl plik

@ -38,7 +38,7 @@ Use the following command to create a new library with a custom name and privacy
:sync: debian
```{code-block} sh
poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
poetry run python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
```
:::
@ -47,7 +47,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
```
:::
@ -70,7 +70,7 @@ You can create a library using only a username. The script substitutes default v
:sync: debian
```{code-block} sh
poetry run python manage.py create_library username1
poetry run python3 manage.py create_library username1
```
:::
@ -79,7 +79,7 @@ poetry run python manage.py create_library username1
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py create_library username1
docker-compose run --rm api python3 manage.py create_library username1
```
:::
@ -102,7 +102,7 @@ If a library with the same name already exists for the given user, the script wi
:sync: debian
```{code-block} sh
poetry run python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
poetry run python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
```
:::
@ -111,7 +111,7 @@ poetry run python manage.py create_library username1 --name="Library 1" --privac
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
docker-compose run --rm api python3 manage.py create_library username1 --name="Library 1" --privacy-level="everyone"
```
:::

Wyświetl plik

@ -16,7 +16,7 @@ To ensure you don't remove data by accident, this command runs in dry run mode b
:sync: debian
```{code-block} sh
poetry run python manage.py check_inplace_files
poetry run python3 manage.py check_inplace_files
```
:::
@ -25,7 +25,7 @@ poetry run python manage.py check_inplace_files
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py check_inplace_files
docker-compose run --rm api python3 manage.py check_inplace_files
```
:::

Wyświetl plik

@ -14,7 +14,7 @@ Check and fix file mimetypes with the `--mimetype` flag. This helps prevent issu
:sync: debian
```{code-block} sh
poetry run python manage.py fix_uploads --mimetype
poetry run python3 manage.py fix_uploads --mimetype
```
:::
@ -23,7 +23,7 @@ poetry run python manage.py fix_uploads --mimetype
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --mimetype
docker-compose run --rm api python3 manage.py fix_uploads --mimetype
```
:::
@ -39,7 +39,7 @@ Check and fix bitrate and duration with the `--audio-data` flag. This process ca
:sync: debian
```{code-block} sh
poetry run python manage.py fix_uploads --audio-data
poetry run python3 manage.py fix_uploads --audio-data
```
:::
@ -48,7 +48,7 @@ poetry run python manage.py fix_uploads --audio-data
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --audio-data
docker-compose run --rm api python3 manage.py fix_uploads --audio-data
```
:::
@ -64,7 +64,7 @@ Check and fix the file size with the `--size` flag.
:sync: debian
```{code-block} sh
poetry run python manage.py fix_uploads --size
poetry run python3 manage.py fix_uploads --size
```
:::
@ -73,7 +73,7 @@ poetry run python manage.py fix_uploads --size
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --size
docker-compose run --rm api python3 manage.py fix_uploads --size
```
:::
@ -89,7 +89,7 @@ Check and fix file checksums with the `--checksum` flag.
:sync: debian
```{code-block} sh
poetry run python manage.py fix_uploads --checksum
poetry run python3 manage.py fix_uploads --checksum
```
:::
@ -98,7 +98,7 @@ poetry run python manage.py fix_uploads --checksum
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --checksum
docker-compose run --rm api python3 manage.py fix_uploads --checksum
```
:::
@ -114,7 +114,7 @@ Choose the batch size you want to process with the `--batch-size` or -`s` flag.
:sync: debian
```{code-block} sh
poetry run python manage.py fix_uploads --batch-size 500
poetry run python3 manage.py fix_uploads --batch-size 500
```
:::
@ -123,7 +123,7 @@ poetry run python manage.py fix_uploads --batch-size 500
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fix_uploads --batch-size 500
docker-compose run --rm api python3 manage.py fix_uploads --batch-size 500
```
:::

Wyświetl plik

@ -4,7 +4,7 @@ Funkwhale doesn't delete data objects from the database when you delete a file.
Sometimes you may want to clear out dangling metadata. For example, if you import a lot of files with incorrect tags and then delete them.
To help with this, the {file}`manage.py` script includes commands to prune dangling metadata from your database. All prune commands are available under the python manage.py prune_library namespace. To ensure you don't remove data by accident, all commands run in dry run mode by default. Run commands with the `--no-dry-run` flag to perform the pruning action.
To help with this, the {file}`manage.py` script includes commands to prune dangling metadata from your database. All prune commands are available under the python3 manage.py prune_library namespace. To ensure you don't remove data by accident, all commands run in dry run mode by default. Run commands with the `--no-dry-run` flag to perform the pruning action.
```{warning}
Running `prune_library` commands with the `--no-dry-run` flag is irreversible. Make sure you [back up your data](../upgrade_docs/backup.md).
@ -20,7 +20,7 @@ Running `prune_library` commands with the `--no-dry-run` flag is irreversible. M
:sync: debian
```bash
poetry run python manage.py prune_library --tracks
poetry run python3 manage.py prune_library --tracks
```
:::
@ -29,7 +29,7 @@ poetry run python manage.py prune_library --tracks
:sync: docker
```bash
docker-compose run --rm api python manage.py prune_library --tracks
docker-compose run --rm api python3 manage.py prune_library --tracks
```
:::
@ -43,7 +43,7 @@ docker-compose run --rm api python manage.py prune_library --tracks
:sync: debian
```{code-block} sh
poetry run python manage.py prune_library --albums
poetry run python3 manage.py prune_library --albums
```
:::
@ -52,7 +52,7 @@ poetry run python manage.py prune_library --albums
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py prune_library --albums
docker-compose run --rm api python3 manage.py prune_library --albums
```
:::
@ -66,7 +66,7 @@ docker-compose run --rm api python manage.py prune_library --albums
:sync: debian
```{code-block} sh
poetry run python manage.py prune_library --artists
poetry run python3 manage.py prune_library --artists
```
:::
@ -75,7 +75,7 @@ poetry run python manage.py prune_library --artists
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py prune_library --artists
docker-compose run --rm api python3 manage.py prune_library --artists
```
:::
@ -89,7 +89,7 @@ docker-compose run --rm api python manage.py prune_library --artists
:sync: debian
```{code-block} sh
poetry run python manage.py prune_library --tracks --albums --artists
poetry run python3 manage.py prune_library --tracks --albums --artists
```
:::
@ -98,7 +98,7 @@ poetry run python manage.py prune_library --tracks --albums --artists
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py prune_library --tracks --albums --artists
docker-compose run --rm api python3 manage.py prune_library --tracks --albums --artists
```
:::
@ -112,7 +112,7 @@ There are extra options for pruning your database. Check the command help for mo
:sync: debian
```{code-block} sh
poetry run python manage.py prune_library --help
poetry run python3 manage.py prune_library --help
```
:::
@ -121,7 +121,7 @@ poetry run python manage.py prune_library --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py prune_library --help
docker-compose run --rm api python3 manage.py prune_library --help
```
:::

Wyświetl plik

@ -27,7 +27,7 @@ To add tags to untagged albums:
3. Run the `manage.py` script to generate tags for untagged albums.
```{code-block} sh
poetry run python manage.py fw albums add-tags-from-tracks
poetry run python3 manage.py fw albums add-tags-from-tracks
```
:::
@ -45,7 +45,7 @@ To add tags to untagged albums:
3. Run the `manage.py` script to generate tags for untagged albums.
```{code-block} sh
docker-compose run --rm api python manage.py fw albums add-tags-from-tracks
docker-compose run --rm api python3 manage.py fw albums add-tags-from-tracks
```
:::
@ -70,7 +70,7 @@ To add tags to untagged artists:
3. Run the `manage.py` script to generate tags for untagged artists.
```{code-block} sh
poetry run python manage.py fw artists add-tags-from-tracks
poetry run python3 manage.py fw artists add-tags-from-tracks
```
:::
@ -88,7 +88,7 @@ To add tags to untagged artists:
3. Run the `manage.py` script to generate tags for untagged artists.
```{code-block} sh
docker-compose run --rm api python manage.py fw artists add-tags-from-tracks
docker-compose run --rm api python3 manage.py fw artists add-tags-from-tracks
```
:::

Wyświetl plik

@ -29,7 +29,7 @@ To generate new thumbnails:
4. Run the `manage.py` script to regenerate the thumbnails.
```{code-block} sh
poetry run python manage.py fw media generate-thumbnails
poetry run python3 manage.py fw media generate-thumbnails
```
:::
@ -53,7 +53,7 @@ To generate new thumbnails:
4. Run the `manage.py` script to regenerate the thumbnails.
```{code-block} sh
docker-compose run --rm api python manage.py fw media generate-thumbnails
docker-compose run --rm api python3 manage.py fw media generate-thumbnails
```
:::

Wyświetl plik

@ -2,7 +2,7 @@
The {file}`manage.py` script includes commands for user management. Use these commands to automate managing users from the command line.
All users-related commands are available under the `python manage.py fw users` namespace.
All users-related commands are available under the `python3 manage.py fw users` namespace.
## Create users
@ -16,7 +16,7 @@ You can create users with the {file}`manage.py` script. There are different ways
:sync: debian
```{code-block} sh
poetry run python manage.py fw users create
poetry run python3 manage.py fw users create
```
:::
@ -25,7 +25,7 @@ poetry run python manage.py fw users create
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users create
docker-compose run --rm api python3 manage.py fw users create
```
:::
@ -39,7 +39,7 @@ docker-compose run --rm api python manage.py fw users create
:sync: debian
```{code-block} sh
poetry run python manage.py fw users create --username <username> --email <user email> -p ""
poetry run python3 manage.py fw users create --username <username> --email <user email> -p ""
```
:::
@ -48,7 +48,7 @@ poetry run python manage.py fw users create --username <username> --email <user
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users create --username <username> --email <user email> -p ""
docker-compose run --rm api python3 manage.py fw users create --username <username> --email <user email> -p ""
```
:::
@ -63,7 +63,7 @@ docker-compose run --rm api python manage.py fw users create --username <usernam
```{code-block} sh
export FUNKWHALE_CLI_USER_PASSWORD=<password>
poetry run python manage.py fw users create --username <username> --email <user email>
poetry run python3 manage.py fw users create --username <username> --email <user email>
```
:::
@ -73,7 +73,7 @@ poetry run python manage.py fw users create --username <username> --email <user
```{code-block} sh
export FUNKWHALE_CLI_USER_PASSWORD=<password>
docker-compose run --rm api python manage.py fw users create --username <username> --email <user email>
docker-compose run --rm api python3 manage.py fw users create --username <username> --email <user email>
```
:::
@ -87,7 +87,7 @@ There are extra options for user configuration, such as quota and {term}`permiss
:sync: debian
```{code-block} sh
poetry run python manage.py fw users --help
poetry run python3 manage.py fw users --help
```
:::
@ -96,7 +96,7 @@ poetry run python manage.py fw users --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users --help
docker-compose run --rm api python3 manage.py fw users --help
```
:::
@ -104,7 +104,7 @@ docker-compose run --rm api python manage.py fw users --help
## Update users
You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python manage.py fw users set` namespace.
You can update user accounts using the {file}`manage.py` script. Update commands are available under the `python3 manage.py fw users set` namespace.
### Set upload quota for a user
@ -114,7 +114,7 @@ You can update user accounts using the {file}`manage.py` script. Update commands
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --upload-quota 500 <user>
poetry run python3 manage.py fw users set --upload-quota 500 <user>
```
:::
@ -123,7 +123,7 @@ poetry run python manage.py fw users set --upload-quota 500 <user>
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --upload-quota 500 <user>
docker-compose run --rm api python3 manage.py fw users set --upload-quota 500 <user>
```
:::
@ -137,7 +137,7 @@ docker-compose run --rm api python manage.py fw users set --upload-quota 500 <us
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --staff --superuser <user 1> <user 2>
poetry run python3 manage.py fw users set --staff --superuser <user 1> <user 2>
```
:::
@ -146,7 +146,7 @@ poetry run python manage.py fw users set --staff --superuser <user 1> <user 2>
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --staff --superuser <user 1> <user 2>
docker-compose run --rm api python3 manage.py fw users set --staff --superuser <user 1> <user 2>
```
:::
@ -160,7 +160,7 @@ docker-compose run --rm api python manage.py fw users set --staff --superuser <u
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --no-staff --no-superuser <user>
poetry run python3 manage.py fw users set --no-staff --no-superuser <user>
```
:::
@ -169,7 +169,7 @@ poetry run python manage.py fw users set --no-staff --no-superuser <user>
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --no-staff --no-superuser <user>
docker-compose run --rm api python3 manage.py fw users set --no-staff --no-superuser <user>
```
:::
@ -183,7 +183,7 @@ docker-compose run --rm api python manage.py fw users set --no-staff --no-superu
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --permission-moderation <user>
poetry run python3 manage.py fw users set --permission-moderation <user>
```
:::
@ -192,7 +192,7 @@ poetry run python manage.py fw users set --permission-moderation <user>
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --permission-moderation <user>
docker-compose run --rm api python3 manage.py fw users set --permission-moderation <user>
```
:::
@ -206,7 +206,7 @@ docker-compose run --rm api python manage.py fw users set --permission-moderatio
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --password "<password>" <user>
poetry run python3 manage.py fw users set --password "<password>" <user>
```
:::
@ -215,7 +215,7 @@ poetry run python manage.py fw users set --password "<password>" <user>
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --password "<password>" <user>
docker-compose run --rm api python3 manage.py fw users set --password "<password>" <user>
```
:::
@ -230,7 +230,7 @@ docker-compose run --rm api python manage.py fw users set --password "<password>
```{code-block} sh
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
poetry run python manage.py fw users set <user>
poetry run python3 manage.py fw users set <user>
```
:::
@ -240,7 +240,7 @@ poetry run python manage.py fw users set <user>
```{code-block} sh
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
docker-compose run --rm api python manage.py fw users set <user>
docker-compose run --rm api python3 manage.py fw users set <user>
```
:::
@ -254,7 +254,7 @@ There are extra options for updating users. Check the command help for more opti
:sync: debian
```{code-block} sh
poetry run python manage.py fw users set --help
poetry run python3 manage.py fw users set --help
```
:::
@ -263,7 +263,7 @@ poetry run python manage.py fw users set --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users set --help
docker-compose run --rm api python3 manage.py fw users set --help
```
:::
@ -281,7 +281,7 @@ This prevents the same username being used in future.
:sync: debian
```{code-block} py
poetry run python manage.py fw users rm <user>
poetry run python3 manage.py fw users rm <user>
```
:::
@ -290,7 +290,7 @@ poetry run python manage.py fw users rm <user>
:sync: docker
```{code-block} py
docker-compose run --rm api python manage.py fw users rm <user>
docker-compose run --rm api python3 manage.py fw users rm <user>
```
:::
@ -306,7 +306,7 @@ This means the username can be reused.
:sync: debian
```{code-block} py
poetry run python manage.py fw users rm --hard <user>
poetry run python3 manage.py fw users rm --hard <user>
```
:::
@ -315,7 +315,7 @@ poetry run python manage.py fw users rm --hard <user>
:sync: docker
```{code-block} py
docker-compose run --rm api python manage.py fw users rm --hard <user>
docker-compose run --rm api python3 manage.py fw users rm --hard <user>
```
:::
@ -329,7 +329,7 @@ There are extra options for deleting users. Check the command help for more opti
:sync: debian
```{code-block} sh
poetry run python manage.py fw users rm --help
poetry run python3 manage.py fw users rm --help
```
:::
@ -338,7 +338,7 @@ poetry run python manage.py fw users rm --help
:sync: docker
```{code-block} sh
docker-compose run --rm api python manage.py fw users rm --help
docker-compose run --rm api python3 manage.py fw users rm --help
```
:::

Wyświetl plik

@ -125,7 +125,7 @@ Check the file and remove any duplicated settings after copying.
3. Run the database migrations.
```{code-block} sh
docker-compose run --rm api python manage.py migrate
docker-compose run --rm api python3 manage.py migrate
```
## Start your Funkwhale instance

Wyświetl plik

@ -115,7 +115,7 @@ To restore your database, do the following:
```{code-block} sh
cd /srv/funkwhale/api
poetry run python manage.py migrate
poetry run python3 manage.py migrate
```
:::
@ -132,7 +132,7 @@ To restore your database, do the following:
2. Run the `manage.py migrate` command to set up the database.
```{code-block} sh
docker-compose run --rm api python manage.py migrate
docker-compose run --rm api python3 manage.py migrate
```
:::

Wyświetl plik

@ -100,13 +100,13 @@ Once you have downloaded the new files, you can update your Funkwhale instance.
4. Collect the new static files to serve.
```{code-block} sh
poetry run python manage.py collectstatic --no-input
poetry run python3 manage.py collectstatic --no-input
```
5. Apply new database migrations.
```{code-block} sh
poetry run python manage.py migrate
poetry run python3 manage.py migrate
```
6. Restart the Funkwhale services.

Wyświetl plik

@ -44,7 +44,7 @@ If you installed Funkwhale following the [Docker guide](../installation_docs/doc
8. Apply the database migrations.
```{code-block} sh
docker-compose run --rm api python manage.py migrate
docker-compose run --rm api python3 manage.py migrate
```
9. Relaunch your containers.

Wyświetl plik

@ -32,7 +32,7 @@ You can install third-party plugins using the `manage.py` script. To do this:
:::{tab-item} Debian
```{code-block} shell
python manage.py fw plugins install https://plugin_url.zip
python3 manage.py fw plugins install https://plugin_url.zip
```
:::
@ -40,7 +40,7 @@ You can install third-party plugins using the `manage.py` script. To do this:
:::{tab-item} Docker
```{code-block} shell
docker-compose run --rm api python manage.py fw plugins install https://plugin_url.zip
docker-compose run --rm api python3 manage.py fw plugins install https://plugin_url.zip
```
:::

Wyświetl plik

@ -72,7 +72,7 @@ docker-compose -f dev.yml build
Funkwhale relies on a postgresql database to store information. To set this up, you need to run the `manage.py migrate` command:
```sh
docker-compose -f dev.yml run --rm api python manage.py migrate
docker-compose -f dev.yml run --rm api python3 manage.py migrate
```
This command creates all the required tables. You need to run this whenever there are changes to the API schema. You can run this at any time without causing issues.
@ -84,7 +84,7 @@ You need to create some local data to mimic a production environment.
1. Create a superuser so you can log in to your local app:
```sh
docker-compose -f dev.yml run --rm api python manage.py createsuperuser
docker-compose -f dev.yml run --rm api python3 manage.py createsuperuser
```
2. Add some fake data to populate the database. The following command creates 25 artists with random albums, tracks, and metadata.
@ -92,7 +92,7 @@ You need to create some local data to mimic a production environment.
```sh
artists=25 # Adds 25 fake artists
command="from funkwhale_api.music import fake_data; fake_data.create_data($artists)"
echo $command | docker-compose -f dev.yml run --rm -T api python manage.py shell -i python
echo $command | docker-compose -f dev.yml run --rm -T api python3 manage.py shell -i python
```
## Manage services
@ -194,8 +194,8 @@ To run a reverse proxy for your app:
```sh
export COMPOSE_PROJECT_NAME=node2
export VUE_PORT=1234 # this has to be unique for each instance
docker-compose -f dev.yml run --rm api python manage.py migrate
docker-compose -f dev.yml run --rm api python manage.py createsuperuser
docker-compose -f dev.yml run --rm api python3 manage.py migrate
docker-compose -f dev.yml run --rm api python3 manage.py createsuperuser
docker-compose -f dev.yml up nginx api front nginx api celeryworker
```

Wyświetl plik

@ -1,10 +1,10 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from subprocess import call
# initial make
call(["python", "-m", "sphinx", ".", "/tmp/_build"])
call(["python3", "-m", "sphinx", ".", "/tmp/_build"])
from livereload import Server, shell # noqa: E402
server = Server()
server.watch("..", shell("python -m sphinx . /tmp/_build"))
server.watch("..", shell("python3 -m sphinx . /tmp/_build"))
server.serve(root="/tmp/_build/", liveport=35730, port=8001, host="0.0.0.0")