luanpoppe commited on
Commit
b34386c
·
1 Parent(s): 20e8064

adicionando bando de dados

Browse files
Files changed (3) hide show
  1. requirements.txt +0 -0
  2. setup/settings.py +25 -22
  3. setup/urls.py +3 -1
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ
 
setup/settings.py CHANGED
@@ -1,4 +1,4 @@
1
- from pathlib import Path, os
2
  from dotenv import load_dotenv
3
 
4
  load_dotenv()
@@ -15,10 +15,12 @@ For the full list of settings and their values, see
15
  https://docs.djangoproject.com/en/4.2/ref/settings/
16
  """
17
 
18
- from pathlib import Path
19
 
20
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
21
- BASE_DIR = Path(__file__).resolve().parent.parent
 
 
22
 
23
 
24
  # Quick-start development settings - unsuitable for production
@@ -47,7 +49,8 @@ INSTALLED_APPS = [
47
  "corsheaders",
48
  "endpoint_teste",
49
  "drf_spectacular",
50
- "resumos"
 
51
  ]
52
 
53
  MIDDLEWARE = [
@@ -88,28 +91,28 @@ WSGI_APPLICATION = "setup.wsgi.application"
88
  # Database
89
  # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
90
 
91
- # DATABASES = {
92
- # 'default': {
93
- # 'ENGINE': 'django.db.backends.postgresql',
94
- # 'NAME': "...",
95
- # 'USER': "...",
96
- # 'PASSWORD': os.environ['DATABASE_PASSWORD'],
97
- # 'HOST': "...",
98
- # 'PORT': 5432,
99
- # 'OPTIONS': {
100
- # 'sslmode': 'require',
101
- # }
102
- # }
103
- # }
104
-
105
- # Se quiser utilizar a database inicial padrão do Django --> SQLite
106
  DATABASES = {
107
- "default": {
108
- "ENGINE": "django.db.backends.sqlite3",
109
- "NAME": BASE_DIR / "db.sqlite3",
 
 
 
 
 
 
 
110
  }
111
  }
112
 
 
 
 
 
 
 
 
 
113
 
114
  # Password validation
115
  # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
 
1
+ import os
2
  from dotenv import load_dotenv
3
 
4
  load_dotenv()
 
15
  https://docs.djangoproject.com/en/4.2/ref/settings/
16
  """
17
 
18
+ # from pathlib import Path
19
 
20
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
21
+ # BASE_DIR = Path(__file__).resolve().parent.parent
22
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
23
+
24
 
25
 
26
  # Quick-start development settings - unsuitable for production
 
49
  "corsheaders",
50
  "endpoint_teste",
51
  "drf_spectacular",
52
+ "resumos",
53
+ "modelos_usuarios"
54
  ]
55
 
56
  MIDDLEWARE = [
 
91
  # Database
92
  # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  DATABASES = {
95
+ 'default': {
96
+ 'ENGINE': 'django.db.backends.postgresql',
97
+ 'NAME': "vella",
98
+ 'USER': "vella_owner",
99
+ 'PASSWORD': os.environ['DATABASE_PASSWORD'],
100
+ 'HOST': "ep-black-tooth-a510h8oe.us-east-2.aws.neon.tech",
101
+ 'PORT': 5432,
102
+ 'OPTIONS': {
103
+ 'sslmode': 'require',
104
+ }
105
  }
106
  }
107
 
108
+ # Se quiser utilizar a database inicial padrão do Django --> SQLite
109
+ # DATABASES = {
110
+ # "default": {
111
+ # "ENGINE": "django.db.backends.sqlite3",
112
+ # "NAME": BASE_DIR / "db.sqlite3",
113
+ # }
114
+ # }
115
+
116
 
117
  # Password validation
118
  # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
setup/urls.py CHANGED
@@ -6,6 +6,7 @@ from drf_spectacular.views import SpectacularSwaggerView, SpectacularAPIView
6
 
7
  from endpoint_teste.views import EndpointTesteViewSet, getTeste, getPDF
8
  from resumos.views import ResumoView
 
9
 
10
  router = routers.DefaultRouter()
11
  # router.register("endpoint-teste", EndpointTesteViewSet, basename="Basename do endpoint-teste")
@@ -17,5 +18,6 @@ urlpatterns = [
17
  path('', include(router.urls)),
18
  path("teste", getTeste),
19
  path('pdf', getPDF, name='upload-pdf'),
20
- path('resumo', ResumoView.as_view(), name='summary-pdf')
 
21
  ]
 
6
 
7
  from endpoint_teste.views import EndpointTesteViewSet, getTeste, getPDF
8
  from resumos.views import ResumoView
9
+ from modelos_usuarios.views import ListCreateModeloUsuarioView
10
 
11
  router = routers.DefaultRouter()
12
  # router.register("endpoint-teste", EndpointTesteViewSet, basename="Basename do endpoint-teste")
 
18
  path('', include(router.urls)),
19
  path("teste", getTeste),
20
  path('pdf', getPDF, name='upload-pdf'),
21
+ path('resumo', ResumoView.as_view(), name='summary-pdf'),
22
+ path("modelo", ListCreateModeloUsuarioView.as_view())
23
  ]