semvec/pypi-packages huggingface dataset:
django-dynamictexts 0.2.2
Reusable Django app for dynamic multilingual texts with template tags.
License: MIT

# Django DynamicTexts

Django DynamicTexts is a reusable Django library for dynamically storing and displaying texts (with a unique key, title, and content) with full multilingual (i18n) support. It is ideal for project localization, content management, and SEO-friendly pages.

---

## Features
- Store texts with a unique `key`, `title`, and `content`.
- Full translation support (e.g., for English and Latvian) using [django-modeltranslation](https://django-modeltranslation.readthedocs.io/).
- Easy usage in Django templates via custom template tags.
- Content editing via the Django admin interface.

---

## Installation

1. **Add the app and modeltranslation to `INSTALLED_APPS`:**
    ```python
    INSTALLED_APPS = [
        ...
        'modeltranslation',
        'texts',
    ]
    ```
2. **Configure languages:**
    ```python
    LANGUAGES = [
        ('en', 'English'),
        ('lv', 'Latviešu'),
    ]
    MODELTRANSLATION_DEFAULT_LANGUAGE = 'en'
    MODELTRANSLATION_LANGUAGES = ('en', 'lv')
    ENABLE_DYNAMIC_TEXT_TRANSLATIONS = True
    USE_I18N = True
    MIDDLEWARE = [
        ...
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.locale.LocaleMiddleware',
        'django.middleware.common.CommonMiddleware',
        ...
    ]
    ```
3. **Run migrations:**
    ```bash
    python manage.py makemigrations texts
    python manage.py migrate
    ```
4. **Install dependencies:**
    ```bash
    pip install django-modeltranslation
    ```

---

## Usage

1. **Add/edit texts in the admin interface** (`/admin/`), filling in all required translation fields.
2. **Load template tags in your template:**
    ```django
    {% load dynamictexts_tags %}
    ```
3. **Display texts in your template:**
    ```django
    <h1>{% get_title "about-us" %}</h1>
    <p>{% get_content "about-us" %}</p>
    ```
   - The correct translation will be shown automatically based on the active language.

---

## Language Switching

- Use Django's i18n `set_language` view or another language switching mechanism.
- Example language switcher form in a template:
    ```django
    <form action="/i18n/setlang/" method="post">{% csrf_token %}
        <input name="next" type="hidden" value="{{ request.path }}">
        <select name="language">
            <option value="en">English</option>
            <option value="lv">Latviešu</option>
        </select>
        <input type="submit" value="Change language">
    </form>
    <p>Active language: {{ LANGUAGE_CODE }}</p>
    ```

---

## Best Practices
- Always fill in all translation fields in the admin interface.
- Ensure `LocaleMiddleware` is in the correct place in the MIDDLEWARE list.
- Use template tags only after `{% load dynamictexts_tags %}`.
- If you add new languages, update `LANGUAGES` and run migrations.

---

## License
MIT
spa-json-py 0.0.1
a python package to build static page apps running on json documents
License: MIT
Requires Python: <4.0,>=3.10

# spa.json.py
Static Page App generator that uses JSON files written in python 


Generate static page website and host it

## Features of the package 

- Flat single level heirarchy
- Create content in markdown 
- Multiple page types :
	- article : long text   
	- gallery : a showcase of images/pages. This can be for instance used as the about page
- Bootstrap based styling 
- 


## Get started

To create a new project

- Create a new folder
- Install the `spa.json.py` package 
- Run spa init 
	- This will create a config.yaml file and a folder `source`
	- The source folder is where you store your content in markdown files  
	- The source folder will by defualt have a `home.md` page. This will be the home page of your website.  
	- As of now you cannot modify the styling/position of compontents on the page (TODO later)
	- This will also create a `.github` folder with a script to deploy the website on github pages if you want to 

##  Adding content 


### Text
- math supported
- images supported 

### Image


### Gallery   


## Configure your website


## Publish your website