Commit 0468b71e authored by nikkastra's avatar nikkastra

starting point

parent d95f5f5a
# Generated by Django 3.1.7 on 2021-04-07 14:36
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Name',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
]
from django.db import models
# Create your models here.
class Name(models.Model):
name = models.CharField(max_length=100, unique=True)
image = models.ImageField(upload_to=None)
nickname = models.CharField(max_length=50)
bio = models.CharField(max_length=200)
def __str__(self):
return '{} {} {}'.format(self.name, self.nickname, self.bio)
def get_absolute_url(self):
return reverse('string', args=[str(self.name)])
@property
def is_tutorial(self):
return self.units == 1
class Tasks(models.Model):
name = models.ForeignKey(Name, on_delete=models.CASCADE)
key = models.CharField(max_length=2)
task = models.CharField(max_length=100)
\ No newline at end of file
SECRET_KEY = 'x+@o#@l9kc94!9+(c4gy*ma6*^h)5e&l(wz8k9g%8%js^bcd%1'
DB_NAME = labbujo
DB_USER = franz
\ No newline at end of file
......@@ -78,9 +78,8 @@ WSGI_APPLICATION = 'mysite.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mysite',
'USER': 'postgres',
'PASSWORD': 'RawrrXD123',
'NAME': os.getenv("DB_NAME"),
'USER': os.getenv('DB_USER'),
'HOST': 'localhost',
'PORT': '5432',
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment