Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
deb24f73
Commit
deb24f73
authored
May 18, 2017
by
okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defining ALLOWED_HOSTS to '*' for DEBUG. /spend 10min
#19
parent
0adbd12c
Pipeline
#1051
failed with stages
in 1 minute and 27 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
.gitlab-ci.yml
.gitlab-ci.yml
+0
-1
README.md
README.md
+6
-0
project/settings/__init__.py
project/settings/__init__.py
+1
-0
project/settings/hosts.py
project/settings/hosts.py
+14
-0
No files found.
.gitlab-ci.yml
View file @
deb24f73
...
...
@@ -62,7 +62,6 @@ deploy preprod:
-
pip install --upgrade -r requirements-dev.txt
-
echo "DEBUG = True" > ${BASE_PATH}/project/settings/env.py
-
echo "SECRET_KEY = '$(pwgen 20 1)'" >> ${BASE_PATH}/project/settings/env.py
-
echo "ALLOWED_HOSTS.append('\'*\'')" >> ${BASE_PATH}/project/settings/env.py
-
${BASE_PATH}/manage.py migrate
-
touch ${BASE_PATH}/ready
only
:
...
...
README.md
View file @
deb24f73
...
...
@@ -34,6 +34,12 @@ os.environ["DJANGO_DEBUG"]
os
.
environ
[
"DJANGO_SECRET_KEY"
]
```
You'll also need to define a DJANGO_ALLOWED_HOSTS containing
the FQDN of the RP before being able to run in production
If DEBUG is defined as True, ALLOWED_HOSTS is set to allow connections
from any hosts.
## Database
You can run migrations with :
...
...
project/settings/__init__.py
View file @
deb24f73
...
...
@@ -9,3 +9,4 @@ from .auth import * # noqa
from
.api
import
*
# noqa
from
.static
import
*
# noqa
from
.i18n
import
*
# noqa
from
.hosts
import
*
# noqa
project/settings/hosts.py
0 → 100644
View file @
deb24f73
"""
We need to define ALLOWED_HOSTS in case of debug of if we're
locally running. If we have an env variable DJANGO_ALLOWED_HOSTS
defined, we can use it to.
"""
import
os
from
.env
import
DEBUG
if
DEBUG
:
ALLOWED_HOSTS
=
[
'*'
]
else
:
ALLOWED_HOSTS
=
[
os
.
environ
[
'DJANGO_ALLOWED_HOSTS'
]]
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