andrewsnowden/flask-starter

installing issues

Closed this issue · 3 comments

I had some issues having downloaded your flask-starter-master.zip and following your getting started procedure:

  • cmd "python manage.py migrate init" leads to error "Directory alembic already exists".

Maybe the git-hub source should come with directory /alembic and alembic.ini removed so that a new user will not run into this issue when following your instructions.

  • cmd "python manage.py migrate revision --autogenerate -m "message describing migration" leads to error "ImportError: No module named MySQLdb"

Seems that mysql-python is a requirement...? This should be added to the requirement.txt list.

  • Having installed mysql-python and rerunning cmd "python manage.py migrate revision --autogenerate -m "message describing migration" the next error was "sqlalchemy.exc.OperationalError: (OperationalError) (1049, "Unknown database 'machineqa'") None None". Seems that no database was created...
  • Having created the database manually in mysql and rerunning cmd "python manage.py migrate revision --autogenerate -m "message describing migration" the next error was OSError: [Errno 2] No such file or directory: 'alembic/versions'.
  • Having manually created the folder 'alembic/versions' things went fine until launching dev.py where the web browser showed the following the error " "GET /login?next=%2F HTTP/1.1" 500 -
    Traceback (most recent call last):
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1701, in call
    return self.wsgi_app(environ, start_response)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/werkzeug/contrib/fixers.py", line 144, in call
    return self.app(environ, start_response)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
    File "/home/bob/python/flask-starter-master/machineqa/utils/api.py", line 35, in handle_exception
    return Flask.handle_exception(self.app, e)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/home/bob/python/flask-starter-master/machineqa/utils/api.py", line 44, in handle_user_exception
    return Flask.handle_user_exception(self.app, e)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask_security/decorators.py", line 209, in wrapper
    return f(_args, *_kwargs)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask_security/views.py", line 88, in login
    *__ctx('login'))
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/templating.py", line 125, in render_template
    context, ctx.app)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/flask/templating.py", line 107, in _render
    rv = template.render(context)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
    File "/home/bob/python/flask-starter-master/machineqa/templates/security/login_user.html", line 1, in top-level template code
    {% extends "security/base.html" %}
    File "/home/bob/python/flask-starter-master/machineqa/templates/security/base.html", line 1, in top-level template code
    {% extends "base.html" %}
    File "/home/bob/python/flask-starter-master/machineqa/templates/base.html", line 5, in top-level template code
    {%- block html %}
    File "/home/bob/python/flask-starter-master/machineqa/templates/base.html", line 8, in block "html"
    {%- block head %}
    File "/home/bob/python/flask-starter-master/machineqa/templates/base.html", line 19, in block "head"
    {%- block style %}
    File "/home/bob/python/flask-starter-master/machineqa/templates/base.html", line 29, in block "style"
    {% assets "less_stylesheets" %}
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/ext/jinja2.py", line 186, in _render_assets
    urls = bundle.urls()
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/bundle.py", line 784, in urls
    urls.extend(bundle._urls(new_ctx, extra_filters, *args, *_kwargs))
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/bundle.py", line 743, in _urls
    _args, *_kwargs)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/bundle.py", line 597, in _build
    force, disable_cache=disable_cache, extra_filters=extra_filters)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/bundle.py", line 522, in _merge_and_apply
    kwargs=item_data)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/merge.py", line 277, in apply
    return self._wrap_cache(key, func)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/merge.py", line 219, in wrap_cache
    content = func().getvalue()
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/merge.py", line 252, in func
    getattr(filter, type)(data, out, **kwargs_final)
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/filter/less.py", line 114, in input
    self.subprocess(args, out, in
    )
    File "/home/bob/python/flask-starter-master/venv/lib/python2.7/site-packages/webassets/filter/init.py", line 513, in subprocess
    shell=os.name == 'nt')
    File "/usr/lib/python2.7/subprocess.py", line 679, in init
    errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
    OSError: [Errno 2] No such file or directory

not sure what file is missing here...

Hi, thanks for the feedback - looks like I skipped some necessary info - sorry for the issues. I've updated the readme to cover all the issues you ran into and have added the MySQL and PostgreSQL drivers to requirements (I think I decided to not add them since you could use either MySQL or PostgreSQL but didn't specify).

The last issue seems to be related to not being able to find the less compiler on your machine. Have you run the npm install -g less and npm install -g coffee-script commands? If you have, then could you let me know what OS you are using and I could try and reproduce?

Yes, that was the issue, less and coffee-script wasn't properly installed. Thank you!

I know this is old but python manage.py wizard is what we need apparently?