pip install -r .\requirements
docker compose up --build
pytest --cov --cov-report=html
python3.7 -m venv <nome da venv>
source env/bin/activate # On Windows use `env\Scripts\activate` ou env\Scripts\activate.bat
source venv/Scripts/activate
pip install django==2.2.9
python -m django startproject library .
python -m django startapp cursos
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
pip install djangorestframework markdown django-filter
python manage.py sqlflush
pip install pymysql
pip install django-enum-choices
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
MEDIA_URL = 'media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_filters',
'rest_framework',
'cursosTwo',
]
REST_FRAMEWORK ={
'DEFAULT_AUTHENTICATICON_CLASSES':(
'rest_framework.authentication.SessionAuthentication',
),
'DEFAULT_PERMISSION_CLASSES':(
'rest_framework.persmissions.IsAuthenticatedOrReadOnly'
)
}
pip freeze > requirements.txt
python manage.py shell
from rest_framework.renderers import JSONRenderer