simplesitesearch


Namesimplesitesearch JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/reptiletech/simplesitesearch
SummaryReptile Simple Site Search django app
upload_time2025-10-09 12:56:06
maintainerNone
docs_urlNone
authorReptile Tech
requires_python>=3.6
licenseMIT
keywords django search cms django-cms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple Site Search

A simple Django app for site search functionality with Django CMS integration. This package provides a clean, easy-to-use search interface that can be integrated into Django CMS projects.


## Features

- **Django CMS Integration**: Seamlessly integrates with Django CMS as an apphook
- **Pagination Support**: Built-in pagination for search results
- **Multi-language Support**: Supports internationalization with Django's i18n framework
- **Customizable Templates**: Easy to customize search result templates
- **API Integration**: Connects to external search APIs (like AddSearch)
- **Responsive Design**: Bootstrap-compatible templates

## Installation

Install the package using pip:

```bash
pip install simplesitesearch
```

## Configuration

### 1. Add to INSTALLED_APPS

Add `simplesitesearch` to your Django project's `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    # ... other apps
    'simplesitesearch',
    # ... other apps
]
```

### 2. Required Settings

Add the following settings to your Django settings file:

```python
# Search API Configuration
SITE_SEARCH_API_BASE_URL = "https://search.rt5.ca/reptile_search/api/search/"
SITE_SEARCH_SITE_KEY = "your-site-key-here"
SITE_SEARCH_API_KEY = "your-api-key-here"  # Optional, if required by your API
```

### 3. URL Configuration

Include the app's URLs in your main `urls.py`:

```python
from django.urls import path, include

urlpatterns = [
    # ... other URL patterns
    path('search/', include('simplesitesearch.urls')),
    # ... other URL patterns
]
```

## Django CMS Integration

### 1. Create a Search Page

1. Log into your Django CMS admin
2. Go to **Django CMS** > **Pages**
3. Create a new page named "Search"
4. Translate the title and slug in all languages
5. Save and continue editing

### 2. Configure the Page

1. Go to **Advanced settings** of the search page
2. Set **APPLICATION** to "Site Search"
3. Set the **Application ID** to `'site_search'` (this is the default value)
4. Save the page
5. Remove the page from the menu (uncheck "menu" in the table)
6. Publish the page in all languages

### 3. Access the Search

Your search functionality will be available at the URL you configured for the search page.

## Usage

### Basic Search

The search form accepts a `q` parameter for the search term:

```
/search/?q=your+search+term
```

### Pagination

The search results support pagination with a `page` parameter:

```
/search/?q=your+search+term&page=2
```

### Honeypot Protection

The search includes basic honeypot protection. If a `message` parameter is present, the search will not execute.

## Customization

### Templates

The package includes two main templates:

- `simplesitesearch/search_results.html` - Main search results template
- `simplesitesearch/pagination.html` - Pagination template

#### Template Customization

You can override these templates in your project by creating templates with the same names in your template directory. The templates are designed to be easily customizable:

**Template Include Paths:**
- `simplesitesearch/search_results.html` - Main search results page
- `simplesitesearch/pagination.html` - Pagination component (included in search_results.html)

**To customize templates:**
1. Create a `templates/simplesitesearch/` directory in your Django project
2. Copy the template files from the package and modify them as needed
3. Your custom templates will override the package defaults

**Example template structure:**
```
your_project/
├── templates/
│   └── simplesitesearch/
│       ├── search_results.html  # Your custom search results template
│       └── pagination.html      # Your custom pagination template
```

### Styling

The templates use Bootstrap classes and can be easily customized with CSS. The main CSS classes used are:

- `.pagination` - Pagination container
- `.search_query` - Search query display
- `.search_results` - Results count display
- `.wrapper_single_result` - Individual result container

## API Response Format

The search expects the API to return JSON in the following format:

```json
{
    "total_hits": 42,
    "hits": [
        {
            "title": "Page Title",
            "url": "https://example.com/page/",
            "highlight": "Search term highlighted content..."
        }
    ]
}
```

## Requirements

- Python 3.6+
- Django 2.2+
- django-cms 3.2+
- requests 2.22.0+

## Development

### Local Development

1. Clone the repository
2. Install in development mode:
   ```bash
   pip install -e .
   ```

### Testing

Run the tests with:

```bash
python manage.py test simplesitesearch
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

