Giter Club home page Giter Club logo

code's People

Contributors

davideuler avatar dongweiming avatar hanxi avatar iceleaf916 avatar kitelife avatar liluo avatar mozillazg avatar prayagverma avatar ryaninhust avatar tclh123 avatar xtao avatar yjcxy12 avatar yupbank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code's Issues

code on vagrant CentOS-6.4

准备环境vagrant CentOS-6.4-i386-v20130731.box

安装mysql git

yum install update
yum install -y mysql mysql-server mysql-devel git python-devel memcached

安装python2.7

wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2 --no-check-certificate
tar xvf Python-2.7.5.tar.bz2
cd Python-2.7.5
./configure --prefix=/usr/local
make && make altinstall

easy_install包

wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz --no-check-certificate
tar xf distribute-0.6.49.tar.gz
cd distribute-0.6.49
python2.7 setup.py install

必须“python2.7”,否则将安装到默认的2.6环境内。

easy_install virtualenv
easy_install pip

安装memcached libmemcached

pip install mime python-magic
wget https://github.com/xtao/douban-patched/raw/master/libmemcached-douban-1.0.18.tar.gz --no-check-certificate
tar zxf libmemcached-douban-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure && make && sudo make install
ln -s /usr/local/lib/libmemcached.so.11 /usr/lib/libmemcached.so.11

部署code

git clone https://github.com/douban/code.git
cd code
mysql -uroot -e 'create database valentine;'
mysql -uroot -D valentine < vilya/databases/schema.sql
virtualenv venv --python=python2.7
cd venv
source ./bin/activate venv

pip install cython
pip install -U setuptools
easy_install distribute==0.6.28

yum install bzip2-devel
cp /usr/lib/python2.6/lib-dynload/bz2.so /usr/local/lib/python2.7/.

pip install -e "git+https://github.com/qingfeng/misaka.git@2fbe52692e8f304eea9d8925fd2a857916ff0ea5#egg=misaka-1.0.3"

pip install -r requirements.txt

定制 config运行

cp vilya/local_config.py.tmpl vilya/local_config.py

gunicorn -w 2 -b 127.0.0.1:8000 app:app

DOMAIN 是指的是程序运行的域名,包含IP地址和端口,例如: http://127.0.0.1:8000/

when you create a repository,the repostitory url without ":"

Create a new repository on the command line

    touch README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin http://10.7.10.238max/testcode.git
    git push -u origin master

Push an existing repository from the command line

    git remote add origin http://10.7.10.238max/testcode.git
    git push -u origin master

the ture repostitory url is
git remote add origin http://10.7.10.238:max/testcode.git

[任务] 日拱一卒

TODO

  1. Support vagrant provision (ansible)
  2. Fix failed travis-ci

DONE since 20151209

稳定版本

我每天都看到很多code 被merge 进来。想知道啥时候能稳定下来?
有没有发布计划之类的?

TypeError: 'int' object is not iterable

启动后, 需要访问数据库的signup/expore/search页面报如下错误

2015-01-25 18:09:28 [17913] [ERROR] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/sync.py", line 131, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/home/hailin/code/app.py", line 19, in call
return func(environ, start_response)
File "/home/hailin/code/vilya/libs/gzipper.py", line 57, in call
response.gzip_start_response)
File "/home/hailin/code/src/quixote/quixote/qwip.py", line 32, in call
output = self.publisher.process_request(request, env)
File "/home/hailin/code/src/quixote/quixote/publish.py", line 551, in process_request
output = self.finish_failed_request(request)
File "/home/hailin/code/src/quixote/quixote/publish.py", line 545, in process_request
output = self.try_publish(request, env.get('PATH_INFO', ''))
File "/home/hailin/code/web.py", line 64, in try_publish
output = Publisher.try_publish(self, request, path)
File "/home/hailin/code/src/quixote/quixote/publish.py", line 464, in try_publish
self.namespace_stack)
File "/home/hailin/code/src/quixote/quixote/publish.py", line 731, in _traverse_url
namespace_stack)
File "/home/hailin/code/src/quixote/quixote/publish.py", line 834, in _get_component
object = container._q_lookup(request, component)
File "/home/hailin/code/vilya/views/init.py", line 47, in _q_lookup
user = User.get_by_name(name)
File "/home/hailin/code/vilya/models/user.py", line 30, in get_by_name
rs = cls.gets_by(name=name)
File "/home/hailin/code/src/orz/ORZ/klass_init.py", line 186, in gets_by
return cls.objects.gets_by(_a, *_kw)
File "/home/hailin/code/src/orz/ORZ/cache_mgr.py", line 179, in gets_by
return self.fetch(force_flush, kw, real_order_by, (start, limit))
File "/home/hailin/code/src/orz/ORZ/cache_mgr.py", line 103, in fetch
primary_field_vals = sql_executor.get_ids(conditions, _start_limit, order_keys)
File "/home/hailin/code/src/orz/ORZ/sql_executor.py", line 64, in get_ids
ids = map(itemgetter(0), self.sqlstore.execute(statement, tuple(chain(v1, v3))))
File "/home/hailin/code/src/doubansqlstore/douban/sqlstore/init.py", line 719, in execute
cursor = self.get_cursor(table=tables[0])
File "/home/hailin/code/src/doubansqlstore/douban/sqlstore/init.py", line 666, in get_cursor
cursor = farm.get_cursor()
File "/home/hailin/code/src/doubansqlstore/douban/sqlstore/init.py", line 223, in get_cursor
self.cursor = self.connect(**self.dbcnf)
File "/home/hailin/code/src/doubansqlstore/douban/sqlstore/init.py", line 198, in connect
return LuzCursor(cursor, self)
File "/home/hailin/code/src/doubansqlstore/douban/sqlstore/init.py", line 912, in init
self.cursor.execute(sql, self.cursor.connection.thread_id())
File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 187, in execute
query = query % tuple([db.literal(item) for item in args])
TypeError: 'int' object is not iterable

是憋着放大招么?

看了清风老师的视频,很是期待。。。。但看代码进展很慢,想问下是在等着放大招呢?还是放大招呢?

What is douban?

Hi,

I ran across this repository while working on a project of mine. It ranked top 5 but the readme doesn't describe the project all that much and many chinese characters :). Can anyone describe in english for me?

安装了所有相关程序,还是报错啊,请明示怎么解决啊

报错信息
[root@su code]# gunicorn -w 2 -b 0.0.0.0:8000 app:app
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 9, in
load_entry_point('gunicorn==19.1.1', 'console_scripts', 'gunicorn')()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/app/base.py", line 185, in run
super(Application, self).run()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/app/base.py", line 71, in run
Arbiter(self).run()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/arbiter.py", line 169, in run
self.manage_workers()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/arbiter.py", line 477, in manage_workers
self.spawn_workers()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/arbiter.py", line 542, in spawn_workers
time.sleep(0.1 * random.random())
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/arbiter.py", line 209, in handle_chld
self.reap_workers()
File "/usr/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/arbiter.py", line 459, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

Broken pipe when push to master

Hello,在创建了第一个repo之后,我按照步骤进行git push origin master操作,但是等待一段时间后失败,在服务端看到的错误输出信息如下:

Unpacking objects: 100% (3/3), done.
2014-02-18 15:03:31 [5079] [CRITICAL] WORKER TIMEOUT (pid:5105) 
2014-02-18 15:03:31 [5128] [INFO] Booting worker with pid: 5128
Did not install docutils
fatal: write error: Broken pipe

在客户端看到的信息如下:

]$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 261 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
error: RPC failed; result=52, HTTP code = 0

can not enter page, something is wrong with DB

start gunicorn:

# gunicorn -w 2 -b 127.0.0.1:8000 app:app
2014-02-15 00:45:45 [30081] [INFO] Starting gunicorn 18.0
2014-02-15 00:45:45 [30081] [INFO] Listening at: http://127.0.0.1:8000 (30081)
2014-02-15 00:45:45 [30081] [INFO] Using worker: sync
2014-02-15 00:45:45 [30084] [INFO] Booting worker with pid: 30084
2014-02-15 00:45:45 [30085] [INFO] Booting worker with pid: 30085
Did not install docutils
Did not install docutils

then visit 127.0.0.1:8000, the result is:

Traceback (most recent call last):
  File "/data/code/src/quixote/quixote/publish.py", line 545, in process_request
    output = self.try_publish(request, env.get('PATH_INFO', ''))
  File "/data/code/web.py", line 66, in try_publish
    output = SessionPublisher.try_publish(self, request, path)
  File "/data/code/src/quixote/quixote/publish.py", line 478, in try_publish
    output = object(request)
  File "/data/code/code/views/__init__.py", line 36, in _q_index
    tdt['current_user'] = User.get_by(id=session.user) if session else None
  File "/data/code/src/orz/ORZ/klass_init.py", line 190, in get_by
    return cls.objects.get(*a, **kw)
  File "/data/code/src/orz/ORZ/cache_mgr.py", line 65, in get
    ret = self.gets_by(id=id, force_flush=force_flush)
  File "/data/code/src/orz/ORZ/cache_mgr.py", line 179, in gets_by
    return self.fetch(force_flush, kw, real_order_by, (start, limit))
  File "/data/code/src/orz/ORZ/cache_mgr.py", line 103, in fetch
    primary_field_vals = sql_executor.get_ids(conditions, _start_limit, order_keys)
  File "/data/code/src/orz/ORZ/sql_executor.py", line 64, in get_ids
    ids = map(itemgetter(0), self.sqlstore.execute(statement, tuple(chain(v1, v3))))
  File "/data/code/src/doubansqlstore/douban/sqlstore/__init__.py", line 719, in execute
    cursor = self.get_cursor(table=tables[0])
  File "/data/code/src/doubansqlstore/douban/sqlstore/__init__.py", line 666, in get_cursor
    cursor = farm.get_cursor()
  File "/data/code/src/doubansqlstore/douban/sqlstore/__init__.py", line 223, in get_cursor
    self.cursor = self.connect(**self.dbcnf)
  File "/data/code/src/doubansqlstore/douban/sqlstore/__init__.py", line 198, in connect
    return LuzCursor(cursor, self)
  File "/data/code/src/doubansqlstore/douban/sqlstore/__init__.py", line 912, in __init__
    self.cursor.execute(sql, self.cursor.connection.thread_id())
  File "/Library/Python/2.7/site-packages/MySQLdb/cursors.py", line 187, in execute
    query = query % tuple([db.literal(item) for item in args])
