Set cookie to "empty" value at logout:
expires = datetime.datetime.utcnow()
self.response.set_cookie(key="uid", value="empty", expires=expires)
Check for "empty" in checkcookie:
def is_local(): | |
if os.environ.get('SERVER_NAME', '').startswith('localhost'): | |
return True | |
elif 'development' in os.environ.get('SERVER_SOFTWARE', '').lower(): | |
return True | |
else: | |
return False |
# -*- coding: utf-8 -*- | |
import pickle | |
class SomeModel(): | |
pass | |
a = SomeModel() | |
a.name = "Matej" |
# -*- coding: utf-8 -*- | |
from urllib2 import urlopen | |
from BeautifulSoup import BeautifulSoup | |
url = "https://en.wikipedia.org/wiki/Game_of_Thrones" | |
response = urlopen(url).read() | |
soup = BeautifulSoup(response) |
# -*- coding: utf-8 -*- | |
import random | |
from urllib2 import urlopen | |
url = "http://bos.zrc-sazu.si/sbsj.html" | |
response = urlopen(url) | |
def get_random_number(): | |
return random.randint(20, 354000) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="keywords" content="avto, renault, audi"> | |
<meta name="author" content="Matej Ramuta"> | |
<meta name="description" content="Moja stran o avtih"> | |
<title>moja super spletna stran</title> | |
<meta charset="UTF-8"> | |
</head> | |
from google.appengine.api import users | |
from webapp2 import redirect_to, redirect | |
def admin_required(handler): | |
def _check_login(self, *args, **kwargs): | |
user = users.get_current_user() | |
if user: | |
if not users.is_current_user_admin(): | |
return redirect_to("forbidden") | |
else: |
package com.example.nino.financeappv20; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import android.widget.TextView; | |
import com.example.nino.financeappv20.model.FinanceData; |
Narobe: | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
Pravilno: | |
<head> |
[{"id":1,"first_name":"Nicholas","last_name":"Weaver","email":"[email protected]","country":"Russia","SSN":"283-85-6882"}, | |
{"id":2,"first_name":"Gary","last_name":"Bowman","email":"[email protected]","country":"Argentina","SSN":"720-12-3501"}, | |
{"id":3,"first_name":"Carol","last_name":"Sanders","email":"[email protected]","country":"Indonesia","SSN":"217-56-6996"}, | |
{"id":4,"first_name":"Lois","last_name":"Brooks","email":"[email protected]","country":"Serbia","SSN":"381-92-1870"}, | |
{"id":5,"first_name":"Kenneth","last_name":"Ellis","email":"[email protected]","country":"China","SSN":"452-63-1019"}, | |
{"id":6,"first_name":"Jason","last_name":"Long","email":"[email protected]","country":"Russia","SSN":"472-51-3627"}, | |
{"id":7,"first_name":"Arthur","last_name":"Johnson","email":"[email protected]","country":"Zimbabwe","SSN":"104-46-5565"}, | |
{"id":8,"first_name":"James","last_name":"Owens","email":"[email protected]","country":"China","SSN":"469-62-2575"}, | |
{"id":9,"first_name":"Julia","last_name" |