PyPlanet Article Sharer Django App
Last week we kicked off 100 days of Django and this is our first Django app!
This app lets you import Planet Python's feed into an SQLite DB.
The Django front-end shows the articles in a table:
Upon clicking each link it shows the parsed data and action buttons:
The "Tweet this" button uses Twitter's Web Intents (redirect to generated link)
You can update the article as "Shared" or "Skipped" which is updated in the DB:
Try it yourself!
clone this repo:
$ git clone firstname.lastname@example.org:pybites/pyplanet-django.git
make venv and install dependencies:
$ python3 -m venv venv && source venv/bin/activate (venv) $ pip install -r requirements.txt
create DB tables (admin stuff to be added):
(venv) $ python manage.py migrate Operations to perform: Apply all migrations: admin, articles, auth, contenttypes, sessions Running migrations: Applying contenttypes.0001_initial... OK ... ... Applying sessions.0001_initial... OK
run the management command to import Planet Python's feed:
(venv) $ python manage.py importfeed Article id 1 created Article id 2 created ... ... Article id 25 created 25 articles added
run local server:
(venv) $ python manage.py runserver
browse to http://127.0.0.1:8000/
Deploy to Heroku or PythonAnywhere
importfeedcommand to a cronjob
Add user authentication and tracking who edits what (already field in the model)
Integrate Twitter API so green "Mark Shared" button can be made redundant