TypeError: 'int' object is not iterable

[讨论]与云主机的结合?

似乎应该考虑找一个比较流行的云主机服务,在上面如果可以快速的搭建环境,似乎会更有吸引力?

🍺

douban code licene

请问code 是以什么license开源的?我看到上面写的还是 “ Copyright (c) 2013-2014, Douban Inc. All rights reserved. ”

作为一个较真的配置管理员想弄明白。毕竟如果我们安上了 code,是公司在用,是一种商业行为。

如果豆瓣真想全部开源出去,最好用某种开放的license,比如BSD 或者MIT。这样大家都可以没有顾及的使用和改代码了。

libmemcached安装过程出错没,原因是 gcc问题导致

Cleaning up...
Command /data/project/code/venv/bin/python -c "import setuptools, tokenize; file='/data/project/code/venv/src/python-libmemcached/setup.py'; exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" develop --no-deps failed with error code 1 in /data/project/code/venv/src/python-libmemcached
Traceback (most recent call last):
File "/data/project/code/venv/bin/pip", line 11, in
sys.exit(main())
File "/data/project/code/venv/lib/python2.7/site-packages/pip/init.py", line 185, in main
return command.main(cmd_args)
File "/data/project/code/venv/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 35: ordinal not in range(128)

python-libmemcached 的问题

安装完成后启动会有如下错误:

/python-libmemcached/cmemcached_imp.so: undefined symbol: memcached_touch

log:

(venv)vagrant@precise64:~/code$ gunicorn -w 2 -b 127.0.0.1:5000 app:app
2014-02-18 06:54:13 [10643] [INFO] Starting gunicorn 18.0
2014-02-18 06:54:13 [10643] [INFO] Listening at: http://127.0.0.1:5000 (10643)
2014-02-18 06:54:13 [10643] [INFO] Using worker: sync
2014-02-18 06:54:13 [10648] [INFO] Booting worker with pid: 10648
2014-02-18 06:54:13 [10649] [INFO] Booting worker with pid: 10649
2014-02-18 06:54:13 [10648] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    worker.init_process()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
    self.wsgi = self.app.wsgi()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
    self.callable = self.load()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
    return self.load_wsgiapp()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/home/vagrant/code/app.py", line 5, in <module>
    from web import app as web
  File "/home/vagrant/code/web.py", line 14, in <module>
    from code.libs.auth.check_auth import check_auth
  File "/home/vagrant/code/code/libs/auth/__init__.py", line 5, in <module>
    from code.models.user import User
  File "/home/vagrant/code/code/models/user.py", line 7, in <module>
    from code.libs.store import OrzField, store, IntegrityError, OrzBase
  File "/home/vagrant/code/code/libs/store.py", line 6, in <module>
    from douban.mc import mc_from_config, create_decorators
  File "/home/vagrant/code/venv/src/doubanmc/douban/mc/__init__.py", line 9, in <module>
    import cmemcached
  File "/home/vagrant/code/venv/src/python-libmemcached/cmemcached.py", line 5, in <module>
    from cmemcached_imp import *
ImportError: /home/vagrant/code/venv/src/python-libmemcached/cmemcached_imp.so: undefined symbol: memcached_touch
Traceback (most recent call last):
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    worker.init_process()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
    self.wsgi = self.app.wsgi()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
    self.callable = self.load()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
    return self.load_wsgiapp()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/home/vagrant/code/app.py", line 5, in <module>
    from web import app as web
  File "/home/vagrant/code/web.py", line 14, in <module>
    from code.libs.auth.check_auth import check_auth
  File "/home/vagrant/code/code/libs/auth/__init__.py", line 5, in <module>
    from code.models.user import User
  File "/home/vagrant/code/code/models/user.py", line 7, in <module>
    from code.libs.store import OrzField, store, IntegrityError, OrzBase
  File "/home/vagrant/code/code/libs/store.py", line 6, in <module>
    from douban.mc import mc_from_config, create_decorators
  File "/home/vagrant/code/venv/src/doubanmc/douban/mc/__init__.py", line 9, in <module>
    import cmemcached
  File "/home/vagrant/code/venv/src/python-libmemcached/cmemcached.py", line 5, in <module>
    from cmemcached_imp import *
