Commit afe503b8 authored by Philipp Sebastian Sommer's avatar Philipp Sebastian Sommer
Browse files

add development instructions

parent 4895219e
......@@ -7,26 +7,72 @@ django web framework.
Detailed documentation is in the "docs" directory.
Quick start
-----------
Quick start for development
---------------------------
1. You need at least python 3.7 and pip installed
2. Clone this repository::
1. Add ``clm_members`` and ``clm_topics`` to your INSTALLED_APPS setting like
this::
git clone https://coastgit.hzg.de/hcdc/django/django-clm-community.git
cd django-clm-communty
INSTALLED_APPS = [
...
'clm_members',
'clm_topics',
]
3. Clone the django-academic-community package::
2. Include the URLconf in your project urls.py like this::
git clone https://coastgit.hzg.de/hcdc/django/django-academic-community.git
path('members/', include('clm_members.urls')),
path('topics/', include('clm_topics.urls')),
4. Install both packages (in development mode)::
3. Run ``python manage.py migrate`` to create the models.
pip install -e django-academic-community/ -e .[dev]
4. Start the development server and visit http://127.0.0.1:8000/admin/
to create an institution (you'll need the Admin app enabled).
5. Now we need to make the migrations. Run::
5. Visit http://127.0.0.1:8000/topics/ to list it.
python manage.py makemigrations
6. Create a local database. This is a simple sqlite3 database that we use for
development. We do not yet use MS SQL Server::
python manage.py migrate
This now created a `db.sqlite3` file (that is ignored in the version control)
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. Create a superuser via::
python manage.py createsuperuser
9. 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
Building the docs
-----------------
There is some static files generated via sphinx, together with an API
documentation. The source code for this documentation is in the `docs <docs>`__
folder. If you installed this package with the above ``pip install`` command,
you already have everything you need. The only thing that you should have
installed already is ``graphviz`` (e.g. via ``conda install graphviz``).
Navigate to the `docs <docs>`__ folder and run ``make html`` (on linux) or
``make.bat html`` on windows and open the file at
``docs/_build/html/index.html`` in your browser.
Some of the documentation in this content is also available through the admin
docs. When you run the server (``python manage.py runserver``), navigate to the
docs under http://127.0.0.1:8000/admin/docs.
Note that there is still a lot to work on for the documentation, so in case you
are missing something, please do not hesitate to ask.
Running the tests
-----------------
Just run ``tox`` (you installed it with ``pip install .[dev]``).
......@@ -17,7 +17,6 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Internet :: WWW/HTTP
......@@ -25,6 +24,7 @@ classifiers =
[options]
include_package_data = true
python_requires = >=3.7
packages = find:
install_requires =
django-academic-community
......@@ -44,6 +44,18 @@ exclude =
[options.extras_require]
testsite =
django-extensions
dev =
tox
pytest
pytest-lazy-fixture
pytest-django
mypy
django-stubs
black
django-extensions
sphinx
sphinxcontrib-django
[mypy]
plugins =
......
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