├── myproject ├── __init__.py ├── core │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── management │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── hello.py │ │ │ └── create_data.py │ ├── admin.py │ ├── tests.py │ ├── static │ │ ├── css │ │ │ ├── form.css │ │ │ ├── style.css │ │ │ └── icons │ │ │ │ └── simple-line-icons.min.css │ │ ├── fonts │ │ │ ├── Simple-Line-Icons.eot │ │ │ ├── Simple-Line-Icons.ttf │ │ │ ├── Simple-Line-Icons.woff │ │ │ └── Simple-Line-Icons.woff2 │ │ ├── img │ │ │ └── django-logo-negative.png │ │ └── js │ │ │ └── django-ajax-setup.js │ ├── templates │ │ ├── index.html │ │ ├── base_login.html │ │ ├── base.html │ │ └── includes │ │ │ ├── nav.html │ │ │ └── pagination.html │ ├── apps.py │ ├── urls.py │ ├── views.py │ └── models.py ├── crm │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0002_auto_20210606_1948.py │ │ └── 0001_initial.py │ ├── tests.py │ ├── apps.py │ ├── templates │ │ └── crm │ │ │ ├── person_crispy_form.html │ │ │ ├── person_detail.html │ │ │ ├── person_form.html │ │ │ ├── person_photo_form.html │ │ │ ├── person_bootstrap_form.html │ │ │ ├── person_confirm_delete.html │ │ │ ├── person_modal.html │ │ │ ├── person_form2.html │ │ │ ├── person_form1.html │ │ │ ├── person_form0.html │ │ │ ├── contact_form.html │ │ │ ├── person_list.html │ │ │ └── person_vuejs_list.html │ ├── admin.py │ ├── urls.py │ ├── models.py │ ├── forms.py │ └── views.py ├── accounts │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── admin.py │ ├── tests.py │ ├── views.py │ ├── apps.py │ ├── urls.py │ └── templates │ │ └── accounts │ │ ├── login.html │ │ └── signup.html ├── asgi.py ├── wsgi.py ├── utils │ ├── progress_bar.py │ └── utils.py ├── urls.py └── settings.py ├── img ├── mtv1.png ├── mtv3.png ├── thor.gif ├── login.png ├── 1400605.jpg ├── auth_user_add.png ├── band_contact.png ├── dr_strange_failure.gif ├── admin_tabular_inline.png └── password-change-form.png ├── requirements.txt ├── manage.py ├── README.md ├── contrib └── env_gen.py ├── .gitignore └── passo-a-passo.md /myproject/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/crm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/accounts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/core/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/crm/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /myproject/core/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/mtv1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/mtv1.png -------------------------------------------------------------------------------- /img/mtv3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/mtv3.png -------------------------------------------------------------------------------- /img/thor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/thor.gif -------------------------------------------------------------------------------- /img/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/login.png -------------------------------------------------------------------------------- /img/1400605.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/1400605.jpg -------------------------------------------------------------------------------- /myproject/accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /myproject/core/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /myproject/core/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /myproject/crm/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /myproject/accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /myproject/accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /myproject/accounts/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /myproject/core/static/css/form.css: -------------------------------------------------------------------------------- 1 | span.required:after { 2 | content: "*"; 3 | color: red; 4 | } -------------------------------------------------------------------------------- /img/auth_user_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/auth_user_add.png -------------------------------------------------------------------------------- /img/band_contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/band_contact.png -------------------------------------------------------------------------------- /img/dr_strange_failure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/dr_strange_failure.gif -------------------------------------------------------------------------------- /img/admin_tabular_inline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/admin_tabular_inline.png -------------------------------------------------------------------------------- /img/password-change-form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/img/password-change-form.png -------------------------------------------------------------------------------- /myproject/core/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base.html" %} 3 | 4 | {% block content %} 5 | 6 | {% endblock content %} -------------------------------------------------------------------------------- /myproject/core/static/fonts/Simple-Line-Icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/myproject/core/static/fonts/Simple-Line-Icons.eot -------------------------------------------------------------------------------- /myproject/core/static/fonts/Simple-Line-Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/myproject/core/static/fonts/Simple-Line-Icons.ttf -------------------------------------------------------------------------------- /myproject/core/static/fonts/Simple-Line-Icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/myproject/core/static/fonts/Simple-Line-Icons.woff -------------------------------------------------------------------------------- /myproject/core/static/fonts/Simple-Line-Icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/myproject/core/static/fonts/Simple-Line-Icons.woff2 -------------------------------------------------------------------------------- /myproject/core/static/img/django-logo-negative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rg3915/django-forms-tutorial/HEAD/myproject/core/static/img/django-logo-negative.png -------------------------------------------------------------------------------- /myproject/crm/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CrmConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'myproject.crm' 7 | -------------------------------------------------------------------------------- /myproject/core/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CoreConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'myproject.core' 7 | -------------------------------------------------------------------------------- /myproject/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'myproject.accounts' 7 | -------------------------------------------------------------------------------- /myproject/core/static/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-top: 60px; 3 | } 4 | 5 | label.required:after { 6 | content: ' *'; 7 | color: red; 8 | } 9 | 10 | .no { 11 | color: red; 12 | } 13 | -------------------------------------------------------------------------------- /myproject/core/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from myproject.core import views as v 4 | 5 | app_name = 'core' 6 | 7 | 8 | urlpatterns = [ 9 | path('', v.index, name='index'), 10 | ] 11 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | dj-database-url==0.5.0 2 | django-bootstrap4==3.0.1 3 | django-crispy-forms==1.11.2 4 | django-extensions==3.1.3 5 | django-localflavor==3.1 6 | django-widget-tweaks==1.4.8 7 | Django==3.2.* 8 | Faker==8.5.1 9 | isort==5.8.0 10 | python-decouple==3.4 11 | Pillow==8.2.0 12 | -------------------------------------------------------------------------------- /myproject/accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.views import LoginView, LogoutView 2 | from django.urls import path 3 | 4 | urlpatterns = [ 5 | path( 6 | 'login/', 7 | LoginView.as_view(template_name='accounts/login.html'), 8 | name='login' 9 | ), 10 | path('logout/', LogoutView.as_view(), name='logout'), 11 | ] 12 | -------------------------------------------------------------------------------- /myproject/core/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.decorators import login_required 2 | from django.http import HttpResponse 3 | from django.shortcuts import render 4 | 5 | # @login_required 6 | # def index(request): 7 | # return HttpResponse('
Página simples.
') 8 | 9 | 10 | # @login_required 11 | def index(request): 12 | template_name = 'index.html' 13 | return render(request, template_name) 14 | -------------------------------------------------------------------------------- /myproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /myproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /myproject/utils/progress_bar.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def progressbar(it, prefix="", size=60, file=sys.stdout): 5 | count = len(it) 6 | 7 | def show(j): 8 | x = int(size * j / count) 9 | file.write("%s[%s%s] %i/%i\r" % 10 | (prefix, "#" * x, "." * (size - x), j, count)) 11 | file.flush() 12 | show(0) 13 | for i, item in enumerate(it): 14 | yield item 15 | show(i + 1) 16 | file.write("\n") 17 | file.flush() 18 | -------------------------------------------------------------------------------- /myproject/crm/templates/crm/person_crispy_form.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base.html" %} 3 | {% load crispy_forms_tags %} 4 | 5 | {% block content %} 6 |{{ error }}
17 | {% endfor %} 18 | {% endif %} 19 | 20 | 47 | 48 || Nome | 15 |Ações | 17 ||
|---|---|---|
| 23 | {{ object.full_name }} 24 | | 25 |{{ object.email|default:'---' }} | 26 |27 | 28 | 29 | 30 | 31 | 32 | 33 | | 34 |
Crie sua conta.
14 | 15 | 51 || Nome | 55 |Ações | 57 ||
|---|---|---|
| 62 | ${ person | fullName } 63 | | 64 |${ person.email } | 65 |66 | 67 | 68 | | 69 |
| Nome | 1232 ||
|---|---|
| 1238 | ${ person | fullName } 1239 | | 1240 |${ person.email } | 1241 |