Momentum logo
Team 2 Classroom

Django Duplex Project

Choose a Project

This week, you will be in a team of two or three people working on a project. You should use GitHub issues to keep track of what needs to be done and who is working on what. Your team should use feature branches for development.

Use your combined creativity and common sense to make decisions as you work. Users expect to see some common features in web applications. If they are not mentioned in the project’s description, you should still do them. For example: in the code snippet application, users should have avatar images. You don’t have to handle file uploads yourself – you could use Gravatar with django-gravatar – but you need some way of handling that.

In addition to those small features, come up with your own features to make your project unique. You will likely use this project in your portfolio, so make it stand out!

Rules for all projects

Stretch goal for each project: trying new things

Teams should consider trying something they don’t know how to do on their project. This could be a Python or JavaScript library they haven’t used before or a feature of Django they haven’t tried.

The Projects

Project 1: Code Snippet Manager

You need a good way to manage snippets of code you reuse often. You are going to build a web application that has these goals:

How snippets work

A snippet has code (required), a language (required), a title (optional), and whatever other fields make sense. Some ideas to consider: a description or a list of tags.

If you copy a snippet by clicking the copy button (or whatever UI element is used for this purpose), there’s a link back to the original snippet. The easiest way to do this is with a foreign key. One should be able to see how many times a snippet has been copied.

The reason why we copy snippets instead of “favorite” them is that they can change. The original snippet creator can edit their snippet; the copying user can edit their copy.

How search works

Search should look for terms in the title, in other fields like a description or tags, and in the language field. If I search for “javascript auth,” I should see any snippets I have about authentication using JavaScript. See search and full text search in the Django documentation for some ideas.

How much of this is JavaScript?

This can vary, but the two parts that definitely need JavaScript are syntax highlighting and copying a code snippet to your clipboard.

For syntax highlighting, check out Prism.js or Highlight.js.

See this article on native browser copy to clipboard for ideas on how to copy to clipboard.

Project 2: Habit Tracker

For this project, you will build a Django application that you can use to help track and reinforce daily habits.

Some stretch goals for this project

How much of this is JavaScript?

You can make your forms a lot more usable by adding JavaScript – to begin with, you can have a button for making a record that then shows a form without reloading the page.

If you want to add charts to your habits, you’ll definitely need JavaScript. Check out Charts.js.