Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ctcusc/django-react-boilerplate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ctcusc/django-react-boilerplate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: backend-onboarding
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 20, 2017

  1. Fresh start

    vmagro committed Sep 20, 2017
    Configuration menu
    Copy the full SHA
    7d5b773 View commit details
    Browse the repository at this point in the history
  2. Create models for Profiles, Posts and Votes

    To build our social network application, we need to store data. We
    store data in a database using Django Models. These models are defined
    in models.py
    Here we create 3 models:
    Profile - stores data about a User such as their username and picture
    Post - an individual post on our social network. Posts are simply a
    string of text associated with a Profile
    Vote - an upvote on a Post: any Profile can add a Vote associated with
    any Post
    vmagro committed Sep 20, 2017
    Configuration menu
    Copy the full SHA
    3a8eed8 View commit details
    Browse the repository at this point in the history
  3. Add models to admin site

    We want to add our new models to the Django admin site so that we can
    start to create, edit, and delete models before we finish implementing
    the rest of the our API.
    Once you add these lines, go to the admin interface and see that they
    were added! http://localhost:8000/admin
    vmagro committed Sep 20, 2017
    Configuration menu
    Copy the full SHA
    b430783 View commit details
    Browse the repository at this point in the history
  4. Create PostSerializer

    Create a Django REST Framework Serializer class for Post objects.
    This allows us to create/read/update/list/delete Posts in our database.
    
    At this point we don't have a simple way to actually run this code, but
    in the next task we'll add API endpoints to actually use our
    PostSerializer class
    vmagro committed Sep 20, 2017
    Configuration menu
    Copy the full SHA
    6f2159b View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2017

  1. Create views for posts

    In the last task, we added a serializer to convert Posts to and from
    our API representations.
    
    After adding the code in this task, use your favorite REST interface
    (such as
    Postman) to try some requests on http://localhost:8000/api/posts - at
    this point we've implemented support for listing all posts (GET to
    /api/posts), creating a post (POST to /api/posts), getting an
    individual post by ID (GET to /api/posts/<id>), updating a post (PUT to
    /api/posts/<id>) and deleting a post (DELETE to /api/posts/<id>)
    
    As you might have noticed, that's a lot of code to do not a whole lot.
    Fortunately Django REST Framework provides a lot of conveniences for us
    that we'll explore in later tasks.
    vmagro committed Sep 21, 2017
    Configuration menu
    Copy the full SHA
    aabffa9 View commit details
    Browse the repository at this point in the history
Loading