Hello! I have recently just learned how to create a Django website. And like I always do, I just wrote a fresh guide that anyone can follow whether or not you have had experience with the framework.
Prerequisites
- Bash
- Git
- Python (Object-oriented approach)
- Basic HTML and CSS
Listed above are what I think are the prerequisites for this particular guide. I really believe that they are easy to learn. If you’re not confident with your skills with the above items, I suggest going through the following tutorials first:
- An Introduction to the Linux Terminal
- GitHub Git Cheat Sheet
- Python Crash Course
- Python Object-oriented Programming
- Basic HTML and HTML5
- CSS in 5 minutes
- HTML Tutorial for Beginners
Expectations
Using this guide, you should be able to create a simple blog web app with Django and deploy it using Heroku, which means that you will have a live blogsite running if you stick with me towards the end. I tried my best to make this guide as beginner friendly as possible. Also, I didn’t want it to be overwhelming so I divided it into four parts which I’ve outlined below.
Outline
Part 1: Initializing your Django application
- Set-up the development environment.
- Create the django project.
- Create the blog app.
- Define the models for the blog app.
- Create a site administrator.
- Use the Django shell to create a post.
Part 2: Creating the Django application interface
- List the app’s features.
- Set-up the URLs and initialize the views.
- Set-up the templates folder.
- Create the index page.
- Create the post page.
Part 3: Getting data from Django forms
- Create the Django form for the model.
- Link the form to its corresponding views and templates.
- Enable user authentication.
- Make the site navigation better.
- Create the base template for all templates.
Part 4: Deploying your Django app
- Set up Heroku.
- Set up static assets and database configuration.
- Create the heroku app.
- Configure the git repository within the project and deploy!
Alright. Now go ahead and click here to get started on your Django development journey. Good luck!