codeBlooded1997 / Django-blog-app

Blog (Django)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Blog App

Arian Aghnaei

March 2020


Building a blog application using python Django framework

I've done few Djnaog projects before but this time I really want to learn Django framework to be able to deploy my web scraping and automation projects online as an open source projects. The best way of learning for me is by building projects so I've diceided to created small but usefull Djnaog powered apps so I can add them to my bigger projects later.

In this project I'm using Djnago and python to build a Blog web application. I've done some reaserches about Django bsic concepts and learned the fundementals of the framework like what is a model and how to connect models to each other, what is a view and how to handle urls in a Django project, what is django allauth package and how to configure my app seetings to be able to use them,... .

Now I want to ues the consepts to create a Blog website that have the like functionallity, counts veiws of each post and authenticate users can leave comments on each post.

For this project I will use Bootstrap 4 to develope a very simple frontend because my main focuse in on learning backend and explore the logic behind a Django blog app, but I will update it's view and create a better view for this app in the future.

This is not a deployed on any web server for now but maybe I user AWS or DigitalOcean to deploy it in the future (When it has a cool view maybe!!) so if you want to take a look at the project and test it please clone it and run it on you localhost.


What I learned :

  • Creating mmodels that are connected to eachother and accessing their data from Django templates.
  • Configuring Django allauth
  • Customizing Djnago allauth urls for redirecting to preferred path
  • Uisng django crispy forms to create a form for leaving comments.
  • Creating forms based on defined models.
  • Defining property models so they will be usable easily in the templates.
  • What is get_absolute_url and how it can be helpful in managing urls used in templates.


How to use

  1. Clone the arepository
  2. Install the required packages using requirements.txt file.
  3. Open new terminal window and navigate to directory where the manage.py file is.
  4. Create a virtual enviroment to run your code isolated.
  5. Run python manage.py runserver command to run Django app locally on you local server.

The code is fully commented and I've left some notes so I can use remember what I did.

I really want to know what other developers like you are thinking about my code so don't hesitete to contact me and share your idea about this piece of code.

About

Blog (Django)


Languages

Language:HTML 58.1%Language:Python 41.9%