-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·51 lines (38 loc) · 1.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# First of all
# alias m='make'
# Remover os caches que o PY gera
clean:
find . -type d -name '__pycache__' -prune -exec rm -rf {} \;
find . -name "*.pyc" -exec rm -rf {} \;
# Rodando em todos os pc's conectados na mesma rede
run:
python manage.py runserver 127.0.0.1:8000
# Migração de banco de dados
te:
python manage.py migrate
python manage.py migrate newsletter
tions:
python manage.py makemigrations
python manage.py makemigrations newsletter
off_tions:
# find . -type d -name 'migrations' -prune -exec rm -rf {} \;
cd src/apps/newsletter && rm -rf migrations
# Criando o super usuário
user:
python manage.py createsuperuser
# Interagindo com o shell no django
shell:
python manage.py shell
# Coletando os arquivos estáticos de todas apps para um único diretório
staticfiles:
python manage.py collectstatic
# Limpar os registros do banco
del:
python manage.py sqlflush
# Exportando base de dados
dump:
python manage.py dumpdata --format=json --indent=4 --database=default --all > db_dump.json
load:
python manage.py loaddata db_dump.json # database=production
comments_off:
sed '/^[[:blank:]]*#/d;s/#.*//' **/*.py