Skip to content

Commit 20e3347

Browse files
committed
Ready for production - V1
1 parent f254ea9 commit 20e3347

11 files changed

+60
-7
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
.env
2-
local_settings
1+
.env

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn studybud.wsgi
31 Bytes
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.0.2 on 2022-03-01 14:36
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('base', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='user',
15+
name='email',
16+
field=models.EmailField(max_length=254, null=True),
17+
),
18+
migrations.AlterField(
19+
model_name='user',
20+
name='username',
21+
field=models.CharField(max_length=200, null=True, unique=True),
22+
),
23+
]

base/models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
# Create your models here.
66

77
class User(AbstractUser):
8+
username = models.CharField(unique=True, max_length=200, null=True)
89
name = models.CharField(max_length=200, null=True)
9-
email = models.EmailField(unique=True, null=True)
10+
email = models.EmailField(null=True)
1011
bio = models.TextField(null=True)
1112

1213
avatar = models.ImageField(null=True, default="avatar.svg")
1314

14-
USERNAME_FIELD = 'email'
15-
REQUIRED_FIELDS = []
15+
USERNAME_FIELD = 'username'
16+
REQUIRED_FIELDS = ['email']
1617

1718
class Topic(models.Model):
1819
name = models.CharField(max_length=200)

db.sqlite3

8 KB
Binary file not shown.

requirements.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
asgiref==3.5.0
2+
dj-database-url==0.5.0
3+
Django==4.0.2
4+
django-cors-headers==3.11.0
5+
django-filter==21.1
6+
django-heroku==0.3.1
7+
djangorestframework==3.13.1
8+
gunicorn==20.1.0
9+
Markdown==3.3.6
10+
Pillow==9.0.1
11+
psycopg2==2.9.3
12+
python-decouple==3.6
13+
python-dotenv==0.19.2
14+
pytz==2021.3
15+
sqlparse==0.4.2
16+
tzdata==2021.5
17+
whitenoise==6.0.0
288 Bytes
Binary file not shown.

studybud/local_settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
For the full list of settings and their values, see
1010
https://docs.djangoproject.com/en/4.0/ref/settings/
1111
"""
12+
#To run local server
13+
# python manage.py runserver --settings=studybud.local_settings
1214

1315
from pathlib import Path
1416
import os

0 commit comments

Comments
 (0)