iRead is an open platform where readers find dynamic thinking, and where expert and undiscovered voices can share their writing on any topic.
Currently we support the following features :
Frontend: HTML, CSS(+ Bootstrap 4), JavaScript
Backend: Python/Django
Database: PostgreSQL
And additional requirements are in requirements.txt or Pipfile.
https://ireadblog.com/api/v1
pk
refers to the Post ID.thumbnail
is: https://res.cloudinary.com/dlomjljb6/image/upload/v1/
https://ireadblog.com/posts/<post_id>/<post_slug>
Endpoint for all posts: /posts
[
{
"model": "core.post",
"pk": 92,
"fields": {
"title": "Your title here",
"seo_overview": "Your post overview here",
"slug": "post-slug-here",
"content": "Your post content here",
"timestamp": "2022-02-22T02:43:40.770Z",
"author": "Ashutosh Krishna",
"thumbnail": "media/blog/thumbnails/R_xjlzdd",
"categories": "CategoryName",
"tags": ["tag1", "tag2"]
}
}
]
?limit=x
in the URL. https://ireadblog.com/api/v1/posts?limit=3
returns the latest 3 posts on iRead.Endpoint for posts for specific category: /posts?category=<category-slug>
<category-slug>
with correct category slughttps://ireadblog.com/categories/web-development
. So the <category-slug>
is web-development
. ?category=<category-slug>&limit=x
in the URL. https://ireadblog.com/api/v1/posts?category=web-development&limit=3
returns the latest 3 Web Development posts on iRead.Endpoint for posts for specific tag: /posts?tag=<tag-name>
<tag-slug>
with correct tag namehttps://ireadblog.com/tags/DevInceptCommunity
. So the <tag-name>
is DevInceptCommunity
. ?tag=<tag-name>&limit=x
in the URL. https://ireadblog.com/api/v1/posts?tag=DevInceptCommunity&limit=3
returns the latest 3 posts on iRead with the tag #DevInceptCommunity.Endpoint for posts for a user: /<username>/posts
<username>
with your username.?limit=x
in the URL. https://ireadblog.com/api/v1/posts?limit=3
returns the latest 3 posts by that user on iRead.Endpoint for a single post: /post/<post_id>/<slug>
<post_id>
with the Post ID and <slug>
with the slug of the post.https://ireadblog.com/feed
https://ireadblog.com/feed/<username>
Fork the Repository.
Clone the repository to your local machine $ git clone https://github.com/<your-github-username>/iRead.git
Change directory to iRead $ cd iRead
Add a reference to the original repository
$ git remote add upstream https://github.com/ashutoshkrris/iRead.git
Install venv $ pip3 install venv
Create a virtual environment $ python -m venv env
Activate the env: $ source env/bin/activate
(for linux) > ./env/Scripts/activate
(for Windows PowerShell)
Install the requirements: $ pip install -r requirements.txt
Create a new file in the root directory of the repository (iRead
) with name .env
(only .env
and not .env.txt
) and add the following content in it:
DEBUG=True
SECRET_KEY=ss)143p*@)jxwzge9-i26c40_9*r%p1l0&_*nlr-_*m+op#2^w
DB_NAME=blog
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
EMAIL_HOST_USER='email@domain.com'
EMAIL_HOST_PASSWORD='password'
CLOUD_NAME='cloudinary-cloud-name'
API_KEY='cloudinary-api-key'
API_SECRET='cloudinary-api-secret'
GOOGLE_OAUTH_CLIENT_ID='google-key'
GOOGLE_OAUTH_CLIENT_SECRET='google-secret'
TWITTER_API_KEY='twitter-api-key'
TWITTER_API_SECRET_KEY='twitter-api-secret-key'
TWITTER_ACCESS_TOKEN='twitter-access-token'
TWITTER_ACCESS_TOKEN_SECRET='twitter-access-token-secret'
REDIS_URL=redis://127.0.0.1:6379/1
REVUE_API_KEY='revue-api-here'
or, just copy the .env.save
file from samples
directory to the root directory (iRead
) and rename it to .env
(only .env
and not .env.txt
)
Note : You can also use Pipenv for virtual enviroment. You can find few related commands here.
Copy sample-db.sqlite3
from samples
directory to the root directory (iRead
) and rename it to db.sqlite3
.
Make migrations $ python manage.py makemigrations
Migrate the changes to the database $ python manage.py migrate
Create admin $ python manage.py createsuperuser
Run the server $ python manage.py runserver
$ git pull upstream master
on your local master branch).$ git checkout -b <new-branch-name>
), never ever make any changes directly on the master branch.