Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
e3e87393
Commit
e3e87393
authored
Jun 07, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
make usage of settings more modulable
parent
b03b4026
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
e3e87393
# Metagenedb
Django based project to build metagenomics genes catalog and tools
to play with it and contact external services.
\ No newline at end of file
to play with it and contact external services.
## Run the services on your local machine
### First usage
#### Settings for Django server
As you can see, there is not a single
`settings.py`
file for the Django project but instead
several settings files that are located in the
`settings`
directory which is supposed to be a module.
Therefore, you need to add an
`__init__.py`
to this module and specify which settings you want to import.
For instance, if you want to have the development settings, configure the
`__init__.py`
:
```
python
from
.development
import
*
```
This is to allow different settings depending your environment. You can also keep all your credentials
in this
`__init__.py`
file.
\ No newline at end of file
web/metagenedb/settings.py
→
web/metagenedb/settings
/base
.py
View file @
e3e87393
...
...
@@ -43,13 +43,10 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django_extensions'
,
'rest_framework'
,
'corsheaders'
,
]
MIDDLEWARE
=
[
'corsheaders.middleware.CorsMiddleware'
,
'django.middleware.security.SecurityMiddleware'
,
'django.contrib.sessions.middleware.SessionMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
...
...
@@ -143,10 +140,3 @@ USE_TZ = True
STATIC_URL
=
'/static/'
# CORS
CORS_ORIGIN_ALLOW_ALL
=
False
CORS_ORIGIN_WHITELIST
=
(
'http://localhost:8080'
,
)
web/metagenedb/settings/development.py
0 → 100644
View file @
e3e87393
from
.base
import
*
INSTALLED_APPS
=
INSTALLED_APPS
+
[
'django_extensions'
,
'corsheaders'
,
]
MIDDLEWARE
=
MIDDLEWARE
+
[
'corsheaders.middleware.CorsMiddleware'
,
]
# CORS
CORS_ORIGIN_ALLOW_ALL
=
False
CORS_ORIGIN_WHITELIST
=
(
'http://localhost:8080'
,
)
Write
Preview
Supports
Markdown
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