An app to manage Linkedin posts in a Django project
Project description
django-linkedin-posts
Set up
- Get your Linkedin Access Token https://www.linkedin.com/developers/tools/oauth/token-generator
- Install from PyPI
python -m pip install django-linkedin-posts
- Add the package to your settings INSTALLED_APPS
INSTALLED_APPS = [
...
"django_linkedin_posts",
...
]
- Add the following setting variables
## thid-party apps
# django-linkedin-posts (our app)
import os
from dotenv import load_dotenv # python-dotenv
load_dotenv()
LINKEDIN_AUTHOR_TPYE="organization" # "organization" or "person"
LINKEDIN_AUTHOR_ID=os.environ.get("LINKEDIN_AUTHOR_ID")
LINKEDIN_ACCESS_TOKEN=os.environ.get("LINKEDIN_ACCESS_TOKEN")
## The following keys are not needed at the moment.action-checkbox
## But they are planned to be used.
## For example for updating the Access Token using the Refresh Token
# LINKEDIN_CLIENT_ID=os.environ.get("LINKEDIN_CLIENT_ID")
# LINKEDIN_CLIENT_SECRET=os.environ.get("LINKEDIN_CLIENT_SECRET")
# LINKEDIN_REFRESH_TOKEN=os.environ.get("LINKEDIN_REFRESH_TOKEN")
Usage
- Create a simple Post
from django_linkedin_posts.models import Post
# create a post instance in the db
post = Post.objects.create(
comment="Hi, this is me publishing a post using django-linkedin-posts"
)
# share it in Linkedin
sharedpost = post.share()
# Attention! sharedpost and post instances are the same one,
# but the sharedpost has more info (data collected from Linkedin).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-linkedin-posts-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f9a68a9c469afb2b1722fff748db91b55868df0919334837cad30917b7e9389 |
|
MD5 | b0d3ef09dd989095842f8929bbbe9951 |
|
BLAKE2b-256 | 25369e60e11a3a5e511143b013d3a5ae91d58141f23d04eac2362596a5bfb1dd |
Close
Hashes for django_linkedin_posts-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47c2b5a80faf10998f60e293d7d7beebcaf7e158cbc273cc58b7f5604a909d55 |
|
MD5 | a62fdcb7938f3203a17ba4a81e957099 |
|
BLAKE2b-256 | a61227f9c82c23e9f182c82dc7e07ec766c1d913064282277b2addee61047290 |