Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.3 KB

README.md

File metadata and controls

28 lines (16 loc) · 1.3 KB

wp_upload_media

Upload media on wordpress by using python. Media can have custom fields like description and caption. Project uses the new REST Api on Wordpress

Python Version

for Python version 3.6

Plugin used for generation of tokens in Wordpress

https://wordpress.org/plugins/application-passwords/

Fix for Wordpress plugin in case it's not working:

citing from: https://discussion.dreamhost.com/t/how-to-post-content-to-wordpress-using-python-and-rest-api/65166

"For a quick demo, the Application Passwords plugin for WordPress21 is the easiest choice. The installation is straightforward, and the instructions to generate a password for the client application are quite simple to follow. I needed to modify the .htaccess file9 due to the way my DreamPress site is configured. Notice: the password generated by the plugin contains white spaces, and they are part of the password. Once the WordPress authentication is taken care of, it’s all much easier."

Fix:

https://github.com/georgestephanis/application-passwords/wiki/Basic-Authorization-Header----Missing

change .htaccess

citing from above you have to do the following:

"What we need to do is add this line:

RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

directly after the RewriteEngine On line -- so your final block will look like this:"