diff --git a/Dockerfile b/Dockerfile index e4a7bd4..98ac202 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app # dependencies for psycopg2-binary RUN apk add --no-cache mariadb-connector-c-dev -RUN apk update && apk add python3 python3-dev mariadb-dev build-base && pip3 install mysqlclient && apk del python3-dev mariadb-dev build-base +RUN apk update && apk add python3 python3-dev mariadb-dev build-base && pip3 install mysqlclient # By copying over requirements first, we make sure that Docker will cache diff --git a/api/admin.py b/api/admin.py index 8c38f3f..846f6b4 100644 --- a/api/admin.py +++ b/api/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/api/models.py b/api/models.py index 71a8362..6b20219 100644 --- a/api/models.py +++ b/api/models.py @@ -1,3 +1 @@ -from django.db import models - # Create your models here. diff --git a/api/tests.py b/api/tests.py index 7ce503c..a39b155 100644 --- a/api/tests.py +++ b/api/tests.py @@ -1,3 +1 @@ -from django.test import TestCase - # Create your tests here. diff --git a/api/views.py b/api/views.py index 91ea44a..60f00ef 100644 --- a/api/views.py +++ b/api/views.py @@ -1,3 +1 @@ -from django.shortcuts import render - # Create your views here. diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 6397978..83abf0c 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -6,9 +6,9 @@ services: build: context: ./ dockerfile: Dockerfile.prod - command: gunicorn django-rest-framework-14th.wsgi:application --bind 0.0.0.0:8000 + command: gunicorn like-that-house-vote.wsgi:application --bind 0.0.0.0:8000 environment: - DJANGO_SETTINGS_MODULE: django-rest-framework-14th.settings.prod + DJANGO_SETTINGS_MODULE: like-that-house-vote.settings.prod env_file: - .env volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 097c40a..a3cd7e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: db: container_name: db - image: mysql:5.7 + image: mariadb:latest restart: always environment: MYSQL_ROOT_HOST: '%' @@ -28,7 +28,7 @@ services: DATABASE_PASSWORD: mysql DATABASE_PORT: 3306 DATABASE_HOST: db - DJANGO_SETTINGS_MODULE: django-rest-framework-14th.settings.dev + DJANGO_SETTINGS_MODULE: like-that-house-vote.settings.dev restart: always ports: - "8000:8000" diff --git a/django-rest-framework-14th/__init__.py b/like-that-house-vote/__init__.py similarity index 100% rename from django-rest-framework-14th/__init__.py rename to like-that-house-vote/__init__.py diff --git a/django-rest-framework-14th/asgi.py b/like-that-house-vote/asgi.py similarity index 67% rename from django-rest-framework-14th/asgi.py rename to like-that-house-vote/asgi.py index bee06c8..8c95685 100644 --- a/django-rest-framework-14th/asgi.py +++ b/like-that-house-vote/asgi.py @@ -1,5 +1,5 @@ """ -ASGI config for django-rest-framework-14th project. +ASGI config for like-that-house-vote project. It exposes the ASGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django-rest-framework-14th.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'like-that-house-vote.settings') application = get_asgi_application() diff --git a/django-rest-framework-14th/settings/__init__.py b/like-that-house-vote/settings/__init__.py similarity index 100% rename from django-rest-framework-14th/settings/__init__.py rename to like-that-house-vote/settings/__init__.py diff --git a/django-rest-framework-14th/settings/base.py b/like-that-house-vote/settings/base.py similarity index 94% rename from django-rest-framework-14th/settings/base.py rename to like-that-house-vote/settings/base.py index b94bb0c..a48c7a0 100644 --- a/django-rest-framework-14th/settings/base.py +++ b/like-that-house-vote/settings/base.py @@ -1,5 +1,5 @@ """ -Django settings for django-rest-framework-14th project. +Django settings for like-that-house-vote project. Generated by 'django-admin startproject' using Django 3.0.8. @@ -53,7 +53,7 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'django-rest-framework-14th.urls' +ROOT_URLCONF = 'like-that-house-vote.urls' TEMPLATES = [ { @@ -71,7 +71,7 @@ }, ] -WSGI_APPLICATION = 'django-rest-framework-14th.wsgi.application' +WSGI_APPLICATION = 'like-that-house-vote.wsgi.application' # Password validation diff --git a/django-rest-framework-14th/settings/dev.py b/like-that-house-vote/settings/dev.py similarity index 88% rename from django-rest-framework-14th/settings/dev.py rename to like-that-house-vote/settings/dev.py index db82b8f..41df478 100644 --- a/django-rest-framework-14th/settings/dev.py +++ b/like-that-house-vote/settings/dev.py @@ -1,4 +1,6 @@ from .base import * # noqa +import pymysql +pymysql.install_as_MySQLdb() DEBUG = True diff --git a/django-rest-framework-14th/settings/prod.py b/like-that-house-vote/settings/prod.py similarity index 100% rename from django-rest-framework-14th/settings/prod.py rename to like-that-house-vote/settings/prod.py diff --git a/django-rest-framework-14th/urls.py b/like-that-house-vote/urls.py similarity index 93% rename from django-rest-framework-14th/urls.py rename to like-that-house-vote/urls.py index 5e39526..b8f5666 100644 --- a/django-rest-framework-14th/urls.py +++ b/like-that-house-vote/urls.py @@ -1,4 +1,4 @@ -"""django-rest-framework-14th URL Configuration +"""like-that-house-vote URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ diff --git a/django-rest-framework-14th/wsgi.py b/like-that-house-vote/wsgi.py similarity index 67% rename from django-rest-framework-14th/wsgi.py rename to like-that-house-vote/wsgi.py index 8a370ca..2b16395 100644 --- a/django-rest-framework-14th/wsgi.py +++ b/like-that-house-vote/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for django-rest-framework-14th project. +WSGI config for like-that-house-vote project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django-rest-framework-14th.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'like-that-house-vote.settings') application = get_wsgi_application() diff --git a/manage.py b/manage.py index 18a596e..de65799 100755 --- a/manage.py +++ b/manage.py @@ -5,7 +5,7 @@ def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django-rest-framework-14th.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'like-that-house-vote.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/requirements.txt b/requirements.txt index 0b99b77..13e43c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,14 @@ asgiref==3.2.10 +backports.entry-points-selectable==1.1.1 +distlib==0.3.3 Django==3.0.8 django-environ==0.4.5 +filelock==3.4.0 gunicorn==20.0.4 +mysqlclient==2.1.0 +platformdirs==2.4.0 +PyMySQL==1.0.2 pytz==2020.1 +six==1.16.0 sqlparse==0.3.1 +virtualenv==20.10.0