update backend data structure, custom user created
This commit is contained in:
parent
e5658a8c4e
commit
6743153be0
10 changed files with 33 additions and 9 deletions
2
backend/.gitignore
vendored
2
backend/.gitignore
vendored
|
|
@ -144,4 +144,4 @@ GitHub.sublime-settings
|
|||
**/migrations/**
|
||||
!**/migrations
|
||||
!**/migrations/__init__.py
|
||||
videoflix/user/migrations
|
||||
videoflix/users/migrations
|
||||
22
backend/manage.py
Executable file
22
backend/manage.py
Executable 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', 'videoflix.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()
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
from django.contrib import admin
|
||||
from .models import CustomUser
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(CustomUser)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class UserConfig(AppConfig):
|
||||
class UsersConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'user'
|
||||
name = 'users'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth import AbstractUser
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
class CustomUser(AbstractUser):
|
||||
custom = models.CharField(max_length=1000, default='')
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-0uaid_f*y1j7ukfk5*im@axnjp#scxb51w#8j*^18axqc#o#v('
|
||||
SECRET_KEY = 'django-insecure-*o%q)*3l+9^fs!m0z_h=z9bc)su=%)fv$@ktb#pza-pvi^z*en'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
|
@ -43,6 +43,7 @@ INSTALLED_APPS = [
|
|||
|
||||
AUTH_USER_MODEL = 'users.CustomUser'
|
||||
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
Loading…
Reference in a new issue