Django app for making lists about stuff
#Running locally
- pip
python3 -m pip install --user --upgrade pip
- virtual env
python3 -m pip install --user virtualenv
- Navigate to the project root
- start a new virtual environment
python3 -m virtualenv env
- install mysql dmg file from the MySQL community server
- once downloaded, double click to open and install the file, follow the prompts
- start the server
- add the following line to your bash profile:
export PATH=$PATH:/usr/local/mysql/bin
-
restart the command line & naviate to the project root
-
drop into mysql shell
$ mysql -u root -p
- create the database
CREATE DATABASE gearlist;
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password1';
GRANT ALL PRIVILEGES ON gearlist.* TO 'admin'@'localhost';
FLUSH PRIVILEGES;
quit
- Create a superuser
python manage.py createsuperuser
- activate the virtual env
source env/bin/activate
- install requirements
pip install -r requirements.txt
- migrate
python manage.py migrate
- start the server:
python manage.py runserver
At this point the server should start and you can view the website locally at http://127.0.0.1:8000/
- I got error like 'library not loaded, so I did this and it seemed to work:
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:${DYLD_LIBRARY_PATH}"
export PATH="/usr/local/mysql/lib:${PATH}"
- if new packages are added, run
pip install -r requirements.txt
-
sometimes deleting env and creating a new one fixes stuff
-
database image not found:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
source env/bin/activate
python manage.py runserver