ImportError: /home/vagrant/code/venv/src/python-libmemcached/cmemcached_imp.so: undefined symbol: memcached_touch
2014-02-18 06:54:13 [10648] [INFO] Worker exiting (pid: 10648)
2014-02-18 06:54:13 [10649] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    worker.init_process()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
    self.wsgi = self.app.wsgi()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
    self.callable = self.load()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
    return self.load_wsgiapp()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/home/vagrant/code/app.py", line 5, in <module>
    from web import app as web
  File "/home/vagrant/code/web.py", line 14, in <module>
    from code.libs.auth.check_auth import check_auth
  File "/home/vagrant/code/code/libs/auth/__init__.py", line 5, in <module>
    from code.models.user import User
  File "/home/vagrant/code/code/models/user.py", line 7, in <module>
    from code.libs.store import OrzField, store, IntegrityError, OrzBase
  File "/home/vagrant/code/code/libs/store.py", line 6, in <module>
    from douban.mc import mc_from_config, create_decorators
  File "/home/vagrant/code/venv/src/doubanmc/douban/mc/__init__.py", line 9, in <module>
    import cmemcached
  File "/home/vagrant/code/venv/src/python-libmemcached/cmemcached.py", line 5, in <module>
    from cmemcached_imp import *
ImportError: /home/vagrant/code/venv/src/python-libmemcached/cmemcached_imp.so: undefined symbol: memcached_touch
Traceback (most recent call last):
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    worker.init_process()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
    self.wsgi = self.app.wsgi()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
    self.callable = self.load()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
    return self.load_wsgiapp()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/home/vagrant/code/app.py", line 5, in <module>
    from web import app as web
  File "/home/vagrant/code/web.py", line 14, in <module>
    from code.libs.auth.check_auth import check_auth
  File "/home/vagrant/code/code/libs/auth/__init__.py", line 5, in <module>
    from code.models.user import User
  File "/home/vagrant/code/code/models/user.py", line 7, in <module>
    from code.libs.store import OrzField, store, IntegrityError, OrzBase
  File "/home/vagrant/code/code/libs/store.py", line 6, in <module>
    from douban.mc import mc_from_config, create_decorators
  File "/home/vagrant/code/venv/src/doubanmc/douban/mc/__init__.py", line 9, in <module>
    import cmemcached
  File "/home/vagrant/code/venv/src/python-libmemcached/cmemcached.py", line 5, in <module>
    from cmemcached_imp import *
ImportError: /home/vagrant/code/venv/src/python-libmemcached/cmemcached_imp.so: undefined symbol: memcached_touch
2014-02-18 06:54:13 [10649] [INFO] Worker exiting (pid: 10649)
Traceback (most recent call last):
  File "/home/vagrant/code/venv/bin/gunicorn", line 9, in <module>
    load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
    Arbiter(self).run()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 203, in run
    self.halt(reason=inst.reason, exit_status=inst.exit_status)
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 298, in halt
    self.stop()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 341, in stop
    self.reap_workers()
  File "/home/vagrant/code/venv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 452, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

登陆不进去

session 丢失?

Your session is invalid or has expired. Please reload this page to start a new session.

Expired or invalid session: 0d2b26420a14025e

启动报错提示 undefined symbol: git_oid_equal 与配置的问题

(venv)[root@BJNET-APP-99 code]# gunicorn -w 2 -b 127.0.0.1:8800 app:app
2014-05-06 16:30:50 [25604] [INFO] Starting gunicorn 18.0
2014-05-06 16:30:50 [25604] [INFO] Listening at: http://127.0.0.1:8800 (25604)
2014-05-06 16:30:50 [25604] [INFO] Using worker: sync
2014-05-06 16:30:50 [25609] [INFO] Booting worker with pid: 25609
2014-05-06 16:30:50 [25610] [INFO] Booting worker with pid: 25610
2014-05-06 16:30:50 [25609] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
2014-05-06 16:30:50 [25609] [INFO] Worker exiting (pid: 25609)
2014-05-06 16:30:50 [25610] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
2014-05-06 16:30:50 [25610] [INFO] Worker exiting (pid: 25610)
Traceback (most recent call last):
File "/data/project/code/venv/bin/gunicorn", line 9, in
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 203, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 298, in halt
self.stop()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 341, in stop
self.reap_workers()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 452, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

还有问一下:local_config.py 与config.py的关系是什么
gunicorn -w 2 -b 127.0.0.1:8000 app:app 启动会选择哪一个配置文件?

做个docker镜像吧

试着运行了下安装脚本,国内这个网络条件下,还没能完整跑完的。

做个docker镜像发布出来。这样可以跳过繁琐的安装,直接尝尝鲜。

之前看过PPT,说这东西挺好,但还没完全理解它的运作机制。

MySQL数据库连接信息是在哪设置的?

访问时报如下错误,好像默认使用root,无密码登陆

