Remove unnecessary example application and add additional more to core
This commit is contained in:
parent
d4fa8f9121
commit
4a57db71bb
11
.env.example
11
.env.example
|
@ -1,13 +1,4 @@
|
|||
# README
|
||||
# 1. No spaces before or after `=`.
|
||||
# 2. Don't use quotations around strings, they're counted as strings by default.
|
||||
# 3. Change values according to your environment.
|
||||
# 4. Docker will automatically take all values from this file automatically.
|
||||
# 5. If values exist in the environment, it will not take values from this file.
|
||||
# 6. Rename this file from `.env.example` to `.env`
|
||||
|
||||
|
||||
SECRET_KEY=django-insecure-$227hjjmuq2e!)o^@2v#+(-=@$v362o@8g#s9!2)tjn1)1a
|
||||
SECRET_KEY=super-insecure-django-key
|
||||
DEBUG=True
|
||||
ALLOWED_HOSTS=*
|
||||
ENV_NAME=DEV
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,3 +0,0 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,3 +0,0 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
|
@ -3,4 +3,4 @@ from django.apps import AppConfig
|
|||
|
||||
class CoreConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'second_app'
|
||||
name = 'core'
|
|
@ -0,0 +1,51 @@
|
|||
import uuid
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
user_model = settings.AUTH_USER_MODEL
|
||||
|
||||
|
||||
class BaseModel(models.Model):
|
||||
uid = models.UUIDField(
|
||||
verbose_name=_('UUID'),
|
||||
unique=True,
|
||||
default=uuid.uuid4,
|
||||
editable=False
|
||||
)
|
||||
|
||||
created_by = models.ForeignKey(
|
||||
to=user_model,
|
||||
verbose_name=_('Created by'),
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='%(class)s_created',
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
|
||||
created_at = models.DateTimeField(
|
||||
verbose_name=_('Created at'),
|
||||
auto_now_add=True,
|
||||
editable=False,
|
||||
db_index=True
|
||||
)
|
||||
|
||||
updated_by = models.ForeignKey(
|
||||
to=user_model,
|
||||
verbose_name=_('Updated by'),
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='%(class)s_updated',
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
|
||||
updated_at = models.DateTimeField(
|
||||
verbose_name=_('Updated at'),
|
||||
auto_now=True,
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
|
@ -1,21 +1,8 @@
|
|||
"""config URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/4.0/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
|
||||
from django.urls import (
|
||||
include,
|
||||
path,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path("", include("apps.core.urls", "core")),
|
||||
]
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
python3 manage.py migrate --noinput
|
||||
python3 manage.py collectstatic --noinput
|
||||
|
||||
exec "$@"
|
|
@ -0,0 +1,5 @@
|
|||
[tool.black]
|
||||
line-length = 79
|
||||
target-version = ['py39']
|
||||
include = '\.pyi?$'
|
||||
extend-exclude = 'migrations/*'
|
Loading…
Reference in New Issue