diff --git a/.gitignore b/.gitignore index 03f68be4d..d9c46cded 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /venv /.venv /.env +/*/.env /.DS_Store __pycache__/ /FrontEnd/node_modules diff --git a/FrontEnd/package-lock.json b/FrontEnd/package-lock.json index 783f784a8..c854d9348 100644 --- a/FrontEnd/package-lock.json +++ b/FrontEnd/package-lock.json @@ -25,6 +25,9 @@ "swr": "^2.2.2", "validator": "^13.11.0", "web-vitals": "^2.1.4" + }, + "devDependencies": { + "dotenv": "^16.3.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -7309,11 +7312,15 @@ } }, "node_modules/dotenv": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "dev": true, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, "node_modules/dotenv-expand": { @@ -14780,6 +14787,14 @@ } } }, + "node_modules/react-scripts/node_modules/dotenv": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", + "engines": { + "node": ">=10" + } + }, "node_modules/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", diff --git a/FrontEnd/package.json b/FrontEnd/package.json index 1f2d344cc..99b235d83 100644 --- a/FrontEnd/package.json +++ b/FrontEnd/package.json @@ -44,5 +44,8 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "devDependencies": { + "dotenv": "^16.3.1" } } diff --git a/FrontEnd/sample.env b/FrontEnd/sample.env new file mode 100644 index 000000000..445288342 --- /dev/null +++ b/FrontEnd/sample.env @@ -0,0 +1 @@ +REACT_APP_API_URL= \ No newline at end of file diff --git a/FrontEnd/src/App.js b/FrontEnd/src/App.js index b71e2d975..f7b3325c1 100644 --- a/FrontEnd/src/App.js +++ b/FrontEnd/src/App.js @@ -1,9 +1,8 @@ import React from 'react'; import './App.css'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; -import AdminPage from "./components/adminPage/AdminPage"; -import BasicPage from "./components/basicPage/BasicPage"; - +import AdminPage from './components/adminPage/AdminPage'; +import BasicPage from './components/basicPage/BasicPage'; function App() { return ( diff --git a/forum/settings.py b/forum/settings.py index 7746844cf..6f6df534c 100644 --- a/forum/settings.py +++ b/forum/settings.py @@ -65,13 +65,14 @@ CORS_ALLOW_ALL_ORIGINS = False CORS_ORIGIN_WHITELIST = [ - 'http://localhost:3000', + 'http://localhost', 'http://127.0.0.1', 'http://0.0.0.0', + config('CORS_ORIGIN_WHITELIST'), ] CORS_ALLOWED_ORIGINS = [ - 'http://localhost:3000', + 'http://localhost', 'http://127.0.0.1', 'http://0.0.0.0', ] diff --git a/sample.env b/sample.env index 711ec69b4..d77d7aa2e 100644 --- a/sample.env +++ b/sample.env @@ -1,3 +1,4 @@ +#db details SECRET_KEY= PG_DB= PG_USER= @@ -5,9 +6,13 @@ PG_PASSWORD= DB_HOST= DB_PORT= +#SMTP EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend EMAIL_HOST= EMAIL_PORT= EMAIL_USE_TLS= EMAIL_HOST_USER= EMAIL_HOST_PASSWORD= + +#origin hostnames allowed to make cross-site HTTP requests +CORS_ORIGIN_WHITELIST=