Jonatas Baldin
Written By
Jonatas Baldin
Developer @ Cheesecake Labs

Software developer @ Cheesecake Labs. Speaker, contributor and conferences organizer. Loves open source communities.

Getting Started

What are you going to build?

In this tutorial, you are going to create a Hackernews clone using Django and Graphene. The platform will have the following features:

  • List of Users and Links
  • Users creation and authentication
  • Users can create Links and vote on them

Creating your local environment

Before starting, make sure you have Python 3.6 installed. If not, you can download it here. The installation is pretty straightforward on any supported operating system.

When working with Python, you will use Virtual Environment: a tool for keeping all the project’s dependencies isolated from your system – or other projects.

You’ll notice your prompt changed to (venv) .... It means you are inside your virtual environment, every Python package will be installed there. If you want to leave it, just type deactivate. Make sure to always have the virtual environment activated.

Installing Django and Graphene

The tool used to manage Python packages is pip, which should be available with your Python installation.

Don’t worry about the hackernews/hackenews structure, this is just the way Django works!

The commands above will install the necessary libraries, create a new Django project, create the base Django tables and start its builtin web server. To test it, open your browser and access the http://localhost:8000 address. You should see the following page:

Configuring Graphene Django

Unlock the next chapter
What is the Python Virtual Environment?
A Python obligatory library
A Python library for creating isolated projects
Base Python application for running GraphQL
Python app for Django