The django-controlled-vocabularies app is used to manage vocabularies used by the UNT Libraries digital infrastructure which includes: The UNT Digital Library, The Portal to Texas History, and the Gateway to Oklahoma History.
- Django 4.2
- Python 3.8 - 3.10
- libxml2
- libxslt
These instructions are for adding django-controlled-vocabularies as an app to an existing Django project. If you simply want to test out the app to see how it works, skip to the Developing/Testing section further below.
-
Download and install from source code.
Install with SSH:
$ pip install git+ssh://[email protected]/unt-libraries/django-controlled-vocabularies
OR install with HTTPS:
$ pip install git+https://github.com/unt-libraries/django-controlled-vocabularies
-
Add app and sites framework to INSTALLED_APPS.
INSTALLED_APPS = ( 'django.contrib.sites', 'controlled_vocabularies' )
-
Set the VOCAB_DOMAIN setting to your own desired location.
VOCAB_DOMAIN = 'http://example.org/vocabs/'
-
Set the SITE_ID.
SITE_ID = 1
-
Include the URLs.
urlpatterns = [ path('admin/', admin.site.urls), path('vocabularies/', include('controlled_vocabularies.urls')) ]
-
Migrate the database.
$ python manage.py migrate
This will allow you to run the tests, easily make changes to the app, and visually inspect the app locally in your browser.
-
Clone the repository into a location of your choosing:
$ git clone [email protected]:unt-libraries/django-controlled-vocabularies.git
-
Navigate into the repository:
$ cd django-controlled-vocabularies
-
Prepare and activate a Python virtual environment for the app using virtualenv, pyenv, pipenv, or something similar. Leave it activated for the remaining instructions.
-
Install all requirements:
$ pip install -r requirements.txt
-
Run the test suite if desired:
$ pytest
Note: You may also use
tox
to run the test suite, but there is only a benefit to this method if you have multiple Python versions available, and it does not require a virtual environment. -
Run the migrations (steps 6-10 are for viewing/testing the app locally from your web browser):
$ python manage.py migrate
-
Create a superuser for yourself so you can access the admin portion of the app:
$ python manage.py createsuperuser
-
Run the test server:
$ python manage.py runserver
-
Navigate to localhost:8000/vocabularies/ in your browser and test the app as desired. The admin interface is located at localhost:8000/admin/.
-
Stop the test server when you're done by pressing
Ctrl+c
See LICENSE.txt
- Brandon Fredericks
- Mark Phillips
- Joey Liechty
- Gio Gottardi
- Madhulika Bayyavarapu
- Gracie Flores-Hays