Commit 85721097 authored by Daniel STAN's avatar Daniel STAN

Merge manuel de local

parent 0e057315
......@@ -5,30 +5,27 @@
import sys
sys.path.append("/etc/crans/secrets")
DEBUG = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
EMAIL_SUBJECT_PREFIX = "[Intranet2 Cr@ns] "
ADMINS = (
('Intranet', 'root@crans.org'),
# ('Your Name', 'your_email@domain.com'),
'Intranet', 'root@crans.org',
)
MANAGERS = ADMINS
DB_PATH = '/localhome/django/local_db/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django',
'HOST': 'pgsql.adm.crans.org',
'USER': 'crans',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': DB_PATH + 'default',
},
'switchs': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'switchs',
'HOST': 'pgsql.adm.crans.org',
'USER': 'crans',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': DB_PATH + 'switchs',
},
}
......@@ -55,12 +52,12 @@ USE_I18N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/usr/local/django/intranet/'
MEDIA_ROOT = '/localhome/django/intranet/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = 'https://intranet2.crans.org/'
MEDIA_URL = 'http://127.0.0.1:8000/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
......@@ -68,7 +65,10 @@ MEDIA_URL = 'https://intranet2.crans.org/'
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
from secrets import django_secret_key as SECRET_KEY
if DEBUG:
SECRET_KEY = "sYjlDBZUBSMnk"
else: # Ne marchera que sur o2
from secrets import django_secret_key as SECRET_KEY
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
......
-----BEGIN CERTIFICATE-----
MIIDkDCC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,8 +20,8 @@ NAME=gunicorn_django
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/gunicorn-intranet.pid
SOCKET=unix:/tmp/gunicorn-intranet.sock
SETTINGS="/usr/local/django/intranet/settings.py"
DAEMON_ARGS="--workers=2 --pid=$PIDFILE --daemon --user=www-data --group=www-data --name=$NAME --bind=$SOCKET $SETTINGS"
SETTINGS="/localhome/django/intranet/settings.py"
DAEMON_ARGS="--workers=1 --pid=$PIDFILE --daemon --user=www-data --group=www-data --name=$NAME --bind=$SOCKET $SETTINGS"
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
......
......@@ -6,7 +6,7 @@ server {
listen 80;
server_name intranet2.crans.org;
rewrite ^/(.*) https://$server_name/$1 permanent;
rewrite ^/(.*) http://127.0.0.1:8000/$1 permanent;
}
server {
......@@ -18,17 +18,28 @@ server {
server {
listen 443;
server_name intranet-dev.crans.org;
ssl on;
ssl_certificate /localhome/django/intranet/utils/autosign/intranet-dev.crt;
ssl_certificate_key /localhome/django/intranet/utils/autosign/intranet-dev.key;
ssl_certificate /etc/ssl/certs/intranet_server.pem;
ssl_certificate_key /etc/ssl/private/intranet_privatekey.pem;
rewrite ^/(.*) http://127.0.0.1:8000/$1 permanent;
}
server {
listen 8000;
server_name 127.0.0.1;
# En attente de les retrouver :'(
# ssl_certificate /etc/ssl/vo_server.pem;
# ssl_certificate_key /etc/ssl/certs/vo_privatekey.pem;
keepalive_timeout 70;
access_log /var/log/nginx/intranet.log;
access_log /localhome/django/intranet.log;
location / {
root /usr/local/django/intranet/;
root /localhome/django/intranet/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
......@@ -37,7 +48,7 @@ server {
}
location /static {
alias /usr/local/django/intranet/static;
alias /localhome/django/intranet/static;
}
location /media {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment