/django-blog-template

This blog is built following Corey Schafer's Django series. The blog will have the. following features. I will setup a CI/CD pipeline that runs the application through a series of unit tests and then deploys he application and deploys it to AWS Amplify.

Primary LanguagePython

django-blog-template

This blog is built following Corey Schafer's Django series.

Features

  • users can CREATE blogposts
  • users who create blogposts can EDIT the posts
  • users who create blogposts can DELETE their posts
  • new users can SIGN IN
  • existing users can LOGIN and LOGOUT
  • existing users can CHANGE their password
  • users can OVERWRITE their existing passwords using the 'forgot password' feature

Goal

  • To setup a CI/CD pipeline that runs the application through a series of unit tests and then deploys the application (blog) to Azure App Services.

Setting Up

  • Create a virtual environment.
python -m venv venv
  • Install requirements
pip install -r requirements.txt
  • Run the app
cd tutorial
python manage.py runserver

image

*localhost*
  • To run tests,
python manage.py test ./blog 
python manage.py test ./account
  • To setup a password that enables less secure apps (Django), send mails to your Gmail (for reset password/ forgot password functionality), first follow this guide.

  • To Dockerize the app

$ docker login
$ docker build -t  dockerhub-username/docker-image-name .
$ docker push dockerhub-username/docker-image-name
  • Run the dockerized app
docker compose up