A recipe retrieval system which enables users to query recipes by specifying wanted and unwanted ingredients, tools and techniques with considering the unstructured instructions text of recipes.
-
Download the repository and navigate to the directory that contains
requirements.txt
file. -
Create a Python 3.6 virtualenv and activate it.
python3.6 -m venv recipy_env
source recipy_env/bin/activate
-
Install the requirements via pip package manager.
pip install -r requirements.txt
-
Start the development server.
python recipy/manage.py runserver
-
If above steps were successful, navigate to http://localhost:8000/ on your browser to test the app locally. It will use the remote database. So no database configuration required.
- Download and install PostgreSQL 12 on your machine.
- Create an empty database on the PostgreSQL.
- Set the database credential related settings under
recipy/recipy/settings.py
file.DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '{DB_NAME}', 'USER': '{DB_USER}', 'PASSWORD': '{DB_USER_PASSWORD}', 'HOST': '{DB_ADDRESS}', 'PORT': '{DB_PORT}', } }
- Migration files are included in the repository so only `migrate command will be sufficient to create tables on the database.
python recipy/manage.py migrate
- Insert your own recipe records into the
main_recipe
table on the database. - Recreate indexes and statistical thesaurus.
- Open the Python shell of the app.
python recipy/manage.py shell
- Run the scripts over the Python shell of the app.
from main.utilities.index_creator import * build_index() build_statistical_thesaurus()
- Save the indexes as binary files with pickle over the Python shell of the app.
import pickle from main.utilities.index_creator import * with open('pickles/all_documents.txt', 'wb') as f: pickle.dump(ALL_DOCUMENTS, f) with open('pickles/index.txt', 'wb') as f: pickle.dump(INDEX, f) with open('pickles/thesaurus.txt', 'wb') as f: pickle.dump(STATISTICAL_THESAURUS, f)
- Open the Python shell of the app.