circleci-public / circleci-demo-python-flask Goto Github PK
View Code? Open in Web Editor NEWA demo application to learn how to use CircleCI
Home Page: https://circleci.com/gh/CircleCI-Public/circleci-demo-python-flask
License: MIT License
A demo application to learn how to use CircleCI
Home Page: https://circleci.com/gh/CircleCI-Public/circleci-demo-python-flask
License: MIT License
As title, this issue is also mentioned on TODO
section on README
.
Once this issue is accepted, I can work on this and please add #orbtoberfest
on this issue because of the hacktoberfest circleci :).
As title, it seems that the latest CirCleCI build is failed.
And I think it should be fixed/concerned.
Once this issue is accepted, I can work on this and please add #orbtoberfest
on this issue because of the hacktoberfest circleci :).
TL;DR: Make a note to walkthrough users that they will have to add their Heroku API Key to CircleCI before starting or the first error wont look like the walkthrough. You will get this:
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git push heroku master
heroku run python manage.py deploy
heroku restart
fi
Shell: /bin/bash -eo pipefail
Username for 'https://git.heroku.com': fatal: could not read Username for 'https://git.heroku.com': No such file or directory
Exited with code 128
Adding the key will get you the expected first error.
Also: When forking, make sure to change project name to not conflict on Heroku with the tutorial instance which has the 'cci-demo-walkthrough' namespace occupied.
on a MacOS Mojave 10.14.6
I followed Readme:
postgreSQL 9.6 (running and created database circulate)
venv activated
installed requirements.txt
python manage.py deploy --> error:
(venv) (base) Kelles-MacBook-Air-2:circleci-demo-python-flask kelleclark$ python manage.py deploy
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
Traceback (most recent call last):
File "manage.py", line 83, in
manager.run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask_script/init.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask_script/init.py", line 383, in handle
res = handle(*args, **config)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask_script/commands.py", line 216, in call
return self.run(*args, **kwargs)
File "manage.py", line 76, in deploy
Role.insert_roles()
File "/Users/kelleclark/Documents/CI_practice/circleci-demo-python-flask/app/models.py", line 42, in insert_roles
role = Role.query.filter_by(name=r).first()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3214, in first
ret = list(self[0:1])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3006, in getitem
return list(res)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3316, in iter
return self._execute_and_instances(context)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3341, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
distilled_params,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
e, statement, parameters, cursor, context
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "roles" does not exist
LINE 2: FROM roles
^
[SQL: SELECT roles.id AS roles_id, roles.name AS roles_name, roles."default" AS roles_default, roles.permissions AS roles_permissions
FROM roles
WHERE roles.name = %(name_1)s
LIMIT %(param_1)s]
[parameters: {'name_1': 'Moderator', 'param_1': 1}]
(Background on this error at: http://sqlalche.me/e/f405)
What I did ...
It seemed like the table for roles hadnt been created...and I saw that in the testing they created some data by using
db.create_all()
so in manage.py, I added db.create:
@manager.command
def deploy():
"""Run deployment tasks."""
from flask_migrate import upgrade
from app.models import Role, User
db.create_all()
Now seems to be ok....
(venv) (base) Kelles-MacBook-Air-2:circleci-demo-python-flask kelleclark$ python manage.py deploy
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
(venv) (base) Kelles-MacBook-Air-2:circleci-demo-python-flask kelleclark$ python manage.py runserver
In the job section of walkthrough, consider changing the working_directory from ~/circulate to ~/. For noobs, this is not evident since 'circulate' is not the name of the demo project.
In config.yml:
version: 2
jobs:
build:
working_directory: ~/<project-root>
docker:
- image: python:3.6.0
steps:
- checkout
- run: echo "hello world"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.