How to install GeoPlot

install  공식  가이드는 다음의 링크에서 확인가능하며  여기서는 debian에서  conda 없이 install 하는 방법 중심으로 작성하였습니다.

# Use of a virtualenv is strongly encouraged.
$ mkdir my_project
$ cd my_project
$ virtualenv venv

$ source venv/bin/activate

# Easy installs that shouldn’t cause any problems.
(venv) $ pip install matplotlib seaborn

# … install proj4 and GEOS using brew, apt-get, etc. …
$ sudo apt-get install libgeos-dev
$ sudo apt-get install python2.7-dev libxml2-dev libxslt1-dev zlib1g-dev
$ pip install numpy

# Install shapely with the no-binary option.
# See
# MACOS지원하려 source code 에서 빌드해야 한다.
# pip install shapely –no-binary shapely
$ pip install shapely

# Install the rest.

$ pip install geopandas
# fiona/_transform.cpp:441:22: fatal error: cpl_conv.h: No such file or directory
$ sudo apt-get install libgdal-dev
$ export CPLUS_INCLUDE_PATH=/usr/include/gdal
$ export C_INCLUDE_PATH=/usr/include/gdal
$ pip install GDAL

# cartopy
# x86_64-linux-gnu-gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory
$ sudo apt-get install build-essential
$ pip install cartopy

# finally geoplot
$ pip install geoplot


# 이제  예제를  실행시켜보자
# No module named figures,
$ git clone
$ cd Shapely/docs/code
$ python


Happy Coding~:)

Posted in geo, python | Tagged , | Leave a comment

[Book]Python 201

Python 201

Posted in python | Leave a comment

custom form 생성하기

in order to apply attributes to a custom form you have to change form.custom.begin before.

The following code should work:
#view html
{{extend ‘layout.html’}}
# add class to form
form[‘_class’] = “form-horizontal”
# change form.custom.begin
form.custom.begin = XML(“<%s %s>” % (form.tag, form._xml()[0]))
your content form
Moreover, if do you want a form with bootstrap layout you could simply add formstyle=’bootstrap” to the form via auth.settings.formstyle argument avoiding to customize manually the html of the form.
 def login():
auth.settings.formstyle = ‘bootstrap’
form = auth.login()
return dict(form=form)
and in the view




In this group there are several discussions on this subject (i.e.

Search for messages containing the word ‘_xml’
We are replacing the original form.custom.begin value with a new one within which is the ‘_class’ attribute
From web2py code documentation in gluon/ (class DIV):
DIV class has a tag variable that is the tag name
FORM is a subclass of DIV and updates it
therefore, if form is an istance of FORM, form.tag will be = ‘form’
_xml() is a helper for xml generation. Returns separately in a tuple:
– the component attributes
– the generated xml of the inner components
Component attributes start with an underscore (‘_’) and
do not have a False or None value. The underscore is removed.
A value of True is replaced with the attribute name.
Therefore form._xml()[0] returns the component attributes like ‘_action’, ‘_class’
by using XML you can prevent escaping
XML(“<%s %s>” % (form.tag, form._xml()[0]))
‘<form action=””>’

Il giorno martedì 20 novembre 2012 23:37:17 UTC+1, Daniele ha scritto:

Posted in python, web2py | Leave a comment

PDF파일을 첨부파일로 다운로그 하기



    response.headers[‘Content-Disposition’] = ‘attachment; filename=abc.pdf’# to force download as attachment
# replace abc with whatever pdf name you want the user to see.
Posted in python, web2py | Leave a comment

Database에 파일 저장하는 방법


in model

        Field(‘attachment’, ‘upload’, uploadfield=’payload’),
        Field(‘filename’, length=512),
        Field(‘Description’, ‘text’),
        Field(‘payload’, ‘blob’),
in controller
att_id = db2.attachments.insert(
                    attachment =…),
                    payload =,
                    filename = fname,
                    Description = r.attachments.attachment_brief_description,
Posted in Uncategorized | Tagged , , , , | Leave a comment

User accessed site without logging in

User accessed site without logging in

로긴한적없는 유저가 다른유저로 로긴되어 있는 현상 발생

알고봤더니 uWSGI의 async버그로 발생한 문제,

uWSGI의 ipv6 address 처리 오류


client ipaddress의 validation추가


Posted in python, web2py | Leave a comment

web2py 2.0 rc – lazy table

Posted in Uncategorized | Leave a comment