Skip to content

Commit 329df5f

Browse files
authored
Remove static/ directory and update frontend deployment docs (#718)
Followup on commit 2991254 which removed the management commands necessary for serving the frontend via Django. The supported workflow is now to deploy the frontend separately and configure it to talk to this Django app. If desired, both can be served by an Nginx proxy (which serves static files for the frontend and proxies /api requests to Django).
1 parent cba2872 commit 329df5f

File tree

11 files changed

+22
-37
lines changed

11 files changed

+22
-37
lines changed

README.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,10 @@ How to login using the OAuth api
139139
Frontend
140140
^^^^^^^^
141141

142-
`osmcha-frontend <https://github.com/osmcha/osmcha-frontend>`_ is a web interface
143-
that you can use to interact with the API. We have a django management command
144-
to get the last version of osmcha-frontend and serve it with the API.
145-
146-
$ python manage.py update_frontend
147-
148-
After that, if you have set all the environment variables properly, you can start
149-
the server and have the frontend in your root url.
142+
`osmcha-frontend <https://github.com/osmcha/osmcha-frontend>`_ is a web
143+
interface that you can use to interact with the API. The web interface can be
144+
deployed separately and configured to talk to this Django app when making API
145+
requests. See the README in that repository for more details.
150146

151147
Feature creation endpoint
152148
^^^^^^^^^^^^^^^^^^^^^^^^^

config/settings/common.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# APP CONFIGURATION
3636
# ------------------------------------------------------------------------------
37-
DJANGO_APPS = (
37+
DJANGO_APPS = [
3838
# Default Django apps:
3939
'django.contrib.auth',
4040
'django.contrib.contenttypes',
@@ -49,24 +49,25 @@
4949

5050
# Admin
5151
'django.contrib.admin',
52-
)
53-
THIRD_PARTY_APPS = (
52+
]
53+
54+
THIRD_PARTY_APPS = [
5455
'rest_framework',
5556
'rest_framework_gis',
5657
'rest_framework.authtoken',
5758
'social_django',
5859
'corsheaders',
5960
'django_filters',
6061
'drf_yasg',
61-
)
62+
]
6263

6364
# Apps specific for this project go here.
64-
LOCAL_APPS = (
65+
LOCAL_APPS = [
6566
'osmchadjango.users', # custom users app
6667
'osmchadjango.changeset',
6768
'osmchadjango.supervise',
6869
'osmchadjango.roulette_integration',
69-
)
70+
]
7071

7172
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
7273
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
@@ -100,9 +101,9 @@
100101
# FIXTURE CONFIGURATION
101102
# ------------------------------------------------------------------------------
102103
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
103-
FIXTURE_DIRS = (
104+
FIXTURE_DIRS = [
104105
str(APPS_DIR.path('fixtures')),
105-
)
106+
]
106107

107108
# EMAIL CONFIGURATION
108109
# ------------------------------------------------------------------------------
@@ -111,9 +112,9 @@
111112
# MANAGER CONFIGURATION
112113
# ------------------------------------------------------------------------------
113114
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
114-
ADMINS = (
115+
ADMINS = [
115116
('name', 'email@email.com'),
116-
)
117+
]
117118

118119
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
119120
MANAGERS = ADMINS
@@ -209,15 +210,13 @@
209210
STATIC_URL = '/static/'
210211

211212
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
212-
STATICFILES_DIRS = (
213-
str(APPS_DIR.path('static')),
214-
)
213+
STATICFILES_DIRS = []
215214

216215
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
217-
STATICFILES_FINDERS = (
216+
STATICFILES_FINDERS = [
218217
'django.contrib.staticfiles.finders.FileSystemFinder',
219218
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
220-
)
219+
]
221220

222221
# MEDIA CONFIGURATION
223222
# ------------------------------------------------------------------------------
@@ -257,12 +256,12 @@
257256

258257
# AUTHENTICATION CONFIGURATION
259258
# ------------------------------------------------------------------------------
260-
AUTHENTICATION_BACKENDS = (
259+
AUTHENTICATION_BACKENDS = [
261260
"social_core.backends.openstreetmap_oauth2.OpenStreetMapOAuth2",
262261
"django.contrib.auth.backends.ModelBackend",
263-
)
262+
]
264263

265-
SOCIAL_AUTH_PIPELINE = (
264+
SOCIAL_AUTH_PIPELINE = [
266265
'social_core.pipeline.social_auth.social_details',
267266
'social_core.pipeline.social_auth.social_uid',
268267
'social_core.pipeline.social_auth.auth_allowed',
@@ -274,7 +273,7 @@
274273
'social_core.pipeline.social_auth.load_extra_data',
275274
'social_core.pipeline.user.user_details'
276275
# 'social_core.pipeline.social_auth.associate_by_email',
277-
)
276+
]
278277

279278
# LOGGING CONFIGURATION
280279
# ------------------------------------------------------------------------------

osmchadjango/static/css/.gitkeep

Whitespace-only changes.

osmchadjango/static/css/main.6bb33d35.css

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

osmchadjango/static/fonts/.gitkeep

Whitespace-only changes.

osmchadjango/static/images/.gitkeep

Whitespace-only changes.
-8.15 KB
Binary file not shown.
-26.6 KB
Binary file not shown.

osmchadjango/static/js/.gitkeep

Whitespace-only changes.

osmchadjango/static/js/main.1cb188b8.js

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

0 commit comments

Comments
 (0)