diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..a3380696 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/Users/mac/.local/share/virtualenvs/Heroku-Django-fPwoK8g7/bin/python" +} \ No newline at end of file diff --git a/README.md b/README.md index bea20678..434570e1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Trello Link + +https://trello.com/b/6FZkyg66/lambdamud-wonjae-hwang + # Adventure Project Week This week you'll be implementing a frontend interface for a multi-user diff --git a/adv_project/settings.py b/adv_project/settings.py index 054c2b1b..8d92926e 100644 --- a/adv_project/settings.py +++ b/adv_project/settings.py @@ -12,6 +12,7 @@ import os from decouple import config +import dj_database_url # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -26,8 +27,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', cast=bool) -ALLOWED_HOSTS = [] - +ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=lambda v: [s.strip() for s in v.split(',')]) # Application definition @@ -96,6 +96,9 @@ } } +db_from_env = dj_database_url.config(conn_max_age=500) +DATABASES['default'].update(db_from_env) + # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators @@ -148,6 +151,8 @@ # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static') + import django_heroku django_heroku.settings(locals()) diff --git a/adv_project/urls.py b/adv_project/urls.py index 6d94e299..4c4bab49 100644 --- a/adv_project/urls.py +++ b/adv_project/urls.py @@ -6,4 +6,5 @@ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('api/adv/', include('adventure.urls')), + path('api-auth', include('rest_framework.urls')) ] diff --git a/adventure/migrations/0001_initial.py b/adventure/migrations/0001_initial.py new file mode 100644 index 00000000..4745bbdc --- /dev/null +++ b/adventure/migrations/0001_initial.py @@ -0,0 +1,39 @@ +# Generated by Django 2.1.1 on 2018-12-10 20:31 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Player', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('currentRoom', models.IntegerField(default=0)), + ('uuid', models.UUIDField(default=uuid.uuid4, unique=True)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Room', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(default='DEFAULT TITLE', max_length=50)), + ('description', models.CharField(default='DEFAULT DESCRIPTION', max_length=500)), + ('n_to', models.IntegerField(default=0)), + ('s_to', models.IntegerField(default=0)), + ('e_to', models.IntegerField(default=0)), + ('w_to', models.IntegerField(default=0)), + ], + ), + ]