Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
BDE
nk20
Commits
59f5f7d1
Commit
59f5f7d1
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.crans.org:bde/nk20
parents
0296686e
b44e930c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7684
failed with stage
in 2 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+65
-1
65 additions, 1 deletion
README.md
with
65 additions
and
1 deletion
README.md
+
65
−
1
View file @
59f5f7d1
...
...
@@ -48,7 +48,71 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n
5.
Base de données
Pour le moment c'est du sqllite, pas de config particulière.
En prod on utilise postgresql.
$ sudo apt-get install postgresql postgresql-contrib libpq-dev
(env)$ pip install psycopg2
La config de la base de donnée se fait comme suit:
a. On se connecte au shell de psql
$ sudo su - postgres
$ psql
b. On sécurise l'utilisateur postgres
postgres=# \password
Enter new password:
Conservez ce mot de passe de la meme manière que tous les autres.
c. On créer la basse de donnée, et l'utilisateur associé
postgres=# CREATE USER note WITH PASSWORD 'un_mot_de_passe_sur';
CREATE ROLE
postgres=# CREATE DATABASE note_db OWNER note;
CREATE DATABASE
Si tout va bien:
postgres=#\list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
note_db | note | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 |
postgres | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 |
template0 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres+postgres=CTc/postgres
template1 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres +postgres=CTc/postgres
(4 rows)
NB: cette config est en adéquation avec
`note_kfet/settings/production.py`
. penser à changer le mots de passe dans
`note_kfet/settings/secrets.py`
6.
Variable d'environnement et Migrations
on modifie le fichier d'environnement:
```
# env/bin/activate:
deactivate () {
...
# Unset local environment variables
unset DJANGO_APP_STAGE
}
...
#at end of the file:
export DJANGO_APP_STAGE="prod"
```
Ensuite on bascule dans l'environement virtuel et on lance les migrations
$ source /env/bin/activate
(env)$ ./manage.py makemigrations
(env)$ ./manage.py migrate
7.
Enjoy
## Installer en local
...
...
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