mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-21 05:56:03 -05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ddfae7c95 | ||
|
|
f1969e4637 | ||
|
|
9e7a7a7482 | ||
|
|
6e478e6e82 | ||
|
|
e06deed3b8 |
@@ -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
|
||||
|
||||
@@ -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')
|
||||
```
|
||||
```
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user