Skip to content

Commit a2df4b4

Browse files
author
Marc Richter
committed
Adding staticfiles/ to .gitignore
Created Django User Model Register User Model to Django Admin Adding User Model migration
1 parent dfc2293 commit a2df4b4

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,4 @@ dmypy.json
129129
.pyre/
130130
.idea/
131131
db.sqlite3
132+
staticfiles/

bot/admin.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from django.contrib import admin
2+
from .models import User
23

3-
# Register your models here.
4+
admin.site.register(User)

bot/migrations/0001_initial.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 2.1 on 2020-08-09 20:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='User',
16+
fields=[
17+
('user_id', models.IntegerField(primary_key=True, serialize=False, unique=True)),
18+
('first_name', models.CharField(max_length=64)),
19+
('last_name', models.CharField(max_length=64)),
20+
],
21+
),
22+
]

bot/models.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
from django.db import models
22

3-
# Create your models here.
3+
4+
class User(models.Model):
5+
user_id = models.IntegerField(unique=True, primary_key=True)
6+
first_name = models.CharField(max_length=64)
7+
last_name = models.CharField(max_length=64)

dtbot/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'django.contrib.sessions',
4646
'django.contrib.messages',
4747
'django.contrib.staticfiles',
48+
'bot.apps.BotConfig',
4849
]
4950

5051
MIDDLEWARE = [

0 commit comments

Comments
 (0)