Compare commits

...

5 Commits
v1.7 ... v1.8

Author SHA1 Message Date
Markos Gogoulos
1ddfae7c95 update black (#452) 2022-05-10 13:46:22 +03:00
Markos Gogoulos
f1969e4637 pin version of debug toolbar 2022-05-09 21:05:25 +03:00
Markos Gogoulos
9e7a7a7482 Update developers_docs.md 2022-04-27 21:53:11 +03:00
Markos Gogoulos
6e478e6e82 fix typo on documentation 2022-03-23 20:48:26 +02:00
Behnam B.Marandi
e06deed3b8 Add configuration for only member access to media (#424)
I added an entry under 'Configuration 'per discussion in the Q&A section:
https://github.com/mediacms-io/mediacms/discussions/422
2022-03-23 20:47:06 +02:00
5 changed files with 28 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ repos:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3

View File

@@ -436,7 +436,10 @@ ADMINS_NOTIFICATIONS = {
- MEDIA_ADDED: a media is added
- MEDIA_REPORTED: the report for a media was hit
### 5.23 Configure only member access to media
- Make the portal workflow public, but at the same time set `GLOBAL_LOGIN_REQUIRED = True` so that only logged in users can see content.
- You can either set `REGISTER_ALLOWED = False` if you want to add members yourself or checkout options on "django-allauth settings" that affects registration in `cms/settings.py`. Eg set the portal invite only, or set email confirmation as mandatory, so that you control who registers.
## 6. Manage pages
to be written
@@ -683,4 +686,4 @@ For example, while specifying wrong password for my Gmail account I get
```
SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials d4sm12687785wrc.34 - gsmtp')
```
```

View File

@@ -19,6 +19,26 @@ to be written
API is documented using Swagger - checkout ot http://your_installation/swagger - example https://demo.mediacms.io/swagger/
This page allows you to login to perform authenticated actions - it will also use your session if logged in.
An example of working with Python requests library:
```
import requests
auth = ('user' ,'password')
upload_url = "https://domain/api/v1/media"
title = 'x title'
description = 'x description'
media_file = '/tmp/file.mp4'
requests.post(
url=upload_url,
files={'media_file': open(media_file,'rb')},
data={'title': title, 'description': description},
auth=auth
)
```
## 4. How to contribute
Before you send a PR, make sure your code is properly formatted. For that, use `pre-commit install` to install a pre-commit hook and run `pre-commit run --all` and fix everything before you commit. This pre-commit will check for your code lint everytime you commit a code.

View File

@@ -330,7 +330,7 @@ def media_file_info(input_file):
except ValueError:
hms, msec = duration_str.split(",")
total_dur = sum(int(x) * 60 ** i for i, x in enumerate(reversed(hms.split(":"))))
total_dur = sum(int(x) * 60**i for i, x in enumerate(reversed(hms.split(":"))))
video_duration = total_dur + float("0." + msec)
else:
# fallback to format, eg for webm
@@ -409,7 +409,7 @@ def media_file_info(input_file):
hms, msec = duration_str.split(".")
except ValueError:
hms, msec = duration_str.split(",")
total_dur = sum(int(x) * 60 ** i for i, x in enumerate(reversed(hms.split(":"))))
total_dur = sum(int(x) * 60**i for i, x in enumerate(reversed(hms.split(":"))))
audio_duration = total_dur + float("0." + msec)
else:
# fallback to format, eg for webm

View File

@@ -28,6 +28,6 @@ django-celery-email
m3u8
django-ckeditor
django-debug-toolbar
django-debug-toolbar==3.2.4
django-login-required-middleware==0.6.1