Want help? Show your code! Show the errors!

Every day I'm surprised how many people ask questions on r/django about their code but don't show any code or, if they're stuck with an error, don't show any of the actual error message. This makes it hard to help and so reduces the chance a problem will be solved.

Some tips:

* Show your code. You might think your paragraph of explanation is clear, but that's because you already know your code. It's *very* unlikely anyone can help with a coding problem if you don't show what you currently have.
* Reduce your code to what's relevant. Remove anything that's unrelated to your question or that doesn't affect the error you're stuck with. Doing this might even help you find the problem yourself.
* If you've got an error, copy and paste the exact error message and at least the last few lines from any traceback in your logs.
* Don't post images of your code or error messages - copy and paste the actual text.
* Format your code. I know Reddit can makes this difficult, but if you can't take the time to make your code readable why should anyone else take time to help you?
* If something on your site isn't behaving how you expect, describe:
* The action(s) you, or the user, takes.
* What you expect to happen.
* What actually happens.
* Describe what you've already tried to solve your problem. This (a) helps people to offer useful solutions you haven't tried and (b) shows that you've put some effort into this and are really stuck. Sometimes it seems like a poster hasn't even googled their error message or problem before asking here.

**Help people to help you by taking some time to write the most useful question you can.**

What other tips can you suggest for asking better questions?

I know this post will soon disappear and it won't make much difference, but it's worth a try.

6 thoughts on “Want help? Show your code! Show the errors!”

  1. I remember one error that got me wrecked, I use tailwindcss to create a Login and in the moment I need to redirect after a successfull login but, nothing works like: redirect, render, or redirect from the frontend like urls nothing work. Im still Clueless why that happen.

    Reply
  2. On the other hand…

    I like to sometimes explain the problem in abstract way so that I actually learn from the answer, I don’t want to run migrations to avoid that error, I wanna understand why the migration process is important etc…

    Reply
  3. So right now I’m creating a very simple login page straight from the documentations.

    Whenever I create a new user from the backend and have everything copied and pasted it just flashed the error message ‘user not found” when I clearly have it in the database and copy pasted everything.

    Along with
    Whenever I refresh a page with a flash error message it does not disappear like I thought it would. I’ve been confused to what is happening. Is it a bug, did I typed it wrong?

    I need help I’m at a standstill in my learning

    Reply

Leave a Comment