Primer commit

iniciando proyecto
This commit is contained in:
2023-02-16 11:40:04 +01:00
parent 667dc684c3
commit b07813a859
46 changed files with 1473 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
# django-quasar-lista-compra
Lista de la compra
Lista de la compra
![bd.png](./readmeImgs/bd.png)
### Proceso
- ([Build And Deploy A REST API With Django REST Framework. Full Project Tutorial. - YouTube 00:26:15](https://youtu.be/Sjv-HTLmnB4))

View File

3
authentication/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
authentication/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class AuthenticationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'authentication'

View File

3
authentication/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
authentication/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
authentication/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.HelloAuthView.as_view(), name='hello_auth'),
]

12
authentication/views.py Normal file
View File

@@ -0,0 +1,12 @@
# from django.shortcuts import render
from rest_framework import generics, status
from rest_framework.response import Response
# Create your views here.
class HelloAuthView(generics.GenericAPIView):
def get(self, request):
return Response(data={"message": "Hello Auth"},
status=status.HTTP_200_OK)

0
comparte/__init__.py Normal file
View File

3
comparte/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
comparte/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ComparteConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'comparte'

View File

3
comparte/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
comparte/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
comparte/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
compra/__init__.py Normal file
View File

3
compra/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
compra/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class CompraConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'compra'

View File

3
compra/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
compra/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
compra/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

1177
database/bd.dia Normal file

File diff suppressed because it is too large Load Diff

0
item/__init__.py Normal file
View File

3
item/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
item/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ItemConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'item'

View File

3
item/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
item/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
item/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
lista/__init__.py Normal file
View File

3
lista/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
lista/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ListaConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'lista'

View File

3
lista/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
lista/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
lista/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
listaCompra/__init__.py Normal file
View File

16
listaCompra/asgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
ASGI config for listaCompra project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'listaCompra.settings')
application = get_asgi_application()

117
listaCompra/settings.py Normal file
View File

@@ -0,0 +1,117 @@
from pathlib import Path
from decouple import config
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', cast=bool)
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Mis apps
'authentication.apps.AuthenticationConfig',
'lista.apps.ListaConfig',
'comparte.apps.ComparteConfig',
'item.apps.ItemConfig',
'compra.apps.CompraConfig',
# Terceras partes
'rest_framework'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'listaCompra.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'listaCompra.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

7
listaCompra/urls.py Normal file
View File

@@ -0,0 +1,7 @@
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('auth/', include('authentication.urls'))
]

16
listaCompra/wsgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
WSGI config for listaCompra project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'listaCompra.settings')
application = get_wsgi_application()

22
manage.py Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'listaCompra.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

BIN
readmeImgs/bd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

6
requirements.txt Normal file
View File

@@ -0,0 +1,6 @@
asgiref==3.6.0
Django==4.1.7
djangorestframework==3.14.0
python-decouple==3.7
pytz==2022.7.1
sqlparse==0.4.3