https://github.com/ramibch/django-linkedin-posts
An app to manage Linkedin posts in a Django project
https://github.com/ramibch/django-linkedin-posts
django django-application django-applications linkedin linkedin-api marketing-automation social-media
Last synced: 4 months ago
JSON representation
An app to manage Linkedin posts in a Django project
- Host: GitHub
- URL: https://github.com/ramibch/django-linkedin-posts
- Owner: ramibch
- License: gpl-3.0
- Archived: true
- Created: 2023-09-07T17:29:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T07:24:33.000Z (over 2 years ago)
- Last Synced: 2026-01-14T06:22:08.890Z (5 months ago)
- Topics: django, django-application, django-applications, linkedin, linkedin-api, marketing-automation, social-media
- Language: Python
- Homepage: https://pypi.org/project/django-linkedin-posts/
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# django-linkedin-posts
## Set up
0. Get your Linkedin Access Token
[https://www.linkedin.com/developers/tools/oauth/token-generator](https://www.linkedin.com/developers/tools/oauth/token-generator)
1. Install from PyPI
```
python -m pip install django-linkedin-posts
```
2. Add the package to your settings INSTALLED_APPS
```python
INSTALLED_APPS = [
...
"django_linkedin_posts",
...
]
```
3. Add the following setting variables
```python
## 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
## 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
```python
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()
```
### Create a poll with options
```python
from django_linkedin_posts.models import create_poll_with_options
# create a poll with its options.
p = create_poll_with_options("hello", "What's up?", ["good", "bad"])
# share it
p.share()
```