Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
osp
tools.ethertoff
Commits
02298a0b
Commit
02298a0b
authored
Jun 02, 2015
by
eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the website to work under a subfolder i.e.
http://relearn.be/2015/
parent
b925c95a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
relearn/local_settings.py.example
relearn/local_settings.py.example
+3
-0
relearn/urls.py
relearn/urls.py
+15
-1
No files found.
relearn/local_settings.py.example
View file @
02298a0b
...
...
@@ -21,3 +21,6 @@ EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
HOME_PAD = 'About.md'
# You can use this if you want to run the project under a subfolder
# SUBFOLDER = '2015'
\ No newline at end of file
relearn/urls.py
View file @
02298a0b
...
...
@@ -9,7 +9,18 @@ from django.conf.urls.static import static
from
django.contrib
import
admin
admin
.
autodiscover
()
urlpatterns
=
patterns
(
# This is to allow the website to work under a subfolder
# i.e. http://relearn.be/2015/
# Define SUBFOLDER in your local_settings.py
BASE_URL
=
'^'
try
:
BASE_URL
=
r
'^'
+
settings
.
SUBFOLDER
if
BASE_URL
and
not
BASE_URL
.
endswith
(
r
'/'
):
BASE_URL
+=
r
'/'
except
AttributeError
:
pass
base_urlpatterns
=
patterns
(
''
,
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r
'^all/$'
,
TemplateView
.
as_view
(
template_name
=
'all.html'
),
name
=
'all'
),
...
...
@@ -29,3 +40,6 @@ urlpatterns = patterns(
url
(
r
'w/(?P<slug>[^/]+)$'
,
'relearn.views.pad'
,
name
=
'pad-write'
),
)
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
urlpatterns
=
patterns
(
''
,
url
(
r
'^'
+
settings
.
SUBFOLDER
+
'/'
,
include
(
base_urlpatterns
)),
)
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