Skip to main content

An app to manage Linkedin posts in a Django project

Project description

django-linkedin-posts

Set up

  1. Get your Linkedin Access Token https://www.linkedin.com/developers/tools/oauth/token-generator
  2. Install from PyPI
python -m pip install django-linkedin-posts
  1. Add the package to your settings INSTALLED_APPS
INSTALLED_APPS = [
    ...
    "django_linkedin_posts",
    ...
]
  1. 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")

## Not needed at the moment
# 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 
post.share()

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

django-linkedin-posts-0.0.1.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

django_linkedin_posts-0.0.1-py3-none-any.whl (17.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page