[PYTHON] Launch notes for existing Django applications

Start memo of Django application cloned from Github etc. How to run quickly on Mac without using virtual environment

Prepare a python environment for each project with venv

venv is pre-installed.

python3 -m venv [newenvname]

Look at .gitignore and align the directory names of [newenvname]

https://qiita.com/fiftystorm36/items/b2fd47cf32c7694adc2e

mysql update

brew upgrade mysql

User / DB creation / confirmation with 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.

Installation of dependent packages

pip install -r requirements.txt

https://note.nkmk.me/python-pip-install-requirements/

DB migration

python manage.py migrate

Superuser creation

python manage.py createsuperuser

https://python.keicode.com/django/admin-site-enabling.php

Server startup

python manage.py runserver

You can access the administration screen at localhost: 8000 / admin

Recommended Posts

Launch notes for existing Django applications
django notes
Django notes
[Django] as_view () notes
Django 1.9 for internationalization
Django Template notes
[Django] JWT notes
Launch my Django app
Celery notes on Django
[Personal notes] Python, Django
Learning notes for the migrations feature in the Django framework (3)
Learning notes for the migrations feature in the Django framework (1)
Installation notes for TensorFlow for Windows
[Django] Notes on using django-debug-toolbar
Python Tkinter notes (for myself)
Rename an existing Django application
[Django] Directory structure practices + notes
Notes for HHKB Programming Contest 2020
Tips for data analysis ・ Notes
[Note] [For myself] Django command