Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
memopol
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneur
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
jaster
memopol
Validations
e5a01f08
Valider
e5a01f08
rédigé
il y a 8 ans
par
Nicolas Joyard
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Update quickstart script & docs for PG usage
parent
677b112a
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Étiquettes contenant la validation
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
bin/quickstart.sh
+9
-0
9 ajouts, 0 suppression
bin/quickstart.sh
docs/development.rst
+38
-26
38 ajouts, 26 suppressions
docs/development.rst
avec
47 ajouts
et
26 suppressions
bin/quickstart.sh
+
9
−
0
Voir le fichier @
e5a01f08
...
...
@@ -22,6 +22,15 @@ pip install -e .[testing]
# Install client dependencies
bin/install_client_deps.sh
# Create pg user and database
if
[
$(
psql
-c
"select 'CNT=' || count(1) from pg_catalog.pg_user where usename='memopol';"
-U
postgres |
grep
CNT
=
1 |
wc
-l
)
-lt
1
]
;
then
psql
-c
"create user memopol with password 'memopol';"
-U
postgres
fi
psql
-c
"alter role memopol with createdb;"
-U
postgres
if
[
$(
psql
-l
-U
postgres | egrep
"^ memopol
\W
"
|
wc
-l
)
-lt
1
]
;
then
psql
-c
"create database memopol with owner memopol;"
-U
postgres
fi
# Setup environment
export
DJANGO_DEBUG
=
True
export
DJANGO_SETTINGS_MODULE
=
memopol.settings
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
docs/development.rst
+
38
−
26
Voir le fichier @
e5a01f08
...
...
@@ -101,38 +101,33 @@ the ``DJANGO_DEBUG`` variable in the current shell::
$ export DJANGO_DEBUG=True
Run
the d
evelopment server
==================
========
Setup
the d
atabase
==================
Run the development server::
Memopol requires PostgreSQL 9.1 or higher. It used to run with SQLite, too, but
that is no longer the case. Memopol uses the following environment variables
for database access:
$ ./manage.py runserver
* ``MEMOPOL_DB_NAME`` (defaults to 'memopol')
* ``MEMOPOL_DB_USER`` (defaults to 'memopol')
* ``MEMOPOL_DB_PASSWORD`` (defaults to 'memopol')
* ``MEMOPOL_DB_HOST`` (defaults to 'localhost')
* ``MEMOPOL_DB_PORT`` (defaults to '5432')
Performing system checks...
Make sure the corresponding user and database exist on your system; the user
will need the 'createdb' permission in order to be able to run tests. To create
them, you may use the following commands:
System check identified no issues (0 silenced).
December 09, 2015 - 21:26:47
Django version 1.8.7, using settings 'memopol.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[09/Dec/2015 21:26:48] "GET / HTTP/1.1" 200 13294
The website is running on ``http://127.0.0.1:8000/``.
$ psql -c "create user memopol with password 'memopol';" -U postgres
$ psql -c "alter role memopol with createdb;" -U postgres
$ psql -c "create database memopol with owner memopol;" -U postgres
Database migrations
===================
The repo comes with a pre-configured SQLite db with sample data so that you can
start hacking right away. However, if you were to use a local postgresql
database ie. with this sort of environment::
export DJANGO_DATABASE_DEFAULT_NAME=memopol
export DJANGO_DATABASE_DEFAULT_USER=postgres
export DJANGO_DATABASE_DEFAULT_ENGINE=django.db.backends.postgresql_psycopg2
export DJANGO_DEBUG=1
export DJANGO_SETTINGS_MODULE=memopol.settings
Then you could run database migrations::
Database migrations ensure the database schema is up to date with the project.
If you're not sure, you can run them anyway, they won't do any harm. Use the
following command::
$ ./manage.py migrate
Operations to perform:
...
...
@@ -153,8 +148,7 @@ Then you could run database migrations::
Provision with data
===================
Again, the repo comes with a pre-configured SQLite db with sample data so that
you can start hacking right away. However, you could still reload sample data::
You can load a small data sample for quick setup:
$ ./manage.py loaddata memopol/fixtures/small_sample.json
...
...
@@ -162,4 +156,22 @@ Or actual data (takes a while)::
$ bin/update_all
Run the development server
==========================
Run the development server::
$ ./manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
December 09, 2015 - 21:26:47
Django version 1.8.7, using settings 'memopol.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[09/Dec/2015 21:26:48] "GET / HTTP/1.1" 200 13294
The website is running on ``http://127.0.0.1:8000/``.
Continue to :doc:`administration`.
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter