Sending Data with the Requests
Aug 18 2016- POSTED BY projecth
Sending Data with a GET Request In a GET request, additional data related to your requested resource is passed as […]
Read MoreSending Data with a GET Request In a GET request, additional data related to your requested resource is passed as […]
Read More200 level codes are success messages, particularly 200 code which is the message OK. 301 Page moved. 404 is Not […]
Read MoreRequest-Line The first line GET /xml HTTP/1.1 is called the request line. GET | POST GET is used when you […]
Read MoreHTTP Hyper Text Transfer Protocol: A set of rules that govern how 2 devices should communicate with each other over […]
Read More{% extends “stream.html” %} {% block content %} <div class=”row”> <div class=”grid-25″> <h1>{{ user.username }}</h1> </div> […]
Read More{% extends “layout.html” %} {% block content %} {% for post in stream %} <article> <h2> <a […]
Read More{% macro render_field(field) %} <div class=”field”> {% if field.errors %} {% for error in field.errors %} […]
Read More{% extends “layout.html” %} {% from ‘macros.html’ import render_field %} {% block content %} <form method=”POST” action=”” class=”form”> {{ […]
Read More{% extends “layout.html” %} {% from ‘macros.html’ import render_field %} {% block content %} <form method=”POST” action=”” class=”form”> {{ […]
Read More<!DOCTYPE html> <html class=”no-js”> <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″> <title>{% block title %}TwoCans{% endblock %}</title> […]
Read MoreWe can control 404 errors and bad requests using the abort() function provided by flask. What it does is that […]
Read More[models.py] class User(UserMixin, Model): …. def get_stream(self): return Post.select().where( (Post.user << self.following()) | (Post.user == self) ) def following(self): …. […]
Read More[user_stream.html] … <div class=”grid-25″> <h5>Followers</h5> <p>{{ user.followers().count() }}</p> </div> <div class=”grid-25″> <h5>Following</h5> <p>{{ user.following().count() }}</p> </div> … <div class=”grid-25″> {% […]
Read MoreRelationship Model [models.py] … class User(UserMixin, Model): … def following(self): “””Users that current user follows.””” return User.select().join( Relationship, on=Relationship.to_user ).where( […]
Read More