mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-08-21 14:37:16 +00:00
This commit is contained in:
@@ -19,6 +19,11 @@ from .server_plugins import (
|
||||
OutlineServerAdmin)
|
||||
|
||||
|
||||
admin.site.site_title = "VPN Manager"
|
||||
admin.site.site_header = "VPN Manager"
|
||||
admin.site.index_title = "OutFleet"
|
||||
|
||||
|
||||
@admin.register(Server)
|
||||
class ServerAdmin(PolymorphicParentModelAdmin):
|
||||
base_model = Server
|
||||
|
@@ -1,6 +1,7 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
class VPN(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'vpn'
|
||||
|
||||
|
17
vpn/management/commands/create_admin.py
Normal file
17
vpn/management/commands/create_admin.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Create default admin user'
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
User = get_user_model()
|
||||
if not User.objects.filter(username='admin').exists():
|
||||
User.objects.create_superuser(
|
||||
username='admin',
|
||||
password='admin',
|
||||
email='admin@localhost'
|
||||
)
|
||||
self.stdout.write(self.style.SUCCESS('Admin user created'))
|
||||
else:
|
||||
self.stdout.write(self.style.WARNING('Admin user already exists'))
|
Reference in New Issue
Block a user