+ Aduanasoft
+Automatizamos el comercio exterior
+diff --git a/Admin/settings.py b/Admin/settings.py index 1fc9224..6e1e1b3 100644 --- a/Admin/settings.py +++ b/Admin/settings.py @@ -75,7 +75,20 @@ AUTHENTICATION_BACKENDS = [ ] WSGI_APPLICATION = 'Admin.wsgi.application' - +ACCOUNT_FORMS = { + 'login': 'allauth.account.forms.LoginForm', + 'signup': 'allauth.account.forms.SignupForm', + 'add_email': 'allauth.account.forms.AddEmailForm', + 'change_password': 'allauth.account.forms.ChangePasswordForm', + 'set_password': 'allauth.account.forms.SetPasswordForm', + 'reset_password': 'allauth.account.forms.ResetPasswordForm', + 'reset_password_from_key': 'allauth.account.forms.ResetPasswordKeyForm', + 'disconnect': 'allauth.socialaccount.forms.DisconnectForm', +} +#LOGIN_URL = "/accounts/login/" +LOGIN_REDIRECT_URL = '/' +ACCOUNT_LOGOUT_REDIRECT_URL = '/accounts/login/' +ACCOUNT_SIGNUP_REDIRECT_URL =LOGIN_REDIRECT_URL # Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases diff --git a/Admin/urls.py b/Admin/urls.py index 8304dae..8878e56 100644 --- a/Admin/urls.py +++ b/Admin/urls.py @@ -1,22 +1,9 @@ -"""Admin URL Configuration -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/4.1/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" from django.contrib import admin from django.urls import path,include urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), + path('', include('Clientes.urls')), ] diff --git a/Clientes/migrations/0001_initial.py b/Clientes/migrations/0001_initial.py new file mode 100644 index 0000000..57e997d --- /dev/null +++ b/Clientes/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# Generated by Django 4.1.3 on 2022-11-27 01:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Timbres', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uuid', models.CharField(max_length=36, unique=True)), + ('rfcc', models.CharField(max_length=13)), + ('fecha', models.CharField(max_length=55)), + ('folio', models.CharField(max_length=55)), + ('serie', models.CharField(max_length=10)), + ('tipo', models.CharField(max_length=35)), + ], + ), + ] diff --git a/Clientes/migrations/0002_timbres_rfcp.py b/Clientes/migrations/0002_timbres_rfcp.py new file mode 100644 index 0000000..e1e7e4b --- /dev/null +++ b/Clientes/migrations/0002_timbres_rfcp.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.3 on 2022-11-27 02:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('Clientes', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='timbres', + name='rfcp', + field=models.CharField(default=1, max_length=13), + preserve_default=False, + ), + ] diff --git a/Clientes/models.py b/Clientes/models.py index 71a8362..efc7ca9 100644 --- a/Clientes/models.py +++ b/Clientes/models.py @@ -1,3 +1,11 @@ from django.db import models -# Create your models here. +class Timbres(models.Model): + uuid = models.CharField(max_length=36, unique=True) + rfcc = models.CharField(max_length=13) + rfcp = models.CharField(max_length=13) + fecha = models.CharField(max_length=55) + folio = models.CharField(max_length=55) + serie = models.CharField(max_length=10) + tipo = models.CharField(max_length=35) + diff --git a/Clientes/urls.py b/Clientes/urls.py new file mode 100644 index 0000000..e8cea62 --- /dev/null +++ b/Clientes/urls.py @@ -0,0 +1,6 @@ +from django.urls import path,include +from .views import index,add_timbre +urlpatterns = [ + path('', index, name='index'), + path('add_timbre/', add_timbre, name='add_timbre'), +] \ No newline at end of file diff --git a/Clientes/views.py b/Clientes/views.py index 91ea44a..baa921f 100644 --- a/Clientes/views.py +++ b/Clientes/views.py @@ -1,3 +1,34 @@ from django.shortcuts import render +from django.http import HttpResponse +from django.contrib.auth.decorators import login_required +from .models import Timbres +@login_required +def index(request): + return HttpResponse('hello') -# Create your views here. + +def add_timbre(request): + uuid= request.GET.get('uuid', None) + rfcc= request.GET.get('rfcc', None) + fecha=request.GET.get('fecha', None) + folio=request.GET.get('folio', None) + serie=request.GET.get('serie', None) + tipo=request.GET.get('tipo', None) + rfcp=request.GET.get('rfcp', None) + obj={ + 'uuid':uuid, + 'rfcc':rfcc, + 'fecha':fecha, + 'folio':folio, + 'serie':serie, + 'tipo':tipo, + 'rfcp':rfcp + } + p = Timbres.objects.all() + p.delete() + try: + obj = Timbres.objects.create(**obj) + return HttpResponse('ok') + except Exception as e: + + return HttpResponse(e) \ No newline at end of file diff --git a/Templates/account/base.html b/Templates/account/base.html new file mode 100644 index 0000000..d3c5126 --- /dev/null +++ b/Templates/account/base.html @@ -0,0 +1,190 @@ +{% load static %} + + +
+ + + + + + + + + + + + + + + + + + {% block extra_head %} + + {% endblock %} + + + + + + +
+ Automatizamos el comercio exterior
+Don't have an account? Register Here
+