Verified Commit e09295d0 authored by Philipp Sebastian Sommer's avatar Philipp Sebastian Sommer
Browse files

update installation instructions

parent a4c18aef
Pipeline #126902 passed with stage
in 5 minutes and 35 seconds
============================
CLM-community Django project
============================
=================================
Academic-community Django project
=================================
`django-clm-community` is a representation of the CLM-community with the
django web framework.
`django-academic-community` is a representation of an academic community on the
web using Django.
Detailed documentation is in the "docs" directory.
Some more documentation is in the "docs" directory, but we are working on
improving this.
Quick start for development
---------------------------
1. You need at least python 3.7 and pip installed
1. You need at least python 3.7, postgres and ``pip`` installed
2. Clone this repository::
git clone https://coastgit.hzg.de/hcdc/django/django-clm-community.git
cd django-clm-communty
git clone https://gitlab.hzdr.de/hcdc/django/django-academic-community.git
cd django-academic-communty
3. Install both packages (in development mode)::
3. Install the packages (in development mode)::
pip install .[dev]
4. Now we need to make the migrations. Run::
python manage.py makemigrations
5. Create a local database. This is a simple sqlite3 database that we use for
development. We do not yet use MS SQL Server::
5. By default, we assume that there exists a ``django_academic_community``
database that is writeable for a user name ``django_academic_user`` with
password ``admin``. But you can change this with environment variables (see
`settings.py <clm_tools_test_site/settings.py>`__).
Run::
python manage.py migrate
This now created a `db.sqlite3` file (that is ignored in the version control)
to setup the database.
6. Create the initial revisions (necessary for django-reversion_)::
python manage.py createinitialrevisions
7. Migrate the old SLM Community database from the MS SQL Server at
dbserver1.fzg.local::
python manage.py clm2django -p $DBPW
Where ``$DBPW`` needs to be replaced by the password of the ``SQL_CLM_READ``
user database user (see the corresponding entry in ``HCDC_Passwords.kdbx``).
8. `clm2django` uses the IDs from the old database whenever possible. When using
postgres, this causes problems because the available IDs are managed through
a ``SERIAL`` column (see
`the docs on manually specifying values of auto incrementing primary keys`_).
You need to use the sqlsequencereset_ command to reset these counters::
python manage.py sqlsequencereset clm_members academic_community clm_activities clm_topics | psql django_clm_community -h ...
9. Create a superuser via::
7. Create a superuser via::
python manage.py createsuperuser
10. Populate the database with dummy users (note that this is for development
purposes only!)::
python manage.py makedummyusers -n "Beate Geyer" "Burkhardt Rockel"
The password for these user accounts will be ``admin``.
11. Run the local development server via::
8. Run the local development server via::
python manage.py runserver
Open the topic browser at http://127.0.0.1:8000/topics, and the admin site
at http://127.0.0.1:8000/admin
Open the topic browser at http://127.0.0.1:8000/topics, and the admin site
at http://127.0.0.1:8000/admin
.. _django-reversion: https://django-reversion.readthedocs.io
.. _the docs on manually specifying values of auto incrementing primary keys: https://docs.djangoproject.com/en/3.1/ref/databases/#manually-specifying-values-of-auto-incrementing-primary-keys)
.. _sqlsequencereset: https://docs.djangoproject.com/en/3.1/ref/django-admin/#django-admin-sqlsequencereset
Building the docs
......
Supports Markdown
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