Traceback (most recent call last):
File "/data/code/venv/src/quixote/quixote/publish.py", line 545, in process_request
output = self.try_publish(request, env.get('PATH_INFO', ''))
File "/data/code/web.py", line 56, in try_publish
output = SessionPublisher.try_publish(self, request, path)
File "/data/code/venv/src/quixote/quixote/publish.py", line 456, in try_publish
self.start_request(request)
File "/data/code/web.py", line 51, in start_request
request.user = User.get_current_user()
File "/data/code/vilya/models/user.py", line 120, in get_current_user
user = get_current_user()
File "/data/code/vilya/models/user.py", line 48, in get_current_user
user = CodeUser.get(id=id)
File "/data/code/vilya/libs/model.py", line 86, in get
ret = cls.objects.gets_by(**kwargs)
File "/data/code/venv/src/orz/ORZ/cache_mgr.py", line 179, in gets_by
return self.fetch(force_flush, kw, real_order_by, (start, limit))
File "/data/code/venv/src/orz/ORZ/cache_mgr.py", line 103, in fetch
primary_field_vals = sql_executor.get_ids(conditions, _start_limit, order_keys)
File "/data/code/venv/src/orz/ORZ/sql_executor.py", line 64, in get_ids
ids = map(itemgetter(0), self.sqlstore.execute(statement, tuple(chain(v1, v3))))
File "/data/code/venv/src/doubansqlstore/douban/sqlstore/init.py", line 719, in execute
cursor = self.get_cursor(table=tables[0])
File "/data/code/venv/src/doubansqlstore/douban/sqlstore/init.py", line 666, in get_cursor
cursor = farm.get_cursor()
File "/data/code/venv/src/doubansqlstore/douban/sqlstore/init.py", line 223, in get_cursor
self.cursor = self.connect(**self.dbcnf)
File "/data/code/venv/src/doubansqlstore/douban/sqlstore/init.py", line 184, in connect
conn = MySQLdb.connect(*_conn_params)
File "/data/code/venv/src/mysql-python/MySQLdb/init.py", line 81, in Connect
return Connection(_args, *_kwargs)
File "/data/code/venv/src/mysql-python/MySQLdb/connections.py", line 187, in init
super(Connection, self).init(_args, **kwargs2)
OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

emoji表情肿么办

@xtao @qingfeng @CNBorn @hongqn

大神们... 邢老师提到 CODE用到的图片可能有版权问题. 看起来大部分图片都是你们贡献的. 我google图片搜索了下都没有明显看到这些图(抑或是自己生成的?). 所以先来问问那些图我可以放出来, 那些图我不应该放出来?

[讨论]CODE的下一步

@qingfeng @xtao @CNBorn

三位老师~~

CODE现在已经放出来95%以上的功能了. 下一步怎么走还请大家给建议, 来讨论, 当然还是希望大家一起写下去

现在问题

  1. 维护的力量不足, 涛涛新入职, 需要熟悉新环境; 我在条目组被各种产品需求淹没. 只能利用下班做.
  2. 我们欠缺一个整体的规划, 清风老师和邢老师都有经验, 不如来做点项目管理? 我对CODE熟悉程度还远不够 🐳

下一步需要做的

我觉得目前应该首要做的是完善现在CODE相关功能, 完善文档, 合适的provisioning等基础设施这些工作. 让用户可以在测试环境中用起来, 甚至可以线上环境用起来. 我列一下我想到的还需要做的事情.

  1. CODE还有一些点没有拆的很清楚
    1. douvatar的头像服务, 还没有完全拆出来
    2. #12 说的问题还存在, 我在拆和dae环境登陆相关事情的时候选择了quixote提供的session实现
    3. mq相关我换成了celery, 还没有测试
    4. codelive还没有加进来.
  2. 注册一个code的docker源, 现在只有vagrant的源. 提供给更多选择, 环境配置过程可以和vagrant一样
  3. provisioning工具, 我准备给vagrant添加provisioning工具, shire-in-vagrant用的是puppet, 我想用ansible. #23 也提到了
  4. 使用云主机或者vps搭建一个demo. 有一个测试账号体验过程. 但是权限上可以hack一些代码, 不让测试账号做删除之类的操作. 或者一个 http://try.douban.code 给想用的用户提供试用机会
  5. 添加符合travis-ci最新趋势的技术 - 国外同仁评判一个开源项目, 测试是一个关键点
  6. 给测试环境添加测试样例, 比如用户跑起来就可以使用test用户登录, 已经有一些默认项目, 有默认的team等.
  7. 邢老师说的很对. 良好的引导. 无论是安装, 配置, 以及使用指南. 我们现在很欠缺. 我想完整的介绍CODE都有哪些feature, 怎么用, 怎么配置, 场景等. 这个也应该放在README或者WIKI里面, 不需要用户很费劲的跑起来才能看到, 能预览
  8. 文档. 豆瓣所有开源项目最大的问题就是没有文档...
  9. 国际化. 开源, 只靠国内的支持是远远不够的. 我指的是让国外同仁很容易的了解, 使用CODE. 我英语能力有限, 还靠大家了~

协作方式

