update backend data structure, custom user created

This commit is contained in:
Chneemann 2024-08-04 08:47:19 +02:00
parent e5658a8c4e
commit 6743153be0
10 changed files with 33 additions and 9 deletions

2
backend/.gitignore vendored
View file

@ -144,4 +144,4 @@ GitHub.sublime-settings
**/migrations/** **/migrations/**
!**/migrations !**/migrations
!**/migrations/__init__.py !**/migrations/__init__.py
videoflix/user/migrations videoflix/users/migrations

22
backend/manage.py Executable file
View 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()

View file

@ -1,3 +1,4 @@
from django.contrib import admin from django.contrib import admin
from .models import CustomUser
# Register your models here. admin.site.register(CustomUser)

View file

@ -1,6 +1,6 @@
from django.apps import AppConfig from django.apps import AppConfig
class UserConfig(AppConfig): class UsersConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField' default_auto_field = 'django.db.models.BigAutoField'
name = 'user' name = 'users'

View file

@ -1,7 +1,7 @@
from django.db import models from django.db import models
from django.contrib.auth import AbstractUser from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser): class CustomUser(AbstractUser):
custom = models.CharField(max_length=1000, default='') custom = models.CharField(max_length=1000, default='')
phone = models.CharField(max_length=20, default='') phone = models.CharField(max_length=20, default='')
address = models.CharField(max_length=150, default='') address = models.CharField(max_length=150, default='')

View file

@ -20,7 +20,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # 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! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
@ -43,6 +43,7 @@ INSTALLED_APPS = [
AUTH_USER_MODEL = 'users.CustomUser' AUTH_USER_MODEL = 'users.CustomUser'
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',