What should we do with all the secret stuff that we have in our code?
Meaning, Django’s SECRET_KEY setting, various user and password credentials (EMAIL, DATABASE, …), API KEYs to 3rd party REST API, so on…
Django’s testing doc is here.
Django provides out-of-the-box many tools to do automated testing. You can build unit-tests, run them with “python manage.py tests” (even though I would ask why don’t you use an IDE like PyCharm) and Django will do…
This is not an in-depth article on how to send emails but rather a starting point. But if you are building a website in Django and you need such website to start sending, let’s say, marketing emails today, this article is for you.
I am trying different blog and CMS solutions that are Django native. The first one that I came into was django-cms. The following is NOT a review. I only played with it a little, this is more like a ‘done the tutorial’ and ‘ first impressions’ type of post.
Django doc here.
Sometimes you want to do something in your webapp as a response to an event that occurred elsewhere.
For instance. You might want that each time a model is saved to execute an action or update a different model.
If you are developing REST APIs you need a client to test them.
If you are on Linux you use curl.
If you are on Windows, you can look for a Chrome or Firefox plugin (I used poster a while ago) but I recommend you to use httpie
So. Let’s say that you have:
# app/models.pyfrom django.db import modelsfrom datetime import datetime
class Book(models.Model): name = models.CharField(max_length=128)…
I read this first in Two Scoops of Django a while back.
When we start working with Django we learn fast that we’ll need to use some settings values to run the app in development mode, and some other setting values for when we deploy the app…
Django’s official doc here
Let’s start by saying that Django’s admin site is spectacular. It can literally save you months of work, but having said that, one thing that one needs to understand is that Django’s admin site is only ok as an…
Django-Rest-Framework doc here.
Let’s say that you want to create a REST API and you want to use rest_framework, here is what you need to know to start using it right away (BTW you can also read their official tutorial, here).