This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I run the other services I need (database, redis, etc.) using Docker | |
# and I orchestrate them with this docker-compose.yml file. | |
version: '2' | |
services: | |
data: | |
image: busybox | |
volumes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./manage.py shell | |
Python 2.7.5 (default, Aug 25 2013, 00:04:04) | |
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from followers.models import * | |
>>> john = User.objects.create_user('john', '[email protected]', 'password') | |
>>> paul = User.objects.create_user('paul', '[email protected]', 'password') | |
>>> george = User.objects.create_user('george', '[email protected]', 'password') | |
>>> ringo = User.objects.create_user('ringo', '[email protected]', 'password') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import serializers | |
from myapp import models | |
class ProfileSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = models.Profile | |
class UserSerializer(serializers.ModelSerializer): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
def hello(request): | |
return HttpResponse("Hello world!") |