SkillAgentSearch skills...

Pythonbangla.com

A dynamic content management system for publishing youtube videos and blog post in a single page web application.

Install / Use

/learn @mahmudahsan/Pythonbangla.com

README

<p align="center"> <a href="/"> <img src="https://img.shields.io/badge/build-passing-brightgreen.svg" alt="Build" /> </a> <a href="https://www.djangoproject.com/"> <img src="https://img.shields.io/badge/django-2.0-blue.svg" alt="django" /> </a> <a href="https://getbootstrap.com/"> <img src="https://img.shields.io/badge/bootstrap-4.0-orange.svg" alt="Bootstrap" /> </a> <a href="https://github.com/mahmudahsan/pythonbangla.com/blob/master/LICENSE"> <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /> </a> <a href="https://twitter.com/mahmudahsan"> <img src="https://img.shields.io/badge/contact%40-mahmudahsan-red.svg" alt="Twitter: @mahmudahsan" /> </a> </p>

pythonbangla.com

A dynamic content management system for publishing youtube videos and blog post in a single page web application. I developed this web app to place all my youtube video tutorials and related blog post links in one place.

Demo 1 🤓: Django + PostgreSQL + Heroku | Source Code: Github Django

Demo 2 😎: React + Firebase | Source Code: Github React

🔥 I developed a React and Firebase based similar project. Checkout the React based project's source code https://github.com/mahmudahsan/python-bangla-react

Usage

If you know django, postgresql, bootstrap you can easily modify html template and backend according to your project needs. But if you just want a site like the demo Pythonbangla.com you can change the images in static directory in the project, and add contents from your or your client's youtube channel or blog post. To know how to setup, follow the table of contents.

Other Python Projects

Table of Contents

Technology Used

  1. Django
  2. PostgreSQL
  3. Bootstrap
  4. JQuery
  5. Linkyfy

Features

  1. Responsive single page webapp
  2. Admin Panel for content management
  3. Automatic playlist created based on content
  4. Mainly developed for youtube videos
  5. Blog post or external link list also supported
  6. Youtube video description also can be added from admin panel
  7. In description, link automatically converted to hyperlink
  8. In Admin easy way to add javascript code within head tag
  9. Easy way to add Google Analytics or Google Adsense auto ads

Setup in local machine

Let assume our project name will be djangodemo

  1. First clone this project or fork and clone your fork url
git clone https://github.com/mahmudahsan/pythonbangla.com.git djangodemo
cd djangodemo # Enter the project dir
  1. Now run and install django by pipenv
pipenv install django
pipenv shell # Activate pipenv

Setup PostgreSQL in local machine

  1. Downlaod and install PostgreSQL
  2. Run the PostgreSQL in your machine
  3. Download pgAdmin if you prefer managing PostgreSQL visually
  4. Run pgAdmin to create database visually
  5. Or Create a database in PostgreSQL in terminal
  6. Update django frameworks's project settings djangodemo/pythonbangla_project/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "YOUR_LOCAL_DB_NAME",
        "USER": "YOUR_POSTGRESQL_USER_NAME",
        "PASSWORD": "YOUR_POSTGRESQL_PASSWORD",
        "HOST": "localhost", 
        "PORT": "5432", # usually this port unless your port is different
    }
}
  1. Apply database migration from django to postgresql This will convert all the models to SQL tables in postgresql
python3 manage.py migrate
  1. Start django server locally
python3 manage.py runserver
  1. Visit http://127.0.0.1:8000/ in a web browser. You will see the following blank webpage without any contents
<p align="center"> <img src="github-readme-assets/demo1.png" width="800" alt="demo 1" /> </p>
  1. Quit the server with CONTROL-C in terminal
CONTROL-C

How to use admin panel to manage contents

  1. First create a superuser
python3 manage.py createsuperuser
  1. Now run the server again
python3 manage.py runserver
  1. Now in web browser visit http://127.0.0.1:8000/admin . Login with the superuser name and password you created already.

You will see the following admin panel with 4 tables

<p align="center"> <img src="github-readme-assets/demo2.png" width="800" alt="demo 2" /> </p>
  1. Now add a topic category. Click the [+ Add] button

