Browse Source

Zwischencommit

Sebastian Lohff 3 years ago
parent
commit
35458ab391

+ 6
- 0
.gitignore View File

@@ -0,0 +1,6 @@
1
+.*.swp
2
+.*.swo
3
+*.pyc
4
+*.pyo
5
+__pycache__
6
+db.sqlite3

+ 3
- 1
dncore/admin.py View File

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

+ 46
- 0
dncore/migrations/0001_initial.py View File

@@ -0,0 +1,46 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.10.5 on 2017-02-13 03:01
3
+from __future__ import unicode_literals
4
+
5
+import django.contrib.auth.models
6
+import django.contrib.auth.validators
7
+from django.db import migrations, models
8
+import django.utils.timezone
9
+
10
+
11
+class Migration(migrations.Migration):
12
+
13
+    initial = True
14
+
15
+    dependencies = [
16
+        ('auth', '0008_alter_user_username_max_length'),
17
+    ]
18
+
19
+    operations = [
20
+        migrations.CreateModel(
21
+            name='User',
22
+            fields=[
23
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
24
+                ('password', models.CharField(max_length=128, verbose_name='password')),
25
+                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
26
+                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
27
+                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
28
+                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
29
+                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
30
+                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
31
+                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
32
+                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
33
+                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
34
+                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
35
+                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
36
+            ],
37
+            options={
38
+                'verbose_name_plural': 'users',
39
+                'verbose_name': 'user',
40
+                'abstract': False,
41
+            },
42
+            managers=[
43
+                ('objects', django.contrib.auth.models.UserManager()),
44
+            ],
45
+        ),
46
+    ]

+ 15
- 0
dncore/templates/profile/profile.html View File

@@ -0,0 +1,15 @@
1
+{% extends "base.html" %}
2
+
3
+{% block content %}
4
+<div class="row">
5
+	<div class="col-sm-12">
6
+		<div class="panel panel-default">
7
+			<div class="panel-heading">Header</div>
8
+			<div class="panel-body">
9
+				Body
10
+			</div>
11
+		</div>
12
+	</div>
13
+</div>
14
+{% endblock %}
15
+

+ 12
- 0
dncore/urls.py View File

@@ -0,0 +1,12 @@
1
+from django.conf.urls import url
2
+from django.contrib.auth import views as auth_views
3
+
4
+from . import views as dncore_views
5
+
6
+urlpatterns = [
7
+	url(r'^$', dncore_views.dashboard, name='dashboard'),
8
+
9
+	url(r'^login/$', auth_views.login, name='login'),
10
+	url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
11
+	url(r'^profile/$', dncore_views.profile, name='profile'),
12
+]

+ 11
- 1
dncore/views.py View File

@@ -1,3 +1,13 @@
1 1
 from django.shortcuts import render
2
+from django.contrib.auth.decorators import login_required
2 3
 
3
-# Create your views here.
4
+@login_required
5
+def profile(request):
6
+	return render(request, "profile/profile.html", {})
7
+
8
+@login_required
9
+def dashboard(request):
10
+	pass
11
+
12
+def index(request):
13
+	return render(request, "index.html", {})

BIN
dnmgmt/__pycache__/__init__.cpython-35.pyc View File


BIN
dnmgmt/__pycache__/settings.cpython-35.pyc View File


+ 2
- 1
dnmgmt/settings.py View File

@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.10/ref/settings/
11 11
 """
12 12
 
13 13
 import os
14
+from django.contrib import messages
14 15
 
15 16
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 17
 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -130,7 +131,7 @@ MESSAGE_TAGS = {
130 131
     messages.ERROR: 'danger',
131 132
 }
132 133
 
133
-AUTH_USER_MODEL = 'contest.User'
134
+AUTH_USER_MODEL = 'dncore.User'
134 135
 LOGIN_REDIRECT_URL = '/'
135 136
 LOGIN_URL = '/login/'
136 137
 

+ 11
- 3
dnmgmt/urls.py View File

@@ -13,11 +13,19 @@ Including another URLconf
13 13
     1. Import the include() function: from django.conf.urls import url, include
14 14
     2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
15 15
 """
16
-from django.conf.urls import url
16
+from django.conf.urls import url, include
17 17
 from django.contrib import admin
18 18
 
19
+import dncore.urls
20
+import dncore.views
21
+import whoisdb.urls
22
+
23
+
19 24
 urlpatterns = [
25
+	url(r'^$', dncore.views.index),
26
+	url(r'^dashboard/$', dncore.views.dashboard),
27
+
20 28
     url(r'^admin/', admin.site.urls),
21
-	url(r'^user/', dncore.urls),
22
-	url(r'^whoisdb/', whoisdb.urls),
29
+	url(r'^user/', include(dncore.urls, namespace='user')),
30
+	url(r'^whoisdb/', include(whoisdb.urls, namespace='whoisdb')),
23 31
 ]

+ 25
- 0
whoisdb/migrations/0001_initial.py View File

@@ -0,0 +1,25 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.10.5 on 2017-02-13 03:01
3
+from __future__ import unicode_literals
4
+
5
+from django.conf import settings
6
+from django.db import migrations, models
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    initial = True
12
+
13
+    dependencies = [
14
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15
+    ]
16
+
17
+    operations = [
18
+        migrations.CreateModel(
19
+            name='Maintainer',
20
+            fields=[
21
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22
+                ('auth', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
23
+            ],
24
+        ),
25
+    ]

+ 8
- 0
whoisdb/urls.py View File

@@ -0,0 +1,8 @@
1
+from django.conf.urls import url
2
+
3
+from . import views as whoisdb_views
4
+
5
+urlpatterns = [
6
+	#url(r'^$', dncore_views.dashboard, name='dashboard'),
7
+]
8
+

Loading…
Cancel
Save