Skip to content

Commit e5bdf4d

Browse files
committed
needed to add info about adding the mysql connector for python
1 parent 8c9f988 commit e5bdf4d

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,46 +74,62 @@ $ npm run build:production
7474

7575
### New to Python?
7676

77-
If you are approaching this demo as primarily a frontend dev with limited or no Python experience, you may need to install a few things that a seasoned Python dev would already have installed.
77+
If you are approaching this demo as primarily a frontend dev with limited or no python experience, you may need to install a few things that a seasoned python dev would already have installed.
7878

7979
Most Macs already have python 2.7 installed but you may not have pip install. You can check to see if you have them installed:
8080

81+
```
8182
$ python --version
8283
$ pip --version
84+
```
8385

8486
If pip is not installed, you can follow this simple article to [get both homebrew and python](https://howchoo.com/g/mze4ntbknjk/install-pip-on-mac-os-x)
8587

8688
After you install python, you can optionally also install python 3
8789

90+
```
8891
$ brew install python3
92+
```
8993

9094
Now you can check again to see if both python and pip are installed. Once pip is installed, you can download the required flask modules:
9195

96+
```
9297
$ sudo pip install flask flask_script flask_migrate flask_bcrypt
98+
```
9399

94100
Now, you can decide on which database you wish to use.
95101

96-
##### New to MySQL?
102+
#### New to MySQL?
97103

98104
If you decide on MySQL, install the free community edition of [MySQL](https://dev.mysql.com/downloads/mysql/) and [MySQL Workbench](https://www.mysql.com/products/workbench/)
99105

100-
1. start MySQL
101-
2. open workbench and create a database called mydatabase
102-
3. create the DATABASE_URL configuration
106+
1. start MySQL from the System Preferences
107+
2. open MySQL Workbench and [create a database](http://stackoverflow.com/questions/5515745/create-a-new-database-with-mysql-workbench) called mydatabase but don't create the tables since flash will do that for you
108+
3. Install the MySQL connector for Python, add the DATABASE_URL configuration, and create the database and tables
103109

110+
```
111+
$ sudo pip install mysql-connector-python-rf
104112
$ export DATABASE_URL="mysql+mysqlconnector://username:password@localhost/mydatabase"
105113
$ python manage.py create_db
114+
```
106115

107116
Note: you do not need to run "python manage.py db upgrade" or "python manage.py db migrate" if its your first go at it
108117

109-
4. run the backend
118+
4. Run Back-End
110119

120+
```
111121
$ python manage.py runserver
122+
```
123+
124+
If all goes well, you should see ```* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)``` followed by a few more lines in the terminal.
112125

113126
5. open a new tab to the same directory and run the front end
114127

128+
```
115129
$ cd static
130+
$ npm install
116131
$ npm start
132+
```
117133

118134
6. open your browser to http://localhost:3000/register and setup your first account
119135
7. enjoy! By this point, you should be able to create an account and login without errors.

0 commit comments

Comments
 (0)