For support and questions, please open an issue on the [GitHub repository](https://github.com/yourusername/simplesitesearch/issues).

## Changelog

### 0.0.1
- **First stable release**
- Django CMS integration with apphook support
- Pagination support for search results
- Multi-language support with Django i18n
- Basic search functionality with API integration
- Template customization support
- Support for Python 3.6+ and Django 2.2+
- Reptile Search API integration
- Comprehensive documentation and setup instructions



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/reptiletech/simplesitesearch",
    "name": "simplesitesearch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "Reptile Tech <flouis@reptile.tech>",
    "keywords": "django, search, cms, django-cms",
    "author": "Reptile Tech",
    "author_email": "Reptile Tech <flouis@reptile.tech>",
    "download_url": "https://files.pythonhosted.org/packages/1f/26/c183107a947d77e907c30c65afe6cf9dbe7a6bef83e39726eb47e25999e2/simplesitesearch-0.0.1.tar.gz",
    "platform": null,
    "description": "# Simple Site Search\n\nA simple Django app for site search functionality with Django CMS integration. This package provides a clean, easy-to-use search interface that can be integrated into Django CMS projects.\n\n\n## Features\n\n- **Django CMS Integration**: Seamlessly integrates with Django CMS as an apphook\n- **Pagination Support**: Built-in pagination for search results\n- **Multi-language Support**: Supports internationalization with Django's i18n framework\n- **Customizable Templates**: Easy to customize search result templates\n- **API Integration**: Connects to external search APIs (like AddSearch)\n- **Responsive Design**: Bootstrap-compatible templates\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install simplesitesearch\n```\n\n## Configuration\n\n### 1. Add to INSTALLED_APPS\n\nAdd `simplesitesearch` to your Django project's `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n    # ... other apps\n    'simplesitesearch',\n    # ... other apps\n]\n```\n\n### 2. Required Settings\n\nAdd the following settings to your Django settings file:\n\n```python\n# Search API Configuration\nSITE_SEARCH_API_BASE_URL = \"https://search.rt5.ca/reptile_search/api/search/\"\nSITE_SEARCH_SITE_KEY = \"your-site-key-here\"\nSITE_SEARCH_API_KEY = \"your-api-key-here\"  # Optional, if required by your API\n```\n\n### 3. URL Configuration\n\nInclude the app's URLs in your main `urls.py`:\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n    # ... other URL patterns\n    path('search/', include('simplesitesearch.urls')),\n    # ... other URL patterns\n]\n```\n\n## Django CMS Integration\n\n### 1. Create a Search Page\n\n1. Log into your Django CMS admin\n2. Go to **Django CMS** > **Pages**\n3. Create a new page named \"Search\"\n4. Translate the title and slug in all languages\n5. Save and continue editing\n\n### 2. Configure the Page\n\n1. Go to **Advanced settings** of the search page\n2. Set **APPLICATION** to \"Site Search\"\n3. Set the **Application ID** to `'site_search'` (this is the default value)\n4. Save the page\n5. Remove the page from the menu (uncheck \"menu\" in the table)\n6. Publish the page in all languages\n\n### 3. Access the Search\n\nYour search functionality will be available at the URL you configured for the search page.\n\n## Usage\n\n### Basic Search\n\nThe search form accepts a `q` parameter for the search term:\n\n```\n/search/?q=your+search+term\n```\n\n### Pagination\n\nThe search results support pagination with a `page` parameter:\n\n```\n/search/?q=your+search+term&page=2\n```\n\n### Honeypot Protection\n\nThe search includes basic honeypot protection. If a `message` parameter is present, the search will not execute.\n\n## Customization\n\n### Templates\n\nThe package includes two main templates:\n\n- `simplesitesearch/search_results.html` - Main search results template\n- `simplesitesearch/pagination.html` - Pagination template\n\n#### Template Customization\n\nYou can override these templates in your project by creating templates with the same names in your template directory. The templates are designed to be easily customizable:\n\n**Template Include Paths:**\n- `simplesitesearch/search_results.html` - Main search results page\n- `simplesitesearch/pagination.html` - Pagination component (included in search_results.html)\n\n**To customize templates:**\n1. Create a `templates/simplesitesearch/` directory in your Django project\n2. Copy the template files from the package and modify them as needed\n3. Your custom templates will override the package defaults\n\n**Example template structure:**\n```\nyour_project/\n\u251c\u2500\u2500 templates/\n\u2502   \u2514\u2500\u2500 simplesitesearch/\n\u2502       \u251c\u2500\u2500 search_results.html  # Your custom search results template\n\u2502       \u2514\u2500\u2500 pagination.html      # Your custom pagination template\n```\n\n### Styling\n\nThe templates use Bootstrap classes and can be easily customized with CSS. The main CSS classes used are:\n\n- `.pagination` - Pagination container\n- `.search_query` - Search query display\n- `.search_results` - Results count display\n- `.wrapper_single_result` - Individual result container\n\n## API Response Format\n\nThe search expects the API to return JSON in the following format:\n\n```json\n{\n    \"total_hits\": 42,\n    \"hits\": [\n        {\n            \"title\": \"Page Title\",\n            \"url\": \"https://example.com/page/\",\n            \"highlight\": \"Search term highlighted content...\"\n        }\n    ]\n}\n```\n\n## Requirements\n\n- Python 3.6+\n- Django 2.2+\n- django-cms 3.2+\n- requests 2.22.0+\n\n## Development\n\n### Local Development\n\n1. Clone the repository\n2. Install in development mode:\n   ```bash\n   pip install -e .\n   ```\n\n### Testing\n\nRun the tests with:\n\n```bash\npython manage.py test simplesitesearch\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nFor support and questions, please open an issue on the [GitHub repository](https://github.com/yourusername/simplesitesearch/issues).\n\n## Changelog\n\n### 0.0.1\n- **First stable release**\n- Django CMS integration with apphook support\n- Pagination support for search results\n- Multi-language support with Django i18n\n- Basic search functionality with API integration\n- Template customization support\n- Support for Python 3.6+ and Django 2.2+\n- Reptile Search API integration\n- Comprehensive documentation and setup instructions\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Reptile Simple Site Search django app",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/reptiletech/simplesitesearch/issues",
        "Documentation": "https://github.com/reptiletech/simplesitesearch#readme",
        "Homepage": "https://github.com/reptiletech/simplesitesearch",
        "Repository": "https://github.com/reptiletech/simplesitesearch.git"
    },
    "split_keywords": [
        "django",
        " search",
        " cms",
        " django-cms"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3916ce6255a81e8c311b4bcfc13fc0904f5f3c01d2dd1b3dce2dd4b26f609ad8",
                "md5": "3ff83640ba120957be082aeffbf32a83",
                "sha256": "d26ea83424b9e4dab90547f9b9cff1a6273ae83b806e67896ef6430022f536df"
            },
            "downloads": -1,
            "filename": "simplesitesearch-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3ff83640ba120957be082aeffbf32a83",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8210,
            "upload_time": "2025-10-09T12:56:05",
            "upload_time_iso_8601": "2025-10-09T12:56:05.894177Z",
            "url": "https://files.pythonhosted.org/packages/39/16/ce6255a81e8c311b4bcfc13fc0904f5f3c01d2dd1b3dce2dd4b26f609ad8/simplesitesearch-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1f26c183107a947d77e907c30c65afe6cf9dbe7a6bef83e39726eb47e25999e2",
                "md5": "23e5c9ba594ce0168cd1f356cd35f022",
                "sha256": "ccde9f257cfd76a13eb747f8195b692b58bf93c525b2d538365a6c2119645fc8"
            },
            "downloads": -1,
            "filename": "simplesitesearch-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "23e5c9ba594ce0168cd1f356cd35f022",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10294,
            "upload_time": "2025-10-09T12:56:06",
            "upload_time_iso_8601": "2025-10-09T12:56:06.999446Z",
            "url": "https://files.pythonhosted.org/packages/1f/26/c183107a947d77e907c30c65afe6cf9dbe7a6bef83e39726eb47e25999e2/simplesitesearch-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-09 12:56:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "reptiletech",
    "github_project": "simplesitesearch",
    "github_not_found": true,
    "lcname": "simplesitesearch"
}
        
Elapsed time: 3.41070s