Skip to content

Commit e840ca8

Browse files
committed
Updated backend and frontend. Fixed failing CI tests.
1 parent 137be8f commit e840ca8

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

backend/settings/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
{
5252
"BACKEND": "django.template.backends.django.DjangoTemplates",
5353
"DIRS": [
54-
os.path.join(BASE_DIR, "templates")
54+
os.path.join(BASE_DIR, "templates"),
55+
os.path.join(BASE_DIR, os.pardir, "frontend", "dist"),
5556
],
5657
"APP_DIRS": True,
5758
"OPTIONS": {

backend/settings/devl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
from .common import *
3+
from .common import BASE_DIR, STATICFILES_DIRS
44

55
# SECURITY WARNING: keep the secret key used in production secret!
66
SECRET_KEY = 'django-insecure-dev-key-for-testing-only'
@@ -18,5 +18,7 @@
1818
INTERNAL_IPS = ['192.168.56.1', '127.0.0.1']
1919

2020
STATICFILES_DIRS.append(
21-
os.path.join(BASE_DIR, os.pardir, 'frontend', 'build'),
21+
os.path.join(BASE_DIR, os.pardir, 'frontend', 'dist'),
2222
)
23+
24+
STATIC_ROOT = os.path.join(BASE_DIR, os.pardir, 'staticfiles')

backend/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django.urls import re_path as url
2-
from django.urls import include
1+
from django.urls import path, include, re_path as url
32
from django.contrib.auth.views import LogoutView, LoginView
43
from django.contrib import admin
54
from django.urls import reverse_lazy
5+
from django.views.generic import TemplateView
66

77
from .views import app, index
88

@@ -13,4 +13,5 @@
1313
url('^auth/login/$', LoginView.as_view(template_name='auth/login.html'), name='login'),
1414
url('^auth/logout/$', LogoutView.as_view(next_page=reverse_lazy('login')), name='logout'),
1515
url('^$', index, name='index'),
16+
path('app/', TemplateView.as_view(template_name="index.html"), name="app"),
1617
]

backend/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
def index(request):
1010
if request.user.is_authenticated:
1111
return redirect(reverse("app"))
12-
else:
13-
return redirect(settings.LOGIN_REDIRECT_URL)
12+
return redirect(settings.LOGIN_REDIRECT_URL)
1413

1514

1615
@login_required

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A Django & React Template",
55
"scripts": {
66
"clean": "rimraf dist",
7-
"build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js",
7+
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
88
"build": "npm run clean && npm run build:webpack",
99
"start": "webpack -c --progress -w --config webpack.config.dev.js",
1010
"lint": "eslint src/"
@@ -21,6 +21,7 @@
2121
"babel-preset-react": "^6.5.0",
2222
"babel-preset-stage-0": "^6.5.0",
2323
"bootstrap": "^3.3.6",
24+
"cross-env": "^10.0.0",
2425
"css-loader": "^0.23.1",
2526
"eslint": "^1.10.3",
2627
"eslint-plugin-babel": "^3.1.0",

frontend/src/app/components/higherOrder/hasPermission.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from "react";
2-
31
import EmptyComponent from "app/components/EmptyComponent";
42

53

0 commit comments

Comments
 (0)