Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 97f467b

Browse files
cleanup of readme and updated django-rest-passwordreset url
1 parent 6558e57 commit 97f467b

File tree

10 files changed

+18
-173
lines changed

10 files changed

+18
-173
lines changed

‎README.md‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You shouldn't have to make any other changes to get this up and running, but her
1111

1212
- The default login credentials are admin and admin_password. These can be changed in backend/.env.
1313

14-
- There are 3 .env files provided. Note in particular the .env files in backend/ and postgres/; there, you can adjust the database credentials, debug mode, secret key, allowed hosts, etc. Things should run just fine without any changes, but just know these files are there.
14+
- There are 3 .env files provided. Note in particular the .env files in backend/ and postgres/; there, you can adjust the database credentials, debug mode, secret key, allowed hosts, etc. The app should run just fine without any changes, but just know these files are there.
1515

1616
- The included sample helloyou django app can be easily removed by removing 'helloyou' from INSTALLED_APPS in django mainapp/settings.py, removing the associated helloyou path in mainapp/urls.py and deleting the entire helloyou folder. There are no database migrations, so you don't need to worry about that. On the frontend, delete/replace the contents of Home.tsx.
1717

@@ -20,28 +20,21 @@ You shouldn't have to make any other changes to get this up and running, but her
2020

2121
**_NOTE: If you change your database name/credentials, but have already run the steps below, you may need to delete the associated postgres docker image in order to get things to work._**
2222

23-
For development mode without NGINX server, run the following command:
23+
For development mode without NGINX server (recommended for development), run the following command:
2424

2525
```sh
2626
docker-compose -f "docker-compose.dev.yml" up -d --build
2727
```
2828
The react frontend should be available at `http://localhost:3000/` and django backend at `http://localhost:8000/` (django admin at `http://localhost:8000/admin/`). This mode supports both react hot reloading and django auto-refresh with changes.
2929

30-
For development with the NGINX server run:
31-
```sh
32-
docker-compose -f "docker-compose.yml" up -d --build
33-
```
34-
The server should be available at `http://127.0.0.1/`. This mode will not hot reload since it's running a production build (npm build).
35-
36-
3730
## Features
3831
### Forgot Password:
39-
- The password reset feature is fully functional. In order to get the password reset url, you will need to open the backend django console. Enter the following in an application like PowerShell:
32+
- The password reset feature is fully functional. In order to get the password reset url, you will need to open the backend django logs. For example (in Powershell):
4033
```sh
41-
$id = $(docker ps -aqf "name=django-react-postgres-boilerplate_backend")
34+
$id = $(docker ps -aqf "name=backend")
4235
docker logs --tail 1000 -f $id
4336
```
44-
- Upon submitting a valid email, you should get a path like `http://localhost:3000/password_reset?token=abcdefgxyz123`; paste this in your browser to access the password reset form. The password reset form first validates the token; if the token is valid, it presents the password reset interface and allows the user to provide a new password. If the token is invalid, it will redirect the user to the login page.
37+
- Upon submitting a valid email (default is ), you should get a path like `http://localhost:3000/password_reset?token=abcdefgxyz123`; paste this in your browser to access the password reset form. The password reset form first validates the token; if the token is valid, it presents the password reset interface and allows the user to provide a new password. If the token is invalid, it will redirect the user to the login page.
4538

