https://github.com/stdevteam/rest_example
REST API example implemented with Django and Django-Rest-Framework.
https://github.com/stdevteam/rest_example
django django-application django-rest-framework python3 restful-api swagger unit-testing
Last synced: 2 months ago
JSON representation
REST API example implemented with Django and Django-Rest-Framework.
- Host: GitHub
- URL: https://github.com/stdevteam/rest_example
- Owner: stdevteam
- Created: 2017-05-25T07:49:54.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T12:39:13.000Z (about 4 years ago)
- Last Synced: 2025-12-30T00:56:15.947Z (6 months ago)
- Topics: django, django-application, django-rest-framework, python3, restful-api, swagger, unit-testing
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
REST - example application based on Django and django-rest-framework
====================================================================
-----------------
Development setup
-----------------
Requirements:
- python3.4+
- Django1.11
- mysql-server
- djangorestframework
- django-rest-swagger
Install required system packages:
.. code-block:: bash
$ sudo apt-get install python3-pip
$ sudo apt-get install libmysqlclient-dev
$ sudo apt-get install python3-dev
Create www directory where project sits and environment dir
.. code-block:: bash
$ mkdir /var/www && mkdir /var/envs && mkdir /var/envs/bin
Install virtualenvwrapper
.. code-block:: bash
$ pip3 install virtualenvwrapper
You could add commands listed below to your ~/.bashrc in order to use virutualenvwrapper easier
.. code-block:: bash
export WORKON_HOME=/var/envs
export PROJECT_HOME=/var/www
export VIRTUALENVWRAPPER_HOOK_DIR=/var/envs/bin
source /usr/local/bin/virtualenvwrapper.sh
export IS_LOCAL=1
Create virtualenv
.. code-block:: bash
$ cd /var/envs && virtualenv --python=python3.4 rest_example
Install requirements for a project.
.. code-block:: bash
$ cd /var/www/rest_example && pip3 install -r requirements/local.txt
Run migrations.
.. code-block:: bash
$ python manage.py migrate
Run application in test mode.
.. code-block:: bash
$ python manage.py runserver
Swagger-generated documentation URL.
* http://127.0.0.1:8000/docs/
Django-rest-framework interface URL.
* http://127.0.0.1:8000
Running tests.
.. code-block:: bash
$ python manage.py test apps