stevenpi / Link.Python.Django.DiyBlog

This blog is based on the assessment found [here](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/django_assessment_blog).
MIT License
0 stars 0 forks source link

Improve filling of test data #19

Closed mbaechtold closed 6 years ago

mbaechtold commented 6 years ago

There should be no comment code in your code base.

1) Load the url patterns only, if DEBUG=True:

if settings.DEBUG:
    urlpatterns += [
       ...
    ]

2) Improve the view insert_to_db:

Check if it the authenticated user is a super user. Insert the data only if this is the case.

mbaechtold commented 6 years ago

This has been solved in the pull request #21 👍