A blog platform built with Django and PostgreSQL.
Includes users, authors, categories and post management.
- Python 3.10+
- PostgreSQL
- pip or pipenv
- gettext installed on your machine
git clone https://github.com/PnEcrins/intrablog.git
cd intrablogpython -m venv env
source env/bin/activate # On Windows: env\Scripts\activatepip install -r requirements.txtMake sure you have
python-dotenvinstalled.
-
Copy the example file:
cp .env-sample .env cp intraBlog/local_settings.py.sample intraBlog/local_settings.py
-
Edit
.envand fill in your PostgreSQL credentials:DB_NAME=your_db_name DB_USER=your_db_user DB_PASSWORD=your_password SECRET_KEY=your_django_secret_key
Log in to PostgreSQL and create your database and user:
CREATE USER your_db_user WITH PASSWORD 'your_password';
CREATE DATABASE your_db_name OWNER <DB_USER> ;python manage.py migratepython manage.py createsuperuserpython manage.py runserverThen visit: http://127.0.0.1:8000/admin
Run this command in order to group all static files in one single place :
python manage.py collectstatic
Change the local_settings.py parameters :
ALLOWED_HOSTS = ["myhost"]
CSRF_TRUSTED_ORIGINS = ["http://myhost"]
Create a systemd service
Copy and adapt the sample service file intrablog.service into /etc/systemd/system/intrablog.service
Then run :
systemctl daemon-reload
systemctl enable intrablog.service
systemctl start intrablog.service
The service is now running !
Configure Apache
apt install apache2
a2enmod proxy
a2enmod proxy_http
Create a conf in /etc/apache2/sites-availables
<VirtualHost *:80>
ServerName intrablog
Alias "/static/" "/home/intranet/intraBlog/static/"
<Directory "/home/intranet/intraBlog/static">
Require all granted
</Directory>
<Location "/">
ProxyPass http://127.0.0.1:8000/
ProxyPassReverse http://127.0.0.1:8000/
ProxyPreserveHost On
</Location>
<Location "/static">
ProxyPass !
</Location>
</VirtualHost>
.env file!
Make sure .env is in .gitignore (already included).
- User registration & authentication
- Author & Category models
- Blog post CRUD
- Admin panel customization
- PostgreSQL support
- Python 3.12.4
- Django 5.2
- Django Rest Framework
- PostgreSQL 16.8
- HTML/CSS (admin)
- python-dotenv for environment config
intrablog/
├── blog/ ← your app
├── intrablog/ ← settings, urls, wsgi
├── locale/ ← language locales
├── media/ ← your images and files (ignored)
├── env/ ← virtual environment (ignored)
├── .env ← your local config (ignored)
├── .env-sample ← template for developers
├── manage.py
├── requirements.txt
└── README.md
Forks welcome! Open an issue or pull request if you'd like to collaborate.
GPL-3.0 License.