You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that you should not run any (backend) processes in your DSMR-reader development environment, until you've unlinked all external services.
87
+
88
+
After importing the backup of your production system, simply run::
89
+
90
+
source ~/.virtualenvs/dsmrreader/bin/activate
91
+
./manage.py development_reset
92
+
93
+
This will remove all API keys and other links to externals systems, as well as reset the admin user credentials to ``admin / admin`` (user / password).
94
+
95
+
96
+
Fake datalogger
97
+
---------------
98
+
99
+
There is a builtin command that can somewhat fake a datalogger::
It will generate random data every second in a certain pattern and should be fine for basic testing.
105
+
106
+
Please note that it only inserts unprocessed readings, so you'll still have to run the ``./manage.py dsmr_backend --run-once`` command to have the readings processed.
107
+
108
+
109
+
Running DSMR-reader locally
110
+
---------------------------
111
+
112
+
You can run the Django development server with::
113
+
114
+
source ~/.virtualenvs/dsmrreader/bin/activate
115
+
./manage.py runserver
116
+
117
+
The application will be accessible on: ``http://localhost:8000/``.
118
+
Any code changes you make will let the application reload automatically.
119
+
120
+
121
+
Tests
122
+
-----
123
+
124
+
The easiest way to run tests is to use the in-memory tests::
125
+
126
+
source ~/.virtualenvs/dsmrreader/bin/activate
127
+
./tools/quick-test.sh
128
+
129
+
To test a single apps within DSMR-reader, just append it::
130
+
131
+
source ~/.virtualenvs/dsmrreader/bin/activate
132
+
./tools/quick-test.sh dsmr_frontend
133
+
134
+
To test all database backends, run::
135
+
136
+
source ~/.virtualenvs/dsmrreader/bin/activate
137
+
./tools/test-all.sh
138
+
139
+
Translations
140
+
------------
141
+
142
+
You can find the translations (.PO files) for the main application in ``dsmrreader/locales/``.
143
+
To regenerate them, just execute the ``./tools/quick-test.sh`` script, as one of the tests checks translations.
144
+
145
+
146
+
Editing documentation
147
+
---------------------
148
+
149
+
The documentation is part of the repository and can be generated (automatically) with Sphinx::
150
+
151
+
source ~/.virtualenvs/dsmrreader/bin/activate
152
+
cd docs/
153
+
sphinx-autobuild . _build/html -p 10000
154
+
155
+
You can now view the documentation in your browser by accessing: ``http://127.0.0.1:10000``.
156
+
Any changes you make will be reflected instantly in the browser, as Sphinx continuously checks for changed files.
157
+
158
+
159
+
Translating documentation
160
+
-------------------------
161
+
162
+
Translations are done using gettext and .PO files. Regenerate the .PO files with::
163
+
164
+
source ~/.virtualenvs/dsmrreader/bin/activate
165
+
cd docs/
166
+
make gettext && sphinx-intl update -p _build/locale -l nl
167
+
168
+
The .PO files in ``docs/locale`` shoud be regenerated now. You can use ``poedit`` to view and translate the files.
169
+
170
+
After editing the .PO files, you can check the result by building the Dutch translations locally::
171
+
172
+
make -e SPHINXOPTS="-D language='nl'" html
173
+
174
+
Now view the generated HTML in your browser by opening: ``docs/_build/html/index.html``
175
+
176
+
177
+
Pull requests
178
+
-------------
179
+
180
+
Please make sure to always point any pull requests to the ``development`` branch of DSMR-reader, as the ``master`` branch will only be affected by release merges.
0 commit comments