Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-deposit
Commits
385d9814
Verified
Commit
385d9814
authored
7 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
swh.manage: Use production service port in dev mode
Make it overridable
parent
88e9137f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/manage.py
+24
-1
24 additions, 1 deletion
swh/manage.py
with
24 additions
and
1 deletion
swh/manage.py
+
24
−
1
View file @
385d9814
#!/usr/bin/env python3
# Copyright (C) 2017 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
os
import
sys
from
swh.core
import
config
DEFAULT_CONFIG
=
{
'
port
'
:
(
'
int
'
,
5006
),
'
host
'
:
(
'
str
'
,
'
127.0.0.1
'
),
}
if
__name__
==
"
__main__
"
:
# override the default host:port
if
sys
.
argv
[
1
]
==
'
runserver
'
:
conf
=
config
.
load_named_config
(
'
deposit/server
'
,
default_conf
=
DEFAULT_CONFIG
)
extra_cmd
=
[
'
%s:%s
'
%
(
conf
[
'
host
'
],
conf
[
'
port
'
])]
cmd
=
sys
.
argv
+
extra_cmd
else
:
cmd
=
sys
.
argv
os
.
environ
.
setdefault
(
"
DJANGO_SETTINGS_MODULE
"
,
"
swh.deposit.settings.development
"
)
try
:
...
...
@@ -21,4 +44,4 @@ if __name__ == "__main__":
"
forget to activate a virtual environment?
"
)
raise
execute_from_command_line
(
sys
.
argv
)
execute_from_command_line
(
cmd
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment