mirror of
https://github.com/lemeow125/InfoTech-Backend.git
synced 2025-08-02 01:23:19 +08:00
Added user account functionality
This commit is contained in:
parent
7a7c922963
commit
21cb6eb850
14 changed files with 483 additions and 4 deletions
0
infotech/accounts/__init__.py
Normal file
0
infotech/accounts/__init__.py
Normal file
3
infotech/accounts/admin.py
Normal file
3
infotech/accounts/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
6
infotech/accounts/apps.py
Normal file
6
infotech/accounts/apps.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AccountsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'accounts'
|
0
infotech/accounts/migrations/__init__.py
Normal file
0
infotech/accounts/migrations/__init__.py
Normal file
3
infotech/accounts/models.py
Normal file
3
infotech/accounts/models.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
3
infotech/accounts/tests.py
Normal file
3
infotech/accounts/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
7
infotech/accounts/urls.py
Normal file
7
infotech/accounts/urls.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('', include('djoser.urls')),
|
||||
path('', include('djoser.urls.authtoken'))
|
||||
]
|
3
infotech/accounts/views.py
Normal file
3
infotech/accounts/views.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
0
infotech/api/__init__.py
Normal file
0
infotech/api/__init__.py
Normal file
6
infotech/api/urls.py
Normal file
6
infotech/api/urls.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('accounts/', include('accounts.urls'))
|
||||
]
|
|
@ -37,6 +37,9 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'djoser'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
@ -105,7 +108,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
TIME_ZONE = 'Asia/Manila'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
|
@ -121,3 +124,15 @@ STATIC_URL = 'static/'
|
|||
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||
'rest_framework.authentication.TokenAuthentication',
|
||||
)
|
||||
}
|
||||
|
||||
DJOSER = {
|
||||
'SEND_ACTIVATION_EMAIL': True,
|
||||
'SEND_CONFIRMATION_EMAIL': True,
|
||||
'ACTIVATION_URL': 'activation/{uid}/{token}',
|
||||
}
|
||||
|
|
|
@ -14,8 +14,9 @@ Including another URLconf
|
|||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('api/v1/', include('api.urls')),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue