This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""":mod:`hstore` --- Using PostgreSQL hstore with SQLAlchemy | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
.. note:: | |
I released it under Public Domain. Feel free to use! | |
It provides :class:`Hstore` type which makes you to store Python | |
dictionaries into hstore columns in PostgreSQL. For example:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
if os.environ.has_key("PRODUCTION"): | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | |
'NAME': '', # Or path to database file if using sqlite3. | |
'USER': '', # Not used with sqlite3. | |
'PASSWORD': '', # Not used with sqlite3. | |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
if os.environ.has_key("PRODUCTION"): | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "temporary.prod_settings") | |
else: | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "temporary.devel_settings") | |
from django.core.management import execute_from_command_line | |
execute_from_command_line(sys.argv) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post(models.Model): | |
contents = models.TextField() | |
create_time = models.DateTimeField(auto_now_add=True) | |
writer = models.ForeignKey(User) | |
author = models.CharField(max_length=100, null=True) | |
has_attachments = models.BooleanField(default=False) | |
comments_count = models.IntegerField(default=0) | |
like_count = models.IntegerField(default=0) | |
like_string = models.CharField(max_length=100, default='') | |
is_deleted = models.BooleanField(default=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -mwand.version --verbose | |
Wand 0.3.0 | |
ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org | |
dj@djbhome:~/wand/wand$ python setup.py build | |
running build | |
running build_py | |
creating build | |
creating build/lib.linux-x86_64-2.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python Korea Facebook Group 에서 offline 미팅을 하고자합니다. | |
대략적으로 다음과 같은 순서로 하고자합니다. | |
* 자기소개 | |
* Hyun-woo Park 님의 """SmartStudy 에서 장고 활용예""" | |
* Yeaji Shin 님의 """여성은 이렇게 코딩한다""" | |
* Hong Minhee 님의 """이거 쓰세요""" | |
* OST ( 그룹별로 모여서 농담 ) |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#77 | |
for c in 5,5,4,3,2,0,2,3,4,5,5:s=(c*' 'or'*')+'* '[:6-c];print s+s[-2::-1] |
Why Should I Care (For Developers)
"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.
OlderNewer