Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Rex Dri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rex Dri
Rex Dri
Commits
bfb81152
Commit
bfb81152
authored
Feb 26, 2019
by
Florent Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes
#63
Should fix bug regarding lack of static files
parent
7266140c
Pipeline
#35519
passed with stages
in 3 minutes and 39 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
25 deletions
+52
-25
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
Makefile
Makefile
+1
-1
backend/base_app/settings.py
backend/base_app/settings.py
+4
-3
backend/base_app/static/base_app
backend/base_app/static/base_app
+0
-0
backend/base_app/templates/index.html
backend/base_app/templates/index.html
+27
-0
backend/base_app/urls.py
backend/base_app/urls.py
+4
-2
backend/base_app/views.py
backend/base_app/views.py
+15
-3
backend/frontend_app/__init__.py
backend/frontend_app/__init__.py
+0
-0
backend/frontend_app/apps.py
backend/frontend_app/apps.py
+0
-5
backend/frontend_app/urls.py
backend/frontend_app/urls.py
+0
-5
backend/frontend_app/views.py
backend/frontend_app/views.py
+0
-5
No files found.
.gitlab-ci.yml
View file @
bfb81152
...
...
@@ -52,7 +52,7 @@ test_back:
-
postgres:10.5
script
:
-
cd backend
-
pytest base_app/
frontend_app/
backend_app/ --cov-report html
-
pytest base_app/ backend_app/ --cov-report html
artifacts
:
paths
:
-
backend/htmlcov/
...
...
Makefile
View file @
bfb81152
...
...
@@ -13,7 +13,7 @@ reformat_backend:
docker-compose
exec
backend sh
-c
"cd backend && black ."
test_backend
:
docker-compose
exec
backend sh
-c
"cd backend && pytest base_app/
frontend_app/
backend_app/"
docker-compose
exec
backend sh
-c
"cd backend && pytest base_app/ backend_app/"
check_backend
:
docker-compose
exec
backend sh
-c
"cd backend && ./manage.py check"
...
...
backend/base_app/settings.py
View file @
bfb81152
...
...
@@ -13,6 +13,7 @@ from os.path import dirname
import
sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Is the root of the REPOSITORY
BASE_DIR
=
dirname
(
dirname
(
dirname
(
os
.
path
.
abspath
(
__file__
))))
SECRET_KEY
=
os
.
environ
[
"SECRET_KEY"
]
...
...
@@ -31,7 +32,7 @@ INSTALLED_APPS = [
"rest_framework"
,
"rest_framework.authtoken"
,
"backend_app"
,
"
frontend
_app"
,
"
base
_app"
,
"webpack_loader"
,
]
...
...
@@ -61,14 +62,14 @@ else:
# Webpack loader related
WEBPACK_LOADER
=
{
"DEFAULT"
:
{
"BUNDLE_DIR_NAME"
:
"
frontend
_app/bundles/"
,
"BUNDLE_DIR_NAME"
:
"
base
_app/bundles/"
,
"STATS_FILE"
:
os
.
path
.
join
(
BASE_DIR
,
"frontend/webpack-stats.json"
),
}
}
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
"backend/
static/frontend_app/bundles/
"
BASE_DIR
,
"backend/
base_app/static/base_app
"
),
# We do this so that django's collectstatic copies or our bundles to the STATIC_ROOT or syncs them to whatever storage we use.
)
# End of webpack loader related
...
...
backend/
frontend_app/static/frontend
_app
→
backend/
base_app/static/base
_app
View file @
bfb81152
File moved
backend/
frontend_app/templates/frontend_app
/index.html
→
backend/
base_app/templates
/index.html
View file @
bfb81152
...
...
@@ -18,13 +18,8 @@
</body>
{% load static %}
<!-- <script src="{% static '/frontend_app/react-dist/react.production.min.js' %}"></script> -->
<link
rel=
"stylesheet"
href=
"{% static '/frontend_app/leaflet-dist/leaflet.css' %}"
/>
<link
rel=
"stylesheet"
href=
"{% static '/frontend_app/custom_leaflet.css' %}"
/>
<!-- <link rel="stylesheet" href="{% static '/frontend_app/main.css' %}"/> -->
<!-- <script src="{% static '/frontend_app/leaflet-dist/leaflet.js' %}"></script> -->
<!-- <script src="{% static '/frontend_app/react-leaflet-dist/react-leaflet.js' %}"></script> -->
<!-- <script src="{% static '/frontend_app/main.js' %}"></script> -->
<link
rel=
"stylesheet"
href=
"{% static '/base_app/leaflet-dist/leaflet.css' %}"
/>
<link
rel=
"stylesheet"
href=
"{% static '/base_app/custom_leaflet.css' %}"
/>
{% render_bundle 'main' %}
{% render_bundle 'vendor' %}
...
...
backend/base_app/urls.py
View file @
bfb81152
from
django.conf
import
settings
from
django.conf.urls.static
import
static
from
django.conf.urls
import
include
,
url
from
django.conf.urls.static
import
static
from
django.contrib
import
admin
from
django.views.generic.base
import
RedirectView
import
django_cas_ng.views
from
.
import
views
if
settings
.
DEBUG
:
...
...
@@ -26,7 +28,7 @@ urlpatterns += [
django_cas_ng
.
views
.
CallbackView
.
as_view
(),
name
=
"cas_ng_proxy_callback"
,
),
url
(
r"^app/.*"
,
include
(
"frontend_app.urls"
)
),
url
(
r"^app/.*"
,
views
.
index
),
url
(
r"^$"
,
RedirectView
.
as_view
(
url
=
"./app/"
),
name
=
"go to real home"
),
url
(
r""
,
include
(
"backend_app.urls"
)),
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
backend/base_app/views.py
View file @
bfb81152
import
json
import
re
from
django.contrib.auth.models
import
Group
from
backend_app.utils
import
is_member
from
django.http
import
HttpResponse
import
re
import
json
from
django.shortcuts
import
render
from
backend_app.utils
import
is_member
def
role_change
(
request
):
...
...
@@ -26,3 +29,12 @@ def role_change(request):
role
=
"moderator"
return
HttpResponse
(
json
.
dumps
({
"role_actuel"
:
role
}))
def
index
(
request
):
"""
View to to display the index app that contains the JS / CSS
The "template" displayed is in ./templates/index.html
"""
return
render
(
request
,
"index.html"
)
backend/frontend_app/__init__.py
deleted
100644 → 0
View file @
7266140c
backend/frontend_app/apps.py
deleted
100644 → 0
View file @
7266140c
from
django.apps
import
AppConfig
class
FrontendConfig
(
AppConfig
):
name
=
"frontend"
backend/frontend_app/urls.py
deleted
100644 → 0
View file @
7266140c
from
django.urls
import
path
from
.
import
views
urlpatterns
=
[
path
(
""
,
views
.
index
)]
backend/frontend_app/views.py
deleted
100644 → 0
View file @
7266140c
from
django.shortcuts
import
render
def
index
(
request
):
return
render
(
request
,
"frontend_app/index.html"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment