diff --git a/backend/settings/base.py b/backend/settings/base.py index f9d57fb..86c6350 100644 --- a/backend/settings/base.py +++ b/backend/settings/base.py @@ -54,11 +54,13 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'rest_framework', 'silk', + 'corsheaders', 'scraper.apps.ScraperConfig', 'apiv1.apps.Apiv1Config', ] MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', diff --git a/backend/settings/dev.py b/backend/settings/dev.py index a96496a..e58f186 100644 --- a/backend/settings/dev.py +++ b/backend/settings/dev.py @@ -4,3 +4,9 @@ DEBUG = True ALLOWED_HOSTS += ['localhost'] +CORS_ORIGIN_WHITELIST = [ + 'localhost:3000', + 'localhost:8000', + '127.0.0.1', +] + diff --git a/backend/settings/production.py b/backend/settings/production.py index 20db018..62905c7 100644 --- a/backend/settings/production.py +++ b/backend/settings/production.py @@ -1,3 +1,7 @@ from .base import * -ALLOWED_HOSTS += ['fediverse.space'] \ No newline at end of file +ALLOWED_HOSTS += ['fediverse.space'] + +CORS_ORIGIN_WHITELIST = [ + 'fediverse.space', +] diff --git a/frontend/package.json b/frontend/package.json index 4be6db8..af80a9f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,12 +6,14 @@ "@blueprintjs/core": "^3.4.0", "@blueprintjs/icons": "^3.1.0", "@blueprintjs/select": "^3.1.0", + "classnames": "^2.2.6", "cross-fetch": "^2.2.2", "normalize.css": "^8.0.0", "react": "^16.4.2", "react-dom": "^16.4.2", "react-redux": "^5.0.7", "react-scripts-ts": "2.17.0", + "react-virtualized": "^9.20.1", "redux": "^4.0.0", "redux-thunk": "^2.3.0" }, @@ -22,11 +24,13 @@ "eject": "react-scripts-ts eject" }, "devDependencies": { + "@types/classnames": "^2.2.6", "@types/jest": "^23.3.1", "@types/node": "^10.9.2", "@types/react": "^16.4.12", "@types/react-dom": "^16.0.7", "@types/react-redux": "^6.0.6", + "@types/react-virtualized": "^9.18.7", "typescript": "^3.0.1" } } diff --git a/frontend/public/index.html b/frontend/public/index.html index ed0ebaf..2dbd680 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -19,7 +19,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - React App + fediverse.space