Blogger is a cloud-enabled, Django-powered application for writing blog posts.
https://quiet-crag-39123.herokuapp.com/
- Users can create,update and delete their blog posts
- Users can change their profile image
Blogger uses a number of open source projects to work properly:
- Django - Python web framework
- Heroku - lets you deploy, run and manage applications.
- AWS S3 - Object storage built to store and retrieve any amount of data from anywhere.
Dillinger requires Django to run.
- Install the dependencies.
pip3 install -r requirements.txt- Make database migrations
python manage.py migrate- Start the server
python manage.py runserver - Go to localhost:8000
- To load the media files , you have to create an aws s3 bucket
- Create a .env file in the root dir of the project
touch .env- Go to aws s3 > create a new s3 bucket , get
- Get the access key
- secret access key
- bucket name
- Generate a secret key with python secrets module
- Open python shell
- Type
import secrets print(secrets.token_hex(48))
- Copy the token
- Go to .env file. Paste the following values without quotes
SECRET_KEY=<copied from python>
DEBUG_VALUE=True
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.
- Create a superuser
python manage.py createsuperuser specify the username and password 2. Go to http://localhost:8000/admin 3. Login with the credentials 4. Here you will see all the django models and data inside each
draw.io: https://drive.google.com/file/d/1d9_tA4-hD69lz7S-AuzIac2TnycBCl5E/view?usp=sharing
Blogger is very easy to install and deploy in a Docker container.
By default, the Docker will expose port 8000, so change this within the Dockerfile if necessary. When ready, simply use the Dockerfile to build the image.
docker build -t django-app .This will create the dillinger image and pull in the necessary dependencies in requirements.txt. Once done, run the Docker image
docker compose up -dVerify the deployment by navigating to your server address in your preferred browser. localhost:8000