GithubHelp home page GithubHelp logo

photolog's Introduction

포토로그 : 플라스크 웹 애플리케이션

포토로그(photolog)

포토로그는 사진파일을 업로드하여 사진과 함께 사진에 대한 메모와 태그 위치정보들을 함께 저장하고 리스트 형태로 혹은 지도위에 보여주는 웹 어플리케이션입니다.

포토로그는 Flask 로 만들어 졌으며 SQLAlchemy, SQLite3, PIL등을 필요로 합니다.

설치

관련된 라이브러리 설치

pip install -r requirements.txt

데이터베이스 초기화

최초 실행시에 SQLite3 DB파일을 /photolog/resource/database/photolog 이름으로 자동 생성됨

애플리케이션 실행

python runserver.py

사용방법

1) http://localhost:5000 에 접속
2) 사용자 계정을 생성
3) 사진파일 업로드
4) 지도에서 보기, 트윗보내기등의 기능을 사용가능

라이선스

MIT license.

photolog's People

Contributors

keatonh avatar liks79 avatar

Stargazers

Jaisung Lee avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

photolog's Issues

사용자 등록 오류 관련..

사용자 등록 오류 관련..

신규 사용자 등록을 위해 register 버튼을 누를 경우에 오류 발생하여 디버그 기록을 남깁니다.

jinja2.exceptions.UndefinedError

jinja2.exceptions.UndefinedError

UndefinedError: 'photolog.cache_session.CacheSession object' has no attribute 'user_info'



    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1701, in __call__

    return self.wsgi_app(environ, start_response)

    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1689, in wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app

    response = self.full_dispatch_request()

    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1358, in full_dispatch_request

    rv = self.dispatch_request()

    File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1344, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/home/liks/project/photolog/photolog/controller/register_user.py", line 80, in register_user

    return render_template('register.html')

    File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 125, in render_template

    context, ctx.app)

    File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 107, in _render

    rv = template.render(context)

    File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render

    return self.environment.handle_exception(exc_info, True)

    File "/home/liks/project/photolog/photolog/templates/register.html", line 25, in top-level template code

    <form class="form-horizontal" action="{{ url_for('photolog.register_user', user=session.user_info.username) }}" method="post">

    File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 372, in getattr

     [Display the sourcecode for this frame]  [Open an interactive python shell in this frame] return getattr(obj, attribute)

    UndefinedError: 'photolog.cache_session.CacheSession object' has no attribute 'user_info'


아이폰에서 사진을 업로드 할경우 EXIF 데이터가 사라짐

아이폰에서 사진을 업로드 할경우 EXIF 데이터가 사라짐

  • 원본 사진의 EXIF 데이터가 iPhone 에서 업로드 할 경우 업로드된 서버에서 EXIF 데이터가 없어지는 현상
  • 갤럭시 시리즈에서도 비슷한 증상이 있는 것 같음
  • PC에서는 전혀 발생하지 않음

모듈 파일 주석

모듈 파일 생성시, 아래 형태로 통일해서 모듈 파일 헤더에 달아야함.
현재 버전의 PyDev에서 주석 템플릿을 제공하지 않음

-- coding: utf-8 --

"""
photolog.controller.login
~~~~~~~~~~~~~~~~~~~~~~~~~

로그인 확인 데코레이터와 로그인 처리 모듈.

:copyright: (c) 2013 by 4mba.
:license: MIT LICENSE 2.0, see license for more details.

"""

DB_URL 하드 코딩 변경 필요

DB_URL 하드 코딩 변경 필요

관련 파일 위치

  • /photolog/photolog/resource/config.cfg
  • 12번째 라인 : DB_URL= 'sqlite:////Users/keatonh/project/database/photolog'

해결 방법

아래의 코드를 응용하여 수정하면 좋을것 같습니다. 실행될때 DB_URL이 동적으로 결정될 수 있도록 조정되면 좋겠습니다.

  • _basedir = os.path.abspath(os.path.dirname(file))

구동시 오류 메시지

[2s]~/project/photolog(master|✔ ) % pt runserver.py
starting test server...
photolog blueprint name : photolog
photolog blueprint template folder : ../templates
photolog blueprint static folder : /home/liks/project/photolog/photolog/../static
database module invoked!
controller.init.py invoked!
model.init.py invoked!
creating photolog...
DB_URL : sqlite:////Users/keatonh/project/database/photolog
Traceback (most recent call last):
File "runserver.py", line 19, in
app = create_app()
File "/home/liks/project/photolog/photolog/init.py", line 39, in create_app
DBManager.init_db()
File "/home/liks/project/photolog/photolog/database.py", line 30, in init_db
Base.metadata.create_all(bind=DBManager.engine)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 2571, in create_all
tables=tables)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2298, in _run_visitor
conn = self.contextual_connect(close_with_result=False)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2489, in contextual_connect
self.pool.connect(),
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 236, in connect
return _ConnectionFairy(self).checkout()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 401, in init
rec = self._connection_record = pool._do_get()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 822, in _do_get
return self._create_connection()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 189, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 282, in init
self.connection = self.__connect()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 344, in __connect
connection = self.__pool._creator()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect
return dialect.connect(_cargs, *_cparams)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 281, in connect
return self.dbapi.connect(_cargs, *_cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None

Flask 0.10.1 버전 릴리즈..

Flask 0.10.1 버전 릴리즈..

어제 인가 릴리즈 된거 같은데 혹시 변경 사항이 필요한지 각자 확인 한번 해보세요 ^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.