Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

Build a blog with Django

$
0
0

The best way to learn a new web framework is by using it to build something. If you can't think of any cool ideas then the tried and true approach of implementing your own blog is a fantastic option for beginners.

A blog is a great first project since it's non-trivial to build, it's not too complicated to understand and it forces you to use many different parts of your chosen framework.

In the lastpost I showed you how I usually setup my Django project. I assumed we were building a blog but we didn't really get into any feature development. However, in this and future posts I'll teach you how to build a blog with Django .

Are you ready?

Disclaimer

It's important to note that in this series we're NOT building a blog to boost our career or to make money . We're building it because we want to learn how to use Django to build real stuff. However, building a blog for the other reasons is valid and it's one of the reasons I created this blog :).

Also, I'm assuming we DO need a database backed blog. Otherwise, depending on your requirements, there may be more advantages to building a static blog .

Let's get started

Our blog wouldn't be anything new or innovative and it'll be for our own use so we don't need to spend too much time doing customer development . Just ask yourself what you need, jot it down and get on with it.

Here are my rough notes based on my experience using various blog platforms like WordPress and Ghost .

I'd like to have: - Posts with a title, excerpt, body and an optional featured image - The body can be written in Markdown - The body can contain syntax highlighted source code - The body can contain images - Posts can be in draft or published states - Draft posts can be previewed - Posts can be organized with tags - Posts can be scheduled to be published in the future - Support for moderated comments - Support for Google Analytics - And, great SEO support

I think that's a good starting point since it'll meet most blogging needs. If more is desired then you can always add it in future iterations .

The process

We'd work iteratively and follow the Kanban system using Trello .

Here's what I did.

I created a Trello board called yaba and added 4 lists to begin. The lists, in order, are titled Backlog , Next Up , In Progress and Done .

Create your own board and follow my process if you like. You can add, remove or rename lists to suit your needs. Please feel free to experiment with your own ideas.

I then broke the feature list into smaller actionable tasks and added them to the Backlog . The Backlog represents an unsorted list of all tasks that need to be done.

Out of the Backlog I tried to determine the next couple of tasks to focus on and I put them onto the Next Up list. The Next Up list is a sorted list of tasks from highest to lowest priority.

When you begin working on a card you put it in the In Progress list and work, work, work on it.

When done you put it in the Done list.

So essentially, cards flow from left to right until you've completed the task. They start off in the Backlog and end in the Done list.

Here's the board.


Build a blog with Django
Conclusion

This was a short post but I hope it was valuable to you.

We were able to determine exactly how we want to build the blog and we came up with a plan to execute on it.

In addition, by choosing to follow an iterative development process we set ourselves up to embrace the inevitable changes that will occur.

By keeping the tasks small, clear and actionable and following the Kanban system we would be able to see progress on a daily basis. Which is great because the small daily wins will build the momentum we need to help keep us on track to successfully complete the project.

Are you ready to build it?

In the next post we'd begin writing code. See you then :).

P.S. Many open source projects follow a similar process. The Ghost roadmap provides a great example. How do you start and/or manage your projects? I'd love to know. Please tell me in the comments below.


Viewing all articles
Browse latest Browse all 9596

Trending Articles