- Fazer um fork do repositório
E clonar a partir do seu repositório.
git clone [email protected]:<SEU-USERNAME>/core.git
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> | |
| <link rel="shortcut icon" href="https://alpinejs.dev/favicon.png"> | |
| <title>AlpineJS</title> | |
| <!-- Bulma --> |
| # Fix new app | |
| DIR=$(pwd) | |
| APP_NAME=$1 | |
| # Add route on urls.py | |
| sed -i "\@path('admin@ s@.*@ path('$APP_NAME/', include('backend.$APP_NAME.urls', namespace='$APP_NAME')),\n&@" $DIR/backend/urls.py | |
| # Insert text in INSTALLED_APPS | |
| sed -i "s/\]\s*$/ 'backend.$APP_NAME',\n]/" $DIR/backend/settings.py |
| import json | |
| data = """ | |
| { | |
| "data": { | |
| "items": [ | |
| { | |
| "name": "SciELO Preprints", | |
| "type": "dataverse", | |
| "url": "https://data.scielo.org/dataverse/preprints", |
E clonar a partir do seu repositório.
git clone [email protected]:<SEU-USERNAME>/core.git
O importante é aplicar o filtro corretamente.
https://docs.djangoproject.com/en/4.1/topics/auth/default/#permissions
Jeito Errado
{% if user.has_perm('expense.view_expense') %}
<p>OK</p>
{% endif %}Escreva em Markdown.
Repare que eu tenho um README.md e outros arquivos.
Objetivo: definir um valor default para um campo, simples né?
Pega a visão:
__init__class MyForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
pip install python-decouple # variaveis de ambiente
pip install django-storages # storage
cat << EOF > .env
AWS_ACCESS_KEY_ID=**********
AWS_SECRET_ACCESS_KEY=****************
AWS_STORAGE_BUCKET_NAME=brejinho