Installation¶
For installing django-ai
in your Django project use the following steps:
Activate your virtual environment and then:
pip install django-ai
Add it to your INSTALLED_APPS:
INSTALLED_APPS = ( ... # Dependencies 'nested_admin', # django-ai apps 'django_ai.base', 'django_ai.bayesian_networks', 'django_ai.supervised_learning', 'django_ai.systems.spam_filtering', # optional but highly recommended 'django_ai.examples', ... )
The django_ai.examples
is optional but it is highly recommended that you keep it as a reference.
Create the migrations for the dependencies and apply them:
python manage.py makemigrations python manage.py migrate
Add django-ai’s apps URL patterns and its dependencies:
urlpatterns = [ ... url(r'^nested_admin/', # Dependency include('nested_admin.urls')), url(r'^django-ai/', include(django_ai.base.urls)), ... ]
Ensure that the
admin
app is enabled.Ensure that your
static
serving is properly configured, if not you may have to add to yoururls.py
:... from django.conf.urls.static import static urlpatterns = [ ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
For reference, there is a working settings.py
and urls.py
in the source distribution for further troubleshooting if necessary.