This Django web application allows for the creation and maintenance of a catalog of subjects.
- Python 3.8 - 3.10
- Django 4.2
To install this app into your own Django project,
-
Install the app from the git repository:
$ pip install git+https://github.com/unt-libraries/django-subjects.git
-
Add to your INSTALLED_APPS in your Django project's settings:
INSTALLED_APPS = [ ... subjects ]
-
Include subjects' URLs in your project's urls.py file:
urlpatterns = [ ... path('admin/', admin.site.urls), path('subjects/', include('subjects.urls')), path('accounts/login/', LoginView.as_view( template_name='subjects/login.html'), name="login"), path('accounts/logout/', LogoutView.as_view( template_name='subjects/logout.html'), name="logout"), ]
-
Apply the migrations (from wherever your project's manage.py file is):
$ manage.py migrate
If you'd like to work on the code or take this app for a test run without setting up a separate Django project, you can do so by following these instructions, which will run the app with the Django test server.
-
Clone the git repository:
$ git clone https://github.com/unt-libraries/django-subjects.git
-
Navigate into the cloned repository:
$ cd django-subjects
-
Install the requirements (preferably in a virtual environment):
$ pip install -r requirements.txt
-
Navigate to the root of the project directory and run the migrations:
$ ./manage.py migrate
-
Create a superuser so you can log into the admin interface and add/remove/modify subjects:
$ ./manage.py createsuperuser
Follow the instructions to create the superuser with whatever username, email, and password you wish.
-
Start the test server:
$ ./manage.py runserver
The test server can be viewed from a browser by navigating to the default location:
http://localhost:8000/subjects
To stop the test server, hit Ctrl-C. You can always start it up again with the command in Step 4.
To manually run the tests with your current version of Python (system or virtual environment):
-
Follow steps 1-3 of Developing
-
Run the tests:
$ pytest
Alternatively, you can use tox to run the tests in specific environments, along with the flake8 style checker:
-
Follow steps 1-2 of Developing
-
Install tox on your system:
$ sudo apt-get install tox
-
Run the tox test suite:
$ tox
See LICENSE.txt.
- Brandon Fredericks
- Mark Phillips
- Joey Liechty
- Lauren Ko
- Gio Gottardi
- Madhulika Bayyavarapu
- Gracie Flores-Hays