You will see the following form

<p align="center"> <img src="github-readme-assets/demo3.png" width="800" alt="demo 3" /> </p>

Now fill the form for our demo purpose. In later you can modify/remove/add anything according to your requirments. After filling, SAVE the form.

| Column | Data | |--- |--- | | Title English | Python Beginner | | Title Other | পাইথন বিগিনার | | Short Description | পাইথন দিয়ে আমরা একটা ওয়েব অ‍্যাপ বানাই। | | Image Name | py-beg.png | | Topic Type | Youtube |

py-beg.png image already stored in projects djangodemo/static/img/py-beg.png. So if you want to use other image, please put that on this directory and mention the name in the form.

  1. Now go to Home › Main_App and click [+ Add] in Topic Contents

You will see the following form. Fill with some data like the demo and click SAVE.

  • Url is used for Blog Post link, so for youtube no need.
  • Tag is optional as well. If you put tag, it will be shown in the home page playlist.
  • Order is used to rank list item accordingly.
<p align="center"> <img src="github-readme-assets/demo4.png" width="800" alt="demo 4" /> </p>
  1. Now visit http://127.0.0.1:8000 again

You will see the following web page

<p align="center"> <img src="github-readme-assets/demo5.png" width="800" alt="demo 5" /> </p>
  1. To publish URL links like the following example
<p align="center"> <img src="github-readme-assets/demo6.png" width="800" alt="demo6" /> </p>
  • Add a topic category and set the Topic Type URL
<p align="center"> <img src="github-readme-assets/demo7.png" width="800" alt="demo7" /> </p>
  • Add topic content and provide Title and URL
<p align="center"> <img src="github-readme-assets/demo8.png" width="800" alt="demo8" /> </p>

Now visit http://127.0.0.1:8000 again to see the updates

Social Links

  1. To add social links like facebook, twitter etc
<p align="center"> <img src="github-readme-assets/demo-social1.png" width="800" alt="demo-social1" /> </p>
  • Add item in Social Link table. If you don't provide any link, nothing will appear at top. By default the social icons are shown from djangodemo/static/img/social dirs
<p align="center"> <img src="github-readme-assets/demo-social2.png" width="800" alt="demo-social2" /> </p>

JavaScript code like Google analytics or Google adsense code can be pushed within head tags

  • To do this add site option and paste javascript code in header section
  • Only create one field in this table and add as many javascript code you want
  • Also provide Title, Meta Author and Meta Description fields to show them in your site's html page
<p align="center"> <img src="github-readme-assets/demo9.png" width="800" alt="demo 9" /> </p>

Setup Amazon S3 CDN to upload static content

Django by default doesn't support serving static files in production. So the best and recommended way to upload static files in CDN network. In this case, I like Amazon S3 CDN and its super easy to use.

  1. First you need to create a Amazon Aws account

  2. You have to create S3 bucket/container. To know how to proceed follow this tutorial

  3. Install two new libraries

pipenv install boto3
pipenv install django-storages
  1. Updates project's settings.py file
  • Add 'storage' above the app within INSTALLED_APPS
INSTALLED_APPS = [
    ...,
    'storages',
    'main_app'
]
  • At the bottom of setting.py write and update the following codes and fill the ID, KEY, BUCKET_NAME from your account.
  • Also special notice AWS_S3_CUSTOM_DOMAIN this part. If you create different location for your bucket, you have to update it s3.us-east-2.amazonaws.com and have to give proper location
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_STORAGE_BUCKET_NAME = ''
AWS_S3_CUSTOM_DOMAIN = 's3.us-east-2.amazonaws.com/%s' % AWS_STORAGE_BUCKET_NAME
AWS_S3_OBJECT_PARAMETERS = {
'CacheControl': 'max-age=86400',
}
AWS_LOCATION = 'static'

STATICFILES_DIRS = [
os.path.join(BASE_DIR
View on GitHub
GitHub Stars70
CategoryContent
Updated2mo ago
Forks38

Languages

Python

Security Score

100/100

Audited on Jan 27, 2026

No findings