S
S
Solliter2017-08-17 13:22:59
Django
Solliter, 2017-08-17 13:22:59

Criticize the code, what can be improved?

Good afternoon!
I am a beginner, not long ago I started looking for a junior job and for a better job search on the git hub I wrote a small blog https://github.com/solliter/blog-with-accounts , please criticize, and I will also be glad for any comments and suggestions, the main thing constructive, thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2017-08-17
@Solliter

  1. don't use db_table if you don't understand what it's for
  2. Duplicate class name in attributes is terrible
  3. Read the Django style guides and see where to put class Meta and __str__
  4. The code is dirty. Unnecessary comments, snake_case mixed with camelCase, PEP8 non-compliance
  5. algorithmic errors. For example, the subscribe view, if the method is not POST, leads nowhere
  6. In the same view there is a redirect to the URL. Use reverse, in templates you use {% url %}. By the way, the redirect shortcut that you use can redirect to the name of the view (name in urls) and to a specific object if it has the get_absolute_url method defined
  7. It was indicated here that it is worth using Class Based Views. For a beginner, this is too non-obvious things with these mixins of yours. Better understand Function Based Views first

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question