4639
Check out the Django docs starting [here](https://docs.djangoproject.com/en/3.1/topics/email/#smtp-backend) in order to update the Email Backend from a console output to an actual SMTP backend.
4740

@@ -53,7 +46,8 @@ The server should be available at `http://127.0.0.1/`. This mode will not hot re
5346

5447
### Alerts:
5548
- An alert setter at the context level is also included. An example of TriggerAlert is shown in Home.tsx (variants displayed after successful/failed submit). See AlertContext.tsx for typings.
56-
-
49+
50+
5751
### Modal/Dialog:
5852
- Similar to the alert setter, a context level modal/dialog is also provided. Use OpenDialog (basic example shown in Home.tsx) to open and set the modal title/contents/footer.
5953

@@ -79,10 +73,10 @@ The server should be available at `http://127.0.0.1/`. This mode will not hot re
7973
- [x] Add support for nested sub-routes off the main left-nav routes
8074
- [x] Ensure match params (i.e. /user/profile/1/) work correctly.
8175
- [x] Context level modal?
76+
- [x] Auto redirect to login with Failed Request
8277
- [ ] Reset session timeout with activity.
8378
- [ ] Swagger API Explorer
8479
- [ ] Backend Testing
8580
- [ ] Frontend Testing (React Testing Library)
86-
- [ ] Auto redirect to login with Failed Request
8781
- [ ] Axios Interface for demo API
8882
- [ ] Update and Pin versions (remove anything unused)

‎backend/mainapp/settings.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@
8686
# Database
8787
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
8888

89-
DATABASES = {
90-
'default': {
91-
'ENGINE': 'django.db.backends.sqlite3',
92-
'NAME': BASE_DIR / 'db.sqlite3',
93-
}
94-
}
95-
96-
9789
# Password validation
9890
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
9991

‎docker-compose.dev.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "3.7"
22

33
services:
44
backend:
5+
container_name: backend
56
build: ./backend
67
volumes:
78
- ./backend:/app/backend
@@ -11,18 +12,18 @@ services:
1112
- ./backend/.env
1213
stdin_open: true
1314
tty: true
14-
env_file:
15-
- ./backend/.env
1615
command: python manage.py runserver 0.0.0.0:8000
1716
depends_on:
1817
- db
1918
db:
19+
container_name: database
2020
image: postgres:12.0-alpine
2121
volumes:
2222
- postgres_data:/var/lib/postgresql/data/
2323
env_file:
2424
- ./postgres/.env
2525
frontend:
26+
container_name: frontend
2627
build:
2728
context: ./frontend
2829
dockerfile: Dockerfile.local

‎docker-compose.yml‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎frontend/src/App.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { Login } from './components/Login/Login';
1414
import { appArray } from "./routes/Routes";
1515
import PrivateRoute from "./routes/PrivateRoute";
1616
import Layout from "./components/Layout/Layout";
17-
import Footer from "./components/Layout/Footer";
1817
import { theme } from "./Theme";
1918
import { DialogContext } from "./contexts/DialogContext";
2019
import { Alert } from "@material-ui/lab";
@@ -88,14 +87,13 @@ export function App() {
8887
</div>
8988
</div>
9089
</Layout>
91-
<Footer />
9290
</ThemeProvider>
9391
)
9492
}
9593

9694
export function MainPage() {
9795
return (
98-
//@ts-ignore - TODO: NEED TO FIGURE OUT TS ERROR HERE
96+
//@ts-ignore - TODO: NEED TO ADDRESS TS ERROR HERE
9997
<Router>
10098
<App />
10199
</Router>

‎frontend/src/components/Layout/Footer.tsx‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎frontend/src/components/Login/ForgotPassword.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const ForgotPassword = () => {
1313
const submitEmail = (e: React.FormEvent<HTMLFormElement>) => {
1414
e.preventDefault();
1515
if (emailInput.current !== null) {
16-
axios.post(`/api/password_reset/reset_password/`, { email: emailInput.current.value })
16+
axios.post(`/api/password_reset/`, { email: emailInput.current.value })
1717
.then((response: any) => {
1818
setSubmitted(true)
1919
if (response.status === 200) {

‎frontend/src/components/Login/Login.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function Login(props: RouteComponentProps<{}, any, { from: string }>) {
8585
<div style={{ paddingTop: '10vh' }}>
8686
<motion.div initial={{ opacity: 0 }} animate={logoAnimation} style={{ width: "100%", textAlign: "center" }}>
8787
<img height="auto" width="10%" src={genericLogo} alt="Image not Found" onLoad={() => setImageStatus("ready")} onError={() => setImageStatus("ready")} />
88-
<h1>{APP_NAME}</h1>
88+
<Typographyvariant='h4'color='textSecondary'>{APP_NAME}</Typography>
8989
</motion.div>
9090
<motion.div initial={{ opacity: 0 }} animate={formAnimation}>
9191
<Container component="main" maxWidth="xs">
@@ -133,15 +133,18 @@ export function Login(props: RouteComponentProps<{}, any, { from: string }>) {
133133
color="primary"
134134
className={classes.submit}
135135
>
136+
<Typography variant='subtitle2'>
136137
Sign In
138+
</Typography>
139+
137140
</Button>
138141
</form>
139142
}
140143
<Grid container justify="center">
141144
<Grid item xs={12}>
142145
<Grid container justify="center">
143146
<Link onClick={() => setPasswordReset(!passwordReset)} style={{ cursor: "pointer" }}>
144-
{passwordReset ? 'Back to Login' : 'Forgot password?'}
147+
<Typography>{passwordReset ? 'Back to Login' : 'Forgot password?'}</Typography>
145148
</Link>
146149
</Grid>
147150
</Grid>

‎nginx/Dockerfile‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎nginx/nginx.conf‎

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /