Skip to main content

Django site settings app

Project description

# MP-Config

This app helps to save custom site settings in admin and use them in views or templates.
Supported field types:

* CharField
* TextField
* HTMLField
* IntegerField
* FloatField
* BooleanField
* UrlField
* EmailField
* FileField
* ImageField

### Installation

Install with pip:

```sh
$ pip install django-mp-config
```

Add config to settings.py:
```
INSTALLED_APPS = [
'site_config',
]
```

Run migrations:
```
$ python manage.py migrate
```
Sync translation fields:
```
$ python manage.py sync_translation_fields
```

### Usage
```
>>> from site_config import config
>>> print config.my_var
```

### Template tags

To get config in template you should load 'site_config' tags and add 'get_site_config' template tag into your template.
Examples:

```
{% load site_config %}

{% get_site_config as config %}

{{ config.my_var }}
```

### Requirements

App require this packages:

* django-modeltranslation
* beautifulsoup4

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mp-config-2.0.tar.gz (9.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page