Форум сайта python.su
Не важно, что устанавливаю на Django. Вылезает ошибка такого содержания.
MissingSectionHeaderError at / File contains no section headers. file: hgweb.wsgi, line: 3 'from mercurial import demandimport\n'
Офлайн
причём джанга к mercurial'y ? O_o
что устанвливаешь? куда? как? …
Офлайн
Я ставлю hGate для Mercurial'a :)
Документация вот https://bitbucket.org/shedar/hgate/wiki/ru/install
Но ставлю не через Apache. А через связку nginx+uwsgi+supervisor
В hgwebdir.wsgi тупо пишу ЭЛЕМЕНТАРНЫЙ код
#!/usr/bin/env python from mercurial import demandimport demandimport.enable() import os os.environ["HGENCODING"] = "UTF-8" from mercurial.hgweb.hgwebdir_mod import hgwebdir from flup.server.fcgi import WSGIServer WSGIServer(hgwebdir('/home/hg/repos/hgweb.config')).run()
Отредактировано dissdoc (Март 26, 2012 17:26:24)
Офлайн
видимо потому-что херню пишешь
я такое юзаю для hgweb
wsgi из коробки
# An example WSGI for use with mod_wsgi, edit as necessary # See http://mercurial.selenic.com/wiki/modwsgi for more information # Path to repo or hgweb config to serve (see 'hg help hgweb') config = "/srv/hg/hgweb.config" # Uncomment and adjust if Mercurial is not installed system-wide # (consult "installed modules" path from 'hg debuginstall'): #import sys; sys.path.insert(0, "/path/to/python/lib") # Uncomment to send python tracebacks to the browser if an error occurs: import cgitb; cgitb.enable() # enable demandloading to reduce startup time from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb application = hgweb(config)
[uwsgi] plugin = python27 env = PYTHON_EGG_CACHE=/tmp workers = 1 max-requests = 1000 mount = /hg=/srv/hg/hgweb.wsgi manage-script-name = true
Офлайн
Возможно, тут я немного лоханулся. Но ошибка-то осталась :(
File contains no section headers. file: hgweb.wsgi, line: 1 'config = "/home/hg/repos/hgweb.config"\n'
Офлайн
ну это ты кажется каким-то редактором хитроделаным редактировал файл и что-то не так, толи BOM флажёк где-то затисался, толи ещё что, mcedit/vim попробуй и вставь заново всё это дело
тьфу, или у тебя в uwsgi конфиге что-то не то
Отредактировано slav0nic (Март 26, 2012 17:47:14)
Офлайн
Ну ок, значит что-то вставляется или еще что..
Я вообще в vim'е и делаю, на серваке Ubuntu Server 11.10
Буду еще копать… Странно очень
Офлайн