Log status codes when initializing actor
This commit is contained in:
parent
c1cecd45a4
commit
8cf98afe0b
|
@ -36,14 +36,13 @@ tasks:
|
||||||
# Login with cURL to create actors
|
# Login with cURL to create actors
|
||||||
docker-compose up -d nginx
|
docker-compose up -d nginx
|
||||||
gp ports await 8000
|
gp ports await 8000
|
||||||
sleep 10
|
|
||||||
python .gitpod/init_actor.py
|
|
||||||
|
|
||||||
# Import music
|
# Import music
|
||||||
git clone https://dev.funkwhale.audio/funkwhale/catalog.git
|
git clone https://dev.funkwhale.audio/funkwhale/catalog.git
|
||||||
sudo mv catalog/music data
|
sudo mv catalog/music data
|
||||||
sudo chown -R root:root data/music
|
sudo chown -R root:root data/music
|
||||||
rm -rf catalog
|
rm -rf catalog
|
||||||
|
python .gitpod/init_actor.py
|
||||||
LIBRARY_ID=`cat .gitpod/create_library.py | docker-compose run --rm -T api python manage.py shell -i python`
|
LIBRARY_ID=`cat .gitpod/create_library.py | docker-compose run --rm -T api python manage.py shell -i python`
|
||||||
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/music/" --recursive --noinput --in-place
|
docker-compose run --rm api python manage.py import_files $LIBRARY_ID "/music/" --recursive --noinput --in-place
|
||||||
docker-compose stop
|
docker-compose stop
|
||||||
|
|
|
@ -4,14 +4,17 @@ import requests
|
||||||
req = requests.Session()
|
req = requests.Session()
|
||||||
|
|
||||||
res = req.get('http://localhost:8000/login')
|
res = req.get('http://localhost:8000/login')
|
||||||
|
print(res.status_code, res.cookies)
|
||||||
token = res.cookies['csrftoken']
|
token = res.cookies['csrftoken']
|
||||||
|
|
||||||
req.post('http://localhost:8000/api/v1/users/login', data={
|
res = req.post('http://localhost:8000/api/v1/users/login', data={
|
||||||
'username': 'gitpod',
|
'username': 'gitpod',
|
||||||
'password': 'gitpod'
|
'password': 'gitpod'
|
||||||
}, headers={
|
}, headers={
|
||||||
'Referer': 'http://localhost:8000/login',
|
'Referer': 'http://localhost:8000/login',
|
||||||
'X-CSRFTOKEN': token
|
'X-CSRFTOKEN': token
|
||||||
})
|
})
|
||||||
|
print(res.status_code)
|
||||||
|
|
||||||
req.get('http://localhost:8000')
|
res = req.get('http://localhost:8000/api/v1/libraries/?scope=me')
|
||||||
|
print(res.status_code)
|
Loading…
Reference in New Issue