author Magesh

Django Beginners: How to ask for help?

Magesh Ravi on March 4, 2023

If you are a beginner Django developer, you may face various issues and obstacles. You may seek assistance from online resources, peers or other developers to overcome them. However, the way you seek help says a lot about you. It reflects whether you have done your research or merely copy-pasted your error message. To avoid being perceived as a lazy developer, you can provide full context while seeking help. Here are some tips on how to ask for help professionally.

How not to ask for help

Most beginners post screenshots of their error pages to ask for help.

Example,screenshot

A few others take a photo of their screen and post it, as shown below,photo

The worst part is the title/description of the post. Mostly – "I am facing this error. Please help." It does not provide context – what the person is trying to achieve or how they have implemented it, forcing people who want to help figure it all out.

A better way to ask for help

When asking for help, ensure you provide this info,

  1. What are you trying to achieve?
  2. What is your current implementation?
  3. What is the error/problem you are facing?
  4. Code snippets

For example,

I want to create a new page that displays a form.

I have a view, a template and a URL config in place.

I'm facing an AttributeError when trying to access the page.
[Error message]

Here's my code.
[snippets]

Traceback

Instead of screenshots/photographs, use the copy-and-paste view to obtain the full traceback as text.

Locate the "Switch to copy-and-paste view" link on your error page.switch-to-copy-paste-view

Upon clicking the link, you should see the section change as shown in the image below. You can copy the entire stack trace and use it in your post. However, Django has implemented an even better solution. Find the "Share this traceback on a public website" button below the traceback section.share-traceback

Clicking the button will post the entire traceback to dpaste.com and create a unique link. You can include this link in your post instead.

I want to create a new page that displays a form.

I have a view, a template and a URL config in place.

I'm facing an AttributeError when trying to access the page.
See the traceback at [dpaste.com link].

Here's my code.
[snippets]

Code snippets

In addition to the stack trace, any developer would want to look at the code you've written to help you solve your problem. So presenting your code saves time for everyone. I have seen people pasting screenshots of code. Please don't do that. There is a better way.

Place relevant parts of your code in markdown format (within code fences) and post it on a public site like https://rentry.co.markdown-rentry

You can preview it before publishing.preview markdown

Note: Markdown is essential for every developer, so take a few minutes to learn it. It's easy.

Save the edit code somewhere safe. You'll need it if you want to edit the markdown doc later. Use the generated link in your post like,

I want to create a new page that displays a form.

I have a view, a template and a URL config in place.

I'm facing an AttributeError when trying to access the page.
See the traceback at [dpaste.com link].

Here's my code – [rentry.co link]

If you still wish to use an image to attract users to your post, use screenshots of dpaste.com and rentry.co pages and stitch them together.stitched-image

This article summarises what we discussed in the Django Developers Guild monthly meeting on 26 Feb 2023. If you liked this post, share it with someone who might find it helpful.

Have a comment to share or a question to raise? Join our Discord server.