我想的是

  1. trello建card做任务安排
  2. slack(好吧, 自从邢老师离职大家就都不用了~)用来沟通, 讨论.
  3. 使用github提pr, 代码review(就是有点怪怪的感觉, 自己都不用CODE服务, 来用github会不会是一个槽点, 所以我想和上面提的, 自己用CODE搭建一个服务器, CODE托管到上面, 也做类似github一样的托管服务, 让其他人使用)

新人要求

有点没想到词儿. CODE肯定需要越来越多的人参与进来, 那肯定会有人可以被拉入我们组织. 还请清风老师邢老师联系下CODE贡献者们, 看看有没有兴趣继续.

还有一点就是入CODE团队的要求. 清风老师和邢老师要有经验的多: 什么样的人我们就可以拉入组织, 拉入slack, 和我们一样接受日常任务等等

Create New Project, Internal Server Error

Redirect to
/projects
Internal Server Error

Traceback (most recent call last):
File "code/venv/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 131, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "code/app.py", line 19, in call
return func(environ, start_response)
File "code/vilya/libs/gzipper.py", line 57, in call
response.gzip_start_response)
File "code/venv/src/quixote/quixote/qwip.py", line 32, in call
output = self.publisher.process_request(request, env)
File "code/venv/src/quixote/quixote/publish.py", line 551, in process_request
output = self.finish_failed_request(request)
File "code/venv/src/quixote/quixote/publish.py", line 545, in process_request
output = self.try_publish(request, env.get('PATH_INFO', ''))
File "code/web.py", line 64, in try_publish
output = Publisher.try_publish(self, request, path)
File "code/venv/src/quixote/quixote/publish.py", line 480, in try_publish
output = object.call(request)
File "code/vilya/views/projects/init.py", line 12, in call
return _q_index(request)
File "code/vilya/views/projects/init.py", line 24, in _q_index
creator_id=current_user.id)
File "code/vilya/models/project.py", line 46, in add
p.init_repo()
File "code/vilya/models/project.py", line 82, in init_repo
repo = ProjectRepo.init(self.repo_path)
File "code/vilya/models/git/repo.py", line 277, in init
return Jagare.init(path, work_path=work_path, bare=bare)
File "code/venv/src/ellen/ellen/repo.py", line 180, in init
init_repository(path, work_path=work_path, bare=bare)
File "code/venv/src/ellen/ellen/git/init.py", line 11, in init_repository
git.init(bare=bare)
File "code/venv/src/ellen/ellen/utils/process.py", line 55, in call
return proc.call(env=env)
File "code/venv/src/ellen/ellen/utils/process.py", line 91, in call
return _call(self.cmds + extra_cmds, env=env)
File "code/venv/src/ellen/ellen/utils/process.py", line 29, in _call
raise err
OSError: [Errno 2] No such file or directory

不想用mysql怎么办?

不想用mysql和memcached,有方便的方法可以换成别的数据库吗?比如说我想替换成postgre+redis,应该怎么做?

另外,要是有ebuild就太好了,对贵公司来说应该是小菜吧。

启用eventlet作为worker-class时,没有安装memcached代码提交不了

这样启动:
nohup gunicorn -w 2 -b 0.0.0.0:8001 --worker-class eventlet app:app > nohup.log &

push代码仓库时,提交失败,服务器端报错如下(安装memcached服务并启动,更改douban code的vilya/local_config.py文件中的memcached端口并重启后解决):
2014-2014-02-21 10:26:19 oahost8_98 memcached [cmemcached]memcached_get: server 127.0.0.1:11311 error: CONNECTION FAILURE

2014-02-21 10:26:24 [22143] [ERROR] Error handling request
Traceback (most recent call last):
File "/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/workers/async.py", line 45, in handle
self.handle_request(listener, req, client, addr)
File "/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/workers/async.py", line 93, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/data/home/zhaogang.lv/code/app.py", line 19, in call
return func(environ, start_response)
File "/data/home/zhaogang.lv/code/smart_httpd.py", line 95, in call
environ['GIT_PATH_INFO'] = get_git_path_info(path_info)
File "/data/home/zhaogang.lv/code/smart_httpd.py", line 47, in get_git_path_info
user = User.get_by_name(owner_name)
File "/data/home/zhaogang.lv/code/vilya/models/user.py", line 30, in get_by_name
rs = cls.gets_by(name=name)
File "/data/home/zhaogang.lv/code/venv/src/orz/ORZ/klass_init.py", line 186, in gets_by
return cls.objects.gets_by(_a, *_kw)
File "/data/home/zhaogang.lv/code/venv/src/orz/ORZ/cache_mgr.py", line 179, in gets_by
return self.fetch(force_flush, kw, real_order_by, (start, limit))
File "/data/home/zhaogang.lv/code/venv/src/orz/ORZ/cache_mgr.py", line 104, in fetch
self.mc.set(ck, primary_field_vals, ONE_HOUR)
File "/data/home/zhaogang.lv/code/venv/src/python-libmemcached/cmemcached.py", line 85, in set
self._check_thread_ident()
File "/data/home/zhaogang.lv/code/venv/src/python-libmemcached/cmemcached.py", line 141, in _check_thread_ident
self._get_current_thread_ident()))
ThreadUnsafe: mc client created in (22143, 'GreenThread-1')
[('/data/home/zhaogang.lv/code/venv/bin/gunicorn', 9, '', "load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()"), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py', 71, 'run', 'WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py', 143, 'run', 'Arbiter(self).run()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py', 175, 'run', 'self.manage_workers()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py', 470, 'manage_workers', 'self.spawn_workers()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py', 529, 'spawn_workers', 'self.spawn_worker()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py', 495, 'spawn_worker', 'worker.init_process()'), ('/data/home/zhaogang.lv/code/venv/lib/python2.7/site-packages/gunicorn/workers/geventlet.py', 48, 'init_proce...skipping...

关于 CODE 开源版本

这次开源之后,就已经吸引这么多朋友开始发PR了,这个说实话我们自己也是始料未及的。所以当前这个开源版本可能得做一个说明。

很多朋友可能也发现了,现在开源出来的版本和豆瓣内部使用的版本差距是非常大的,这是因为此次开源的版本,实际上只是一个希望可以让大家统一开发环境的版本,并且借助这个开源版本,把之前的代码进行一次迁移,所以这个过程应该会花一些时间。

所以,我觉得在初期可以分为以下几件事情来做,可以快速看到效果:

  • 一个方便的git server,一个命令就可以启动
  • 一个统一的开发环境,方便进行开发环境的搭建和部署,这件事在一开始做是有好处的
  • 前端脚手架的搭建,这次开源版本的一个重要目标就是把UI和API进行分离

抛砖引玉 🍺

安装错误

之前安装MySQL-python 1.2.4的时候distribute0.6.28安装有问题,就换成了1.2.3,之后可以了,到后面又出现问题了
输出
Downloading/unpacking misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10)) Could not find a version that satisfies the requirement misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10)) (from versions: 0.3.1, 0.3.2, 0.3.3, 0.4.0, 0.4.1, 0.4.2, 1.0.0, 1.0.1, 1.0.2) Cleaning up... No distributions matching the version for misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10)) Storing debug log for failure in /Users/fivesmallq/.pip/pip.log

No distributions matching the version for misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10)) Exception information: Traceback (most recent call last): File "/Users/fivesmallq/tool/code/code/venv/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/Users/fivesmallq/tool/code/code/venv/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/Users/fivesmallq/tool/code/code/venv/lib/python2.7/site-packages/pip/req.py", line 1177, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "/Users/fivesmallq/tool/code/code/venv/lib/python2.7/site-packages/pip/index.py", line 322, in find_requirement raise DistributionNotFound('No distributions matching the version for %s' % req) DistributionNotFound: No distributions matching the version for misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10))

gunicorn worker failed to boot

Hello, 在按照文档安装完成之后,启动的时候报错如下:

2014-02-18 03:07:58 [9947] [INFO] Starting gunicorn 18.0
2014-02-18 03:07:58 [9947] [INFO] Listening at: http://127.0.0.1:8000 (9947)
2014-02-18 03:07:58 [9947] [INFO] Using worker: sync
2014-02-18 03:07:58 [9952] [INFO] Booting worker with pid: 9952
2014-02-18 03:07:58 [9953] [INFO] Booting worker with pid: 9953
/opt/code/src/python-libmemcached/cmemcached.py:50: DeprecationWarning: object.__init__() takes no parameters
  cmemcached_imp.Client.__init__(self, logger)
/opt/code/src/python-libmemcached/cmemcached.py:50: DeprecationWarning: object.__init__() takes no parameters
  cmemcached_imp.Client.__init__(self, logger)
2014-02-18 03:07:58 [9952] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    worker.init_process()
  File "/usr/lib/python2.6/site-packages/gunicorn/workers/base.py", line 106, in init_process
    self.wsgi = self.app.wsgi()
  File "/usr/lib/python2.6/site-packages/gunicorn/app/base.py", line 114, in wsgi
    self.callable = self.load()
  File "/usr/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
    return self.load_wsgiapp()
  File "/usr/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/lib/python2.6/site-packages/gunicorn/util.py", line 354, in import_app
    __import__(module)
  File "/opt/code/app.py", line 5, in <module>
    from web import app as web
  File "/opt/code/web.py", line 17, in <module>
    from code.views.util import is_mobile_device
  File "/opt/code/code/views/__init__.py", line 9, in <module>
    from code.views.users import UserUI
  File "/opt/code/code/views/users/__init__.py", line 6, in <module>
    from code.models.project import Project
  File "/opt/code/code/models/project.py", line 9, in <module>
    from code.models.git.repo import ProjectRepo
  File "/opt/code/code/models/git/repo.py", line 329
    commits = {c['sha']: c for c in commits}
                             ^
SyntaxError: invalid syntax

我已经尝试解决但是未果,请问大牛此问题该如何破? thanks.

Need a provisioning tool

既然是国际社区 下面还是用英文写。


It's complicated to start contribute.
So a provisioning tool is helpful to development environment. Install the dependences and initialise the database, etc.

And i think setuptools is more powerful and popular than requirements.txt :P

python dependency missing

I tried to install code via docker,and found some python dependency was missing.

Obtaining misaka from git+https://github.com/qingfeng/misaka.git@2fbe52692e8f304eea9d8925fd2a857916ff0ea5#egg=misaka (from -r requirements.txt (line 20))
  Cloning https://github.com/qingfeng/misaka.git (to 2fbe52692e8f304eea9d8925fd2a857916ff0ea5) to /pip-src/misaka
  Could not find a tag or branch '2fbe52692e8f304eea9d8925fd2a857916ff0ea5', assuming commit.
Collecting mikoto==0.0.4 (from -r requirements.txt (line 21))
  Downloading mikoto-0.0.4.tar.gz
Collecting WebTest==2.0.20 (from -r requirements.txt (line 22))
  Downloading WebTest-2.0.20-py2-none-any.whl
Collecting mock==1.3.0 (from -r requirements.txt (line 23))
  Downloading mock-1.3.0-py2.py3-none-any.whl (56kB)
Collecting nose==1.3.7 (from -r requirements.txt (line 24))
  Downloading nose-1.3.7-py2-none-any.whl (154kB)
Collecting docutils==0.12 (from -r requirements.txt (line 25))
  Downloading docutils-0.12.tar.gz (1.6MB)
Obtaining sina from git+https://github.com/douban/sina.git@fd90a60150545bafd491dfd632d0f8212ae4f622#egg=sina (from -r requirements.txt (line 26))
  Cloning https://github.com/douban/sina.git (to fd90a60150545bafd491dfd632d0f8212ae4f622) to /pip-src/sina
  Could not find a tag or branch 'fd90a60150545bafd491dfd632d0f8212ae4f622', assuming commit.
Obtaining DoubanUtils from git+https://github.com/douban/douban-utils.git@5ca697545da191dab3fbe308e6b6776d8da83bd5#egg=DoubanUtils (from -r requirements.txt (line 27))
  Cloning https://github.com/douban/douban-utils.git (to 5ca697545da191dab3fbe308e6b6776d8da83bd5) to /pip-src/doubanutils
  Could not find a tag or branch '5ca697545da191dab3fbe308e6b6776d8da83bd5', assuming commit.
Obtaining DoubanSQLStore from git+https://github.com/douban/douban-sqlstore.git@d7136b7cac1075f0b285e8c763af2e85124f8b76#egg=DoubanSQLStore (from -r requirements.txt (line 28))
  Cloning https://github.com/douban/douban-sqlstore.git (to d7136b7cac1075f0b285e8c763af2e85124f8b76) to /pip-src/doubansqlstore
  Could not find a tag or branch 'd7136b7cac1075f0b285e8c763af2e85124f8b76', assuming commit.
Obtaining DoubanMC from git+https://github.com/dongweiming/douban-mc.git@5a0a21cdb73a448eb09a1b657ad80d4941ddb404#egg=DoubanMC (from -r requirements.txt (line 29))
  Cloning https://github.com/dongweiming/douban-mc.git (to 5a0a21cdb73a448eb09a1b657ad80d4941ddb404) to /pip-src/doubanmc
fatal: could not read Username for 'https://github.com': No such device or address
Command "git clone -q https://github.com/dongweiming/douban-mc.git /pip-src/doubanmc" failed with error code 128 in None

创建project以后要重启服务才能push成功

创建project以后,push代码不成功。

$ git remote add origin http://192.168.8.98:8001/david/demo.git
$ git push -u origin master
fatal: unable to access 'http://192.168.8.98:8001/david/demo.git/': The requested URL returned error: 500

kill gunicorn进程,重新启动,可以push成功。

$ git push -u origin master
Counting objects: 20, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (20/20), 2.51 KiB | 0 bytes/s, done.
Total 20 (delta 2), reused 0 (delta 0)
To http://192.168.8.98:8001/david/demo.git

  • [new branch] master -> master
    Branch master set up to track remote branch master from origin.

服务器:centos 6.3, python 2.7.3
客户端:mac 10.9.1

安装过程中报错

CentOS 6.4 (64位)
Python 2.6.6

RuntimeError: maximum recursion depth exceeded
/usr/local/soft/code/venv/build/MySQL-python/distribute-0.6.28-py2.6.egg
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/usr/local/soft/code/venv/build/MySQL-python/setup.py", line 7, in <module>
    use_setuptools()
  File "distribute_setup.py", line 145, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "distribute_setup.py", line 125, in _do_download
    _build_egg(egg, tarball, to_dir)
  File "distribute_setup.py", line 116, in _build_egg
    raise IOError('Could not build the egg.')
IOError: Could not build the egg.
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /usr/local/soft/code/venv/build/MySQL-python
Storing debug log for failure in /root/.pip/pip.log
Start serveing!!!
./quick_start.sh: line 18: gunicorn: command not found

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.