How to Contribute to Django Docs
DjangoProject.com is the official website and documentation for Django. Its source code is available on GitHub. I recently ran an automated spelling, grammar, and link checker to see if there were any issues on the website as it is quite large at this point. And… there were a few.
So how to fix them and make a contribution to Django?
The first step is to fork the repo on GitHub.
Now that I have a forked copy under my own GitHub account I can work on it locally.
I generally prefer to use
git clone for this. So I navigate on the command line to my local
opensource directory and then ran the following command which installs it on my machine and
cd into’d the new
djangoproject.com directory that was created.
$ git clone https://github.com/wsvincent/djangoproject.com.git $ cd djangoproject.com
As seen in the ReadMe file there are several ways to run the website locally. By far the easiest, in my opinion, is to use Docker. The instructions are available on the bottom. Make sure Docker is installed on your desktop and already running, then execute the following commands:
$ docker-compose build $ docker-compose up
These steps take quite a while to run, even on a fast laptop so be patient. But once it’s done you can navigate to http://localhost:8000/ and see the website running locally.
Database vs Templates
Open the codebase in your text editor of choice. For a given typo, it is either in HTML and able to be found with a full site search or, more likely, it is in the production database. Access to this is understandably quite limited so if you spot an issue for content, please submit an Issue and one of the friendly Django Fellows will implement the fix. Congratulations: you just contributed to Django!
As a Django Software Foundation Board Member, I happen to have access to the database so most of the changes can be made directly. I do this through the admin page, just like any other Django site.
This is what the site admin page looks like. As you can see there is the Blog at the top, flat pages used for community and Django Software Foundation minutes, Fundraising, and then a Members section.
Contributing to Django can take many forms: technical, community, documentation, mentoring, teaching, and more. Each act is a necessary part of what it takes to maintain a healthy open source framework. I hope this post has demystified the steps for making updates to the official DjangoProject.com website.