é uma ferramente q nos ajuda a isolar as dependencias e versoes do projeto, crie uma venv com o comando:
python3 -m venv <nome-da-pasta>
Para ativar, entre na pasta e execute:
source <nome-da-pasta>/bin/activate
Ao ativar o terminal vai ficar assim:
(client1) ➜ django-crud
pip install Django
django-admin startproject <nome-do-projeto> .
Obs: o ponto nao permite criar o projeto numa subpasta
python manage.py runserver
Execute antes de criar o superuser ou dps de uma migrations
python3 manage.py migrate
Escolha senha e username dps de executar:
python3 manage.py createsuperuser
Apos isso faça o login na rota /admin
Vc pode criar rotas com o comando
python3 manage.py startapp <nome-da-pasta>
A cada alteracao ou criacao de novo model, execute:
python3 manage.py makemigrations
https://github.com/jovimoura/django-crud
Texto
- Lista