A Django based application that provides a REST API, as well as manual and automated tools for search service data.
- python 3.8+
- pip
- node@14
- gulp-cli
- angular-cli
- Fontawesome 6+ pro
- Create virtual environment for your project:
python3 -m venv projectfolder
and move to the directorycd projectfolder/
- Clone repository into src directory:
git clone [email protected]:UCF/Search-Service-Django.git src
and move to the directorycd src/
- Activate virtual environment:
source ../bin/activate
- Create a .npmrc file in the home directory. Copy the script from template.npmrc and paste it into .npmrc. Then, replace authToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX with the Pro Token purchased from FA6.
- Install requirements:
pip install -r requirements.txt
- Create a gulp config file:
cp gulp-config.tmpl.json gulp-config.json
, then modify as necessary - Install the required npm packages:
npm install
- Make sure the default artifacts are created:
gulp default
- Create a settings_local.py file:
cp settings_local.tmpl.py settings_local.py
, then modify to add API keys and the like.- Note: during this step, you should not modify
STATIC_ROOT
orSTATICFILES_DIRS
.
- Note: during this step, you should not modify
- Run the deployment steps:
python manage.py deploy
. This command is the equivelent of running the following individual commands: a.python manage.py migrate
b.python manage.py collectstatic -l
- Once deployment steps have run successfully, comment out
STATIC_ROOT
and add a static root path toSTATICFILES_DIRS
in settings_local.py. - Create a superuser to access the Django admin with:
python manage.py createsuperuser
- Optionally, load fixtures:
python manage.py loaddata fixture-name
. Fixtures, if available, are included per-app in afixtures
directory.- Note: if loading in fixtures for Programs, make sure the
colleges
fixture is loaded before loading thecollegeoverrides
fixture.
- Note: if loading in fixtures for Programs, make sure the
- Run the local server to debug and test:
python manage.py runserver
NOTE: to build/test Archimedes, you must set LOCAL = True
in your settings_local.py.
- Run
npm install
within thearchimedes
directory. - Run
ng build --watch
to view app during development. - Run
ng build -c production
to compile angular js for production environment.
There are some additional libraries necessary to run some of the management command scripts not meant to be run on a server. For example, the manage.py generate-career-weights
command uses the spacy
package and its associated library of words, which can take up around .5GB of space, so we want to avoid installing that on servers.
The install these additional packages, run the following: pip install -r dev-requirements.txt
.
The pip dependency lxml
requires some additional libraries to be installed on the server the application is running on. You can run the following commands to install:
Ubuntu
sudo apt-get install -y libxml2-dev libxslt1-dev
RHEL
sudo yum install libxml2 libxml2-devel libxml2-python libxslt libxslt-devel
The requirements.txt
and dev-requirements.txt
files in this project are generated using the pip-tools
package. All package information is tracked within the pyproject.toml
file and then dependencies are resolved using the following commands:
Production requirements.txt
pip-compile -o requirements.txt pyproject.toml
Dev requirements.txt
pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml
If you do not already have pip-tools installed, you can install them with the following command: pip install pip-tools
.