   end
 
   def show(conn, %{"id" => id} = params ) do
-    appid = "#{Application.get_env(:flour, :wechat_appid)}"
-    secret = "#{Application.get_env(:flour, :wechat_secret)}"
-    userinfo_base = "#{Application.get_env(:flour, :wechat_userinfo_url)}"
-    
-    if !!params["code"] and !!params["state"] do 
-      access_url = "#{Application.get_env(:flour, :wechat_access_token_url)}?appid=#{appid}&secret=#{secret}&code=#{params[:code]}&grant_type=authorization_code"
-    end
-    IO.puts access_url
     
     #{:ok,client} = Exredis.start_link
     #foo = (client |> Exredis.query ["GET","FOO"] )

    |> put_flash(:info, "Post deleted successfully.")
    |> redirect(to: post_path(conn, :index))
  end
end

    #client |> Exredis.stop
     
     
    post = Repo.get!(Post, id) |> Repo.preload(:photos) |> Repo.preload :user
    render(conn, "show.html", post: post, layout: {Flour.LayoutView, "app.html"})
  end
