Improve installation walkthroughs
parent
dfd2bcabf2
commit
930f3825d7
|
|
@ -35,6 +35,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
||||||
|
|
||||||
$ virtualenv venv
|
$ virtualenv venv
|
||||||
$ source venv/bin/activate
|
$ source venv/bin/activate
|
||||||
|
(venv) $ python -m pip install -U pip
|
||||||
(venv) $ pip install -U -e .[validation]
|
(venv) $ pip install -U -e .[validation]
|
||||||
(venv) $ pip install -U -r requirements/dev.txt
|
(venv) $ pip install -U -r requirements/dev.txt
|
||||||
|
|
||||||
|
|
@ -57,8 +58,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
||||||
|
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
(venv) $ cd testproj
|
(venv) $ python testproj/manage.py generate_swagger ../tests/reference.yaml --overwrite --user admin --url http://test.local:8002/
|
||||||
(venv) $ python manage.py generate_swagger ../tests/reference.yaml --overwrite --user admin --url http://test.local:8002/
|
|
||||||
|
|
||||||
After checking the git diff to verify that no unexpected changes appeared, you should commit the new
|
After checking the git diff to verify that no unexpected changes appeared, you should commit the new
|
||||||
``reference.yaml`` together with your changes.
|
``reference.yaml`` together with your changes.
|
||||||
|
|
@ -67,13 +67,13 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
||||||
|
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
# (optional) sort imports with isort and check flake8 linting
|
|
||||||
(venv) $ isort --apply
|
|
||||||
(venv) $ flake8 src/drf_yasg testproj tests setup.py
|
|
||||||
# install test dependencies
|
# install test dependencies
|
||||||
(venv) $ pip install -U -r requirements/test.txt
|
(venv) $ pip install -U -r requirements/test.txt
|
||||||
# run tests in the current environment, faster than tox
|
# run tests in the current environment, faster than tox
|
||||||
(venv) $ pytest -n auto --cov
|
(venv) $ pytest -n auto --cov
|
||||||
|
# (optional) sort imports with isort and check flake8 linting
|
||||||
|
(venv) $ isort --apply
|
||||||
|
(venv) $ flake8 src/drf_yasg testproj tests setup.py
|
||||||
# (optional) run tests for other python versions in separate environments
|
# (optional) run tests for other python versions in separate environments
|
||||||
(venv) $ tox
|
(venv) $ tox
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ In ``urls.py``:
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
|
|
||||||
This exposes 4 cached, validated and publicly available endpoints:
|
This exposes 4 endpoints:
|
||||||
|
|
||||||
* A JSON view of your API specification at ``/swagger.json``
|
* A JSON view of your API specification at ``/swagger.json``
|
||||||
* A YAML view of your API specification at ``/swagger.yaml``
|
* A YAML view of your API specification at ``/swagger.yaml``
|
||||||
|
|
@ -294,6 +294,7 @@ For additional usage examples, you can take a look at the test project in the ``
|
||||||
$ virtualenv venv
|
$ virtualenv venv
|
||||||
$ source venv/bin/activate
|
$ source venv/bin/activate
|
||||||
(venv) $ cd testproj
|
(venv) $ cd testproj
|
||||||
|
(venv) $ python -m pip install -U pip
|
||||||
(venv) $ pip install -U -r requirements.txt
|
(venv) $ pip install -U -r requirements.txt
|
||||||
(venv) $ python manage.py migrate
|
(venv) $ python manage.py migrate
|
||||||
(venv) $ python manage.py shell -c "import createsuperuser"
|
(venv) $ python manage.py shell -c "import createsuperuser"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue