New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doplnit README #15

Open
hroncok opened this Issue Feb 16, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@hroncok
Member

hroncok commented Feb 16, 2018

Chci si před Pull Requestem spustit web lokálně a musím číst zdroják. To není příjemné a někoho by to mohlo i odradit.

@hroncok hroncok added the docs label Feb 16, 2018

@hroncok

This comment has been minimized.

Member

hroncok commented Feb 16, 2018

Postupoval jsem takto:

[pyworking.cz (master)]$ python3.6 -m venv __venv__ && . __venv__/bin/activate 
(__venv__) [pyworking.cz (master *)]$ pip install .
Processing .../pyvec/pyworking.cz
...
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.14.1 click-6.7 flask-0.12.2 itsdangerous-0.24 markdown-2.6.11 markdown-urlize-0.2.0 pyworking-cz-0.0.1 pyyaml-3.12
(__venv__) [pyworking.cz (master *)]$ export FLASK_DEBUG=1
(__venv__) [pyworking.cz (master *)]$ FLASK_APP=pyworking_cz:app flask run
 * Serving Flask app "pyworking_cz:app"
 * Forcing debug mode on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 116-940-349
127.0.0.1 - - [16/Feb/2018 16:34:02] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/pyworking_cz/views.py", line 12, in index
    events = load_events()
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/pyworking_cz/model.py", line 33, in load_events
    event_dir = get_data_dir() / 'events'
  File ".../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/pyworking_cz/model.py", line 25, in get_data_dir
    raise Exception('Data directory is not a directory: {}'.format(data_dir))
Exception: Data directory is not a directory: .../pyvec/pyworking.cz/__venv__/lib/python3.6/site-packages/data
...^C
(__venv__) [pyworking.cz (master *)]$ ln -s .../pyvec/pyworking.cz/data/ __venv__/lib/pyon3.6/site-packages/data
(__venv__) [pyworking.cz (master *)]$ FLASK_APP=pyworking_cz:app flask run
@messa

This comment has been minimized.

Contributor

messa commented Feb 16, 2018

Ahoj,

máš pravdu, README s popisem, jak to spustit, chybí, chce to doplnit.

Vedle je ale Makefile, kde je postup spuštění pro vývoj zachycen, a Dockerfile s produkčním spuštěním.

Tobě to nefungovalo proto, že sis to nainstaloval (pip install .) bez -e a zároveň není definovaná env proměnná DATA_DIR, se kterou počítá kód v model.py. Tento přístup v model.py taky není úplně šťastný a bylo by to fajn upravit, aby to používalo nějaké package metadata pro získání cesty k datovému adresáři (asi podobně jako se pracuje s flask templates).

messa added a commit that referenced this issue Apr 16, 2018

messa added a commit that referenced this issue Apr 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment