Open williamsmichael opened 7 years ago
@jasonleonhard here are the steps without pipenv and make. For me, the make command works as long as there is not a pipenv in the command. I attempted to install pipenv but received an error that I could not make sense of and decided to move past it, at this time. The pipenv and MakeFile are great but either need to be refactored for easy install or allow for the user to create a virtualenv of choice, load the requirements, and run make commands without pipenv.
@91ashika provided a link for installing postgresql for windows. Have not had a chance to test. The biggest hurdle from the mac side included getting the psql
to run in the command line. From there, everything else fell into place.
I followed this step to get psql running in terminal, ran both of these and now it works in terminal. PATH="/Applications/Postgres.app/Contents/Versions/9.6/bin:$PATH" export PATH="/Applications/Postgres.app/Contents/Versions/9.6/bin:$PATH"
When I tried to run psql -a -f postgresql_setup.sql python3 db_create.py it wouldn't work with the env so I changed line 9 in models.py to app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/gyfted_dev' and now project is running.
I have postgres installed already.For some reason, my system is hanging at this command 'psql -a -f postgresql_setup.sql'. I will try to figure it out. If nothing works by tomorrow, I will setup mysql locally and try to use it.
@91ashika, if you could when time permits update the Windows section in the original portion of the request postgres steps or open a new issue to post the steps for mySQL for windows, that would be helpful.
CREATE VIRTUAL ENVIRONMENT
PIPENV workaround
Create an empty Python3 virtual environment named "gyfted"
virtualenv -p python3 gyfted
sourcemkvirtualenv -p python3 gyfted
sourceconda create -n gyfted python=3
sourceInstall project requirements
pip install -r requirements.txt
POSTGRESQL
MAC
which psql
and it should return/Applications/Postgres.app/Contents/Versions/latest/bin/psql
. Another test is runpsql
and it should return[database name]=#
.bash_profile
existsopen -a TextEdit ~/.bash_profile
. This article explains why the postgresapp documentation sudo command did not work because a.bash_profile
exists..bash_profile
exists, you have the option to create a.profile
or add the following to the end of the.bash_profile
from this articleexport PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
WINDOWS
CREATE DATABASE
export DATABASE_URL='postgresql://localhost/gyfted_dev'
env | grep -i dat
and it should returnDATABASE_URL='postgresql://localhost/gyfted_dev'
psql -a -f postgresql_setup.sql
python db_create.py
and it should return[]
python app.py
http://127.0.0.1:5000/
#