chartManD commited on
Commit
d26801f
·
1 Parent(s): b4da3a3

Created models

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -0
  2. app/mysite/settings.py +1 -0
  3. app/polls/models.py +10 -1
Dockerfile CHANGED
@@ -22,6 +22,8 @@ WORKDIR itsz
22
  COPY app ./misite
23
  WORKDIR misite
24
 
 
 
25
  RUN touch db.sqlite3
26
  RUN chmod 777 db.sqlite3
27
 
 
22
  COPY app ./misite
23
  WORKDIR misite
24
 
25
+ RUN python3 manage.py migrate
26
+
27
  RUN touch db.sqlite3
28
  RUN chmod 777 db.sqlite3
29
 
app/mysite/settings.py CHANGED
@@ -32,6 +32,7 @@ ALLOWED_HOSTS = ['*']
32
  # Application definition
33
 
34
  INSTALLED_APPS = [
 
35
  'django.contrib.admin',
36
  'django.contrib.auth',
37
  'django.contrib.contenttypes',
 
32
  # Application definition
33
 
34
  INSTALLED_APPS = [
35
+ 'polls.apps.PollsConfig',
36
  'django.contrib.admin',
37
  'django.contrib.auth',
38
  'django.contrib.contenttypes',
app/polls/models.py CHANGED
@@ -1,3 +1,12 @@
1
  from django.db import models
2
 
3
- # Create your models here.
 
 
 
 
 
 
 
 
 
 
1
  from django.db import models
2
 
3
+
4
+ class Question(models.Model):
5
+ question_text = models.CharField(max_length=200)
6
+ pub_date = models.DateTimeField('date published')
7
+
8
+
9
+ class Choice(models.Model):
10
+ question = models.ForeignKey(Question, on_delete=models.CASCADE)
11
+ choice_text = models.CharField(max_length=200)
12
+ votes = models.IntegerField(default=0)