change: change apps folder
This commit is contained in:
13
.env.example
13
.env.example
@@ -0,0 +1,13 @@
|
|||||||
|
SECRET_KEY=
|
||||||
|
DEBUG=True
|
||||||
|
ALLOWED_HOSTS=localhost,127.0.0.1
|
||||||
|
|
||||||
|
|
||||||
|
POSTGRES_DB=
|
||||||
|
POSTGRES_USER=
|
||||||
|
POSTGRES_PASSWORD=
|
||||||
|
POSTGRES_HOST=db
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
|
||||||
|
COMMAND=sh ./resources/scripts/entrypoint-server.sh
|
||||||
|
PORT=8080
|
||||||
@@ -18,11 +18,25 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
|
||||||
|
# packages
|
||||||
|
'drf_yasg',
|
||||||
|
'rest_framework',
|
||||||
|
'rest_framework_simplejwt',
|
||||||
|
'corsheaders',
|
||||||
|
# apps
|
||||||
|
'core.apps.shared',
|
||||||
|
'core.apps.accounts',
|
||||||
|
'core.apps.orders',
|
||||||
|
'core.apps.products',
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
'django.middleware.locale.LocaleMiddleware',
|
||||||
|
'corsheaders.middleware.CorsMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
'django.middleware.csrf.CsrfViewMiddleware',
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
|
|||||||
@@ -22,10 +22,17 @@ schema_view = get_schema_view(
|
|||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
|
path('api/v1/', include(
|
||||||
|
[
|
||||||
|
path('accounts/', include('core.apps.accounts.urls')),
|
||||||
|
path('orders/', include('core.apps.orders.urls')),
|
||||||
|
path('products/', include('core.apps.products.urls')),
|
||||||
|
path('shared/', include('core.apps.shared.urls')),
|
||||||
|
]
|
||||||
|
)),
|
||||||
|
|
||||||
|
path('', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
||||||
path('', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
@@ -3,4 +3,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
class AccountsConfig(AppConfig):
|
class AccountsConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'accounts'
|
name = 'core.apps.accounts'
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
0
core/apps/accounts/models/__init__.py
Normal file
0
core/apps/accounts/models/__init__.py
Normal file
10
core/apps/accounts/models/user.py
Normal file
10
core/apps/accounts/models/user.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from django.db import models
|
||||||
|
from django.contrib.auth.models import AbstractUser
|
||||||
|
|
||||||
|
from core.apps.shared.models.base import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
class User(AbstractUser, BaseModel):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
6
core/apps/accounts/urls.py
Normal file
6
core/apps/accounts/urls.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.urls import path, include
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
0
core/apps/orders/admin/__init__.py
Normal file
0
core/apps/orders/admin/__init__.py
Normal file
@@ -3,4 +3,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
class OrdersConfig(AppConfig):
|
class OrdersConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'orders'
|
name = 'core.apps.orders'
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
0
core/apps/orders/models/__init__.py
Normal file
0
core/apps/orders/models/__init__.py
Normal file
0
core/apps/orders/serializers/__init__.py
Normal file
0
core/apps/orders/serializers/__init__.py
Normal file
@@ -1,3 +0,0 @@
|
|||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
6
core/apps/orders/urls.py
Normal file
6
core/apps/orders/urls.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.urls import path, include
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
0
core/apps/orders/views/__init__.py
Normal file
0
core/apps/orders/views/__init__.py
Normal file
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
0
core/apps/products/admin/__init__.py
Normal file
0
core/apps/products/admin/__init__.py
Normal file
@@ -3,4 +3,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
class ProductsConfig(AppConfig):
|
class ProductsConfig(AppConfig):
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'products'
|
name = 'core.apps.products'
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
0
core/apps/products/models/__init__.py
Normal file
0
core/apps/products/models/__init__.py
Normal file
0
core/apps/products/serializers/__init__.py
Normal file
0
core/apps/products/serializers/__init__.py
Normal file
@@ -1,3 +0,0 @@
|
|||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
6
core/apps/products/urls.py
Normal file
6
core/apps/products/urls.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.urls import path, include
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
0
core/apps/products/views/__init__.py
Normal file
0
core/apps/products/views/__init__.py
Normal file
Reference in New Issue
Block a user