파이썬

Django 1.4에서 1.7로 업그레이드 하기

Photo by Sigmund on Unsplash ‘Fast Web Service Build Up’이란 책을 보면서 Python과 django의 맛을 봤다. 다시 ‘파이썬 웹 프로그래밍‘ 이란 책을 보고 있는데, 이건 django 1.7 기준으로 설명이 되어 있다. 이전 책은 django 1.4 기준이었기 때문에 django 버전을 업그레이드해야 한다. 그런데 pip로는 업그레이드가 안 되고 있다. 버전을 찾을 수 없어 설치되지 않았다는 메시지만 나올 […]

개발 책 읽기

Do it! 안드로이드 앱 프로그래밍 (마시멜로, 안드로이드 스튜디오 반영판)(3판)

Do it! 안드로이드 앱 프로그래밍 – 정재곤 지음/이지스퍼블리싱 읽게 된 계기 몇 년 전에 지도에 깃발 표시하는 앱을 테스트 삼아 만들어 본 적이 있었다. 당시에는 이클립스에 안드로이드 개발 환경을 추가하는 방식이었는데, 이제는 구글이 IntelliJ 기반의 Android Studio를 제공한다고 한다. 스마트폰 앱을 만들지는 못하더라도, 어떤 방식으로 돌아가는지 정도는 알아야겠다는 생각을 했다. 검색을 해보니 가장 많이 팔린

기타 개발

jQuery ajax status code가 0인 경우 해결 방법

Ajax : status code = 0 노트북에서 Python과 Django를 이용하여 웹 개발을 하고 있다. Ajax를 이용하여 데이터를 출력하는데, status code가 ‘0’이 나오면서 에러가 발생한다. Ajax에는 Same Origin Policy라는 원칙이 있다. Ajax에는 Same Origin Policy라는 원칙이 있다. 말 그대로, 현재 브라우져에 보여지고 있는 HTML을 내려준 웹서버(Origin)에게만 Ajax 요청을 보낼 수 있다. (출처 : http://blog.iolo.kr/494) html 페이지에서는

파이썬

Django 로그를 파일에 기록하기

Django를 이용하여 프로젝트를 만들고 애플리케이션을 추가한 경우, 기본 설정에서는 로그가 파일에 기록되지 않는다. 로그를 파일에 기록하기 위해서는 setting.py에 있는 ‘LOGGING’ 영역에 로그 파일 설정을 추가해야 한다. # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOG_FILE = os.path.join(os.path.dirname(__file__), ‘..’, ‘site.log’) LOGGING = {     ‘version’: 1,     ‘disable_existing_loggers’: False,     ‘filters’: {         ‘require_debug_false’: {             ‘()’: ‘django.utils.log.RequireDebugFalse’         }     },     ‘handlers’: {         ‘mail_admins’: {             ‘level’: ‘ERROR’,             ‘filters’: [‘require_debug_false’],             ‘class’: ‘django.utils.log.AdminEmailHandler’         },         ‘logfile’: {             ‘class’: ‘logging.handlers.WatchedFileHandler’,             ‘filename’: LOG_FILE         },     },     ‘loggers’: {         ‘django.request’: {             ‘handlers’: [‘mail_admins’],             ‘level’: ‘ERROR’,

개발 책 읽기

Fast Web Service Build Up – 웹서비스를 쉽고 빠르게 구축하는 기술

읽게 된 계기 엑셀 문서로 대장을 만들어 열심히 관리하는 직원을 보았다. 관리 대상 별로 엑셀 문서를 하나씩 만들어서 관리한다. 그러다 보니 파일 개수가 많아지고, 이력관리도 쉽지 않으며, 찾는 데도 오래 걸리는 모양이다. 마침 시간이 나는 참에 관리 작업을 웹에서 할 수 있게 하여 주면 어떨까 하는 생각을 했다. 덕분에 말로만 듣던 Python + Django나 Ruby

파이썬

error: Unable to find vcvarsall.bat

error: Unable to find vcvarsall.bat Python, Django, MariaDB를 이용하여 간단한 웹 애플리케이션을 만들어 보려고 한다. 그런데 Mysql 연동을 위한 패키지를 설치하면 ‘vcvarsall.bat’ 파일이 없다는 에러가 발생한다. [root@C:helloworld]#pip install MySQL-python Collecting MySQL-python C:Python27libsite-packagespip-8.1.2-py2.7.eggpip_vendorrequestspackagesurllib3utilssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS cert ificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.   SNIMissingWarning C:Python27libsite-packagespip-8.1.2-py2.7.eggpip_vendorrequestspackagesurllib3utilssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.   InsecurePlatformWarning   Downloading MySQL-python-1.2.5.zip (108kB)     100% |################################| 112kB 1.1MB/s Installing collected packages: MySQL-python   Running setup.py install for MySQL-python … error     Complete output from command C:Python27python.exe -u -c “import setuptools, tokenize;__file__=’c:\users\ray\appdata\local\temp\pip-build-fvz0fq\MySQL-python\setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(__file__).read().replace(‘rn’, ‘n’), __file__, ‘exec’))” install –record c: usersrayappdatalocaltemppip-bz89ng-recordinstall-record.txt –single-version-externally-managed –compile:     running install     running build     running build_py     creating build     creating buildlib.win32-2.7     copying _mysql_exceptions.py -> buildlib.win32-2.7     creating buildlib.win32-2.7MySQLdb     copying MySQLdb__init__.py -> buildlib.win32-2.7MySQLdb     copying MySQLdbconverters.py -> buildlib.win32-2.7MySQLdb     copying MySQLdbconnections.py -> buildlib.win32-2.7MySQLdb     copying MySQLdbcursors.py -> buildlib.win32-2.7MySQLdb     copying MySQLdbrelease.py -> buildlib.win32-2.7MySQLdb     copying MySQLdbtimes.py -> buildlib.win32-2.7MySQLdb     creating buildlib.win32-2.7MySQLdbconstants     copying MySQLdbconstants__init__.py -> buildlib.win32-2.7MySQLdbconstants

파이썬

Python + Django : No module named MySQLdb

Django에서 MariaDB 연동 중 아래처럼 MySQLdb 모듈이 없다는 에러가 난다면, 모듈을 설치해야 한다. C:project1>manage.py syncdb Traceback (most recent call last):   File “C:project1manage.py”, line 10, in <module>     execute_from_command_line(sys.argv)   File “C:Python27libsite-packagesdjangocoremanagement__init__.py”, line 443, in execute_from_command_line     utility.execute()   File “C:Python27libsite-packagesdjangocoremanagement__init__.py”, line 382, in execute     self.fetch_command(subcommand).run_from_argv(self.argv)   File “C:Python27libsite-packagesdjangocoremanagement__init__.py”, line 261, in fetch_command     klass = load_command_class(app_name, subcommand)   File “C:Python27libsite-packagesdjangocoremanagement__init__.py”, line 69, in load_command_class     module = import_module(‘%s.management.commands.%s’ % (app_name, name))   File “C:Python27libsite-packagesdjangoutilsimportlib.py”, line 35, in import_module     __import__(name)   File “C:Python27libsite-packagesdjangocoremanagementcommandssyncdb.py”, line 8, in <module>     from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal   File “C:Python27libsite-packagesdjangocoremanagementsql.py”, line 6, in <module>     from django.db import models   File “C:Python27libsite-packagesdjangodb__init__.py”, line 40, in <module>     backend = load_backend(connection.settings_dict[‘ENGINE’])   File “C:Python27libsite-packagesdjangodb__init__.py”, line 34, in __getattr__     return getattr(connections[DEFAULT_DB_ALIAS], item)   File “C:Python27libsite-packagesdjangodbutils.py”, line 92, in __getitem__     backend = load_backend(db[‘ENGINE’])   File “C:Python27libsite-packagesdjangodbutils.py”, line 24, in load_backend     return import_module(‘.base’, backend_name)   File “C:Python27libsite-packagesdjangoutilsimportlib.py”, line 35, in import_module     __import__(name)   File “C:Python27libsite-packagesdjangodbbackendsmysqlbase.py”, line 16, in <module>     raise ImproperlyConfigured(“Error loading MySQLdb module: %s” % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb C:project1> Colored by Color Scripter cs OS가 윈도우인 경우에는 아래 명령어를

파이썬

Python, Django 설치 및 환경설정

Photo by Christin Hume on Unsplash Python을 설치하고, 환경변수를 설정한다. 그리고 Django를 설치하면 끝이다. Python 설치 python-2.7.5.msi를 설치한다. 환경변수 설정 PATH에 아래 경로를 추가한다. C:Python27;C:Python27Scripts; setuptools 설치 setuptools-1.1.zip 파일의 압축을 해제한다. 그리고 CMD 창에서 압축을 해제한 경로로 이동하여 아래 명령을 차례대로 실행한다. ez_setup.py easy_install pip Django 설치 CMD 창에서 아래 명령어를 실행한다. 버전 번호를 기술하지

기타 개발

Confluence Upgrade (5.10.0)

5.8.5 버전에서 5.10.0 버전으로 업그레이드를 진행했다. 언젠가부터 Google Docs를 주로 사용하고 있어서, 이번이 마지막 업그레이드가 되지 않을까 싶다.  Confluence 업그레이드 절차 Atlassian 에서 업그레이드할 버전의 파일을 내려받는다.  내려받은 파일에 실행권한을 부여한다.  내려받은 파일을 실행하면 대화식으로 업그레이드를 진행할 수 있다.  업그레이드 완료 후 Confluence는 자동으로 재시작된다.  주의사항  Confluence 업그레이드 버전은 기존 디렉토리에 설치된다.  Confluence 접속 포트는

위로 스크롤