Start memo of Django application cloned from Github etc. How to run quickly on Mac without using virtual environment
venv is pre-installed.
python3 -m venv [newenvname]
Look at .gitignore and align the directory names of [newenvname]
https://qiita.com/fiftystorm36/items/b2fd47cf32c7694adc2e
brew upgrade mysql
mysql.server start
mysql -u root
CREATE USER username@localhost IDENTIFIED BY 'password';
CREATE DATABASE dbname;
GRANT ALL PRIVILEGES ON dbname.* TO username@localhost;
exit
mysql -u username -p
SHOW DATABASES;
Check settings.py
for the DB connection destination.
pip install -r requirements.txt
https://note.nkmk.me/python-pip-install-requirements/
python manage.py migrate
python manage.py createsuperuser
https://python.keicode.com/django/admin-site-enabling.php
python manage.py runserver
You can access the administration screen at localhost: 8000 / admin
Recommended Posts