# A Bulma Theme for Django Projects
![Django Bulma](https://raw.githubusercontent.com/timonweb/django-bulma/master/assets/django-bulma-logo.png)
A Django base theme based on Bulma ([bulma.io](https://bulma.io/)). Bulma is a modern CSS framework based on Flexbox.
*** work in progress ***
## Installation
1. Install the python package django-bulma from pip
``pip install django-bulma``
Alternatively, you can install download or clone this repo and call ``pip install -e .``.
2. Add to INSTALLED_APPS in your **settings.py**:
`'bulma',`
3. If you want to use the provided base template, extend from **bulma/base.html**:
```
{% extends 'bulma/base.html' %}
{% block title %}Bulma Site{% endblock %}
{% block content %}
Content goes here...
{% endblock content %}
```
4. If you want to customize bulma sass and your own components:
4.1 Copy bulma static files into your project's **STATIC_ROOT**:
```
python manage.py copy_bulma_static_into_project
```
You should see **bulma** dir appeared in your **STATIC_ROOT**. It contains
two dirs:
* **sass** - this is the place where you can put your own sass code and customize
bulma variables
* **css** - this is where compiled sass output goes, you should link this file
in your base.html
4.2 Install npm packages for sass compilation to work:
```
python manage.py bulma install
```
4.3 Start sass watch mode:
```
python manage.py bulma start
```
5. For forms, in your templates, load the `bulma_tags` library and use the `|bulma` filters:
##### Example template
```django
{% load bulma_tags %}
{# Display a form #}
<form action="/url/to/submit/" method="post">
{% csrf_token %}
{{ form|bulma }}
<div class="field">
<button type="submit" class="button is-primary">Login</button>
</div>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
```
## Included templates
**django-bulma** comes with:
* a base template,
* django core registration templates,
## Bugs and suggestions
If you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.
[https://github.com/timonweb/django-bulma/issues](https://github.com/timonweb/django-bulma/issues)
Raw data
{
"_id": null,
"home_page": "https://timonweb.com",
"name": "django-bulma",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "django, css, bulma, theme",
"author": "Tim Kamanin",
"author_email": "tim@timonweb.com",
"download_url": "https://files.pythonhosted.org/packages/52/5d/3ce5150e28bfc503e4e1f8eadf11956a42e87ba583687c15d0b2c336e7bb/django_bulma-0.9.0.tar.gz",
"platform": null,
"description": "# A Bulma Theme for Django Projects\n\n![Django Bulma](https://raw.githubusercontent.com/timonweb/django-bulma/master/assets/django-bulma-logo.png)\n\nA Django base theme based on Bulma ([bulma.io](https://bulma.io/)). Bulma is a modern CSS framework based on Flexbox.\n\n*** work in progress ***\n\n## Installation\n\n1. Install the python package django-bulma from pip\n\n ``pip install django-bulma``\n\n Alternatively, you can install download or clone this repo and call ``pip install -e .``.\n\n2. Add to INSTALLED_APPS in your **settings.py**:\n\n `'bulma',`\n\n3. If you want to use the provided base template, extend from **bulma/base.html**:\n\n ```\n {% extends 'bulma/base.html' %}\n\n {% block title %}Bulma Site{% endblock %}\n\n {% block content %}\n Content goes here...\n {% endblock content %}\n\n ```\n \n4. If you want to customize bulma sass and your own components:\n\n 4.1 Copy bulma static files into your project's **STATIC_ROOT**:\n\n ```\n python manage.py copy_bulma_static_into_project\n ``` \n You should see **bulma** dir appeared in your **STATIC_ROOT**. It contains\n two dirs:\n * **sass** - this is the place where you can put your own sass code and customize\n bulma variables\n * **css** - this is where compiled sass output goes, you should link this file\n in your base.html \n\n 4.2 Install npm packages for sass compilation to work: \n \n ```\n python manage.py bulma install\n ```\n \n 4.3 Start sass watch mode:\n ```\n python manage.py bulma start\n ```\n\n5. For forms, in your templates, load the `bulma_tags` library and use the `|bulma` filters:\n\n ##### Example template\n \n ```django\n\n {% load bulma_tags %}\n\n {# Display a form #}\n\n <form action=\"/url/to/submit/\" method=\"post\">\n {% csrf_token %}\n {{ form|bulma }}\n <div class=\"field\">\n <button type=\"submit\" class=\"button is-primary\">Login</button>\n </div>\n <input type=\"hidden\" name=\"next\" value=\"{{ next }}\"/>\n </form>\n ```\n\n## Included templates\n\n**django-bulma** comes with:\n* a base template,\n* django core registration templates,\n\n## Bugs and suggestions\n\nIf you have found a bug or if you have a request for additional functionality, please use the issue tracker on GitHub.\n\n[https://github.com/timonweb/django-bulma/issues](https://github.com/timonweb/django-bulma/issues)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Bulma CSS Framework for Django projects",
"version": "0.9.0",
"project_urls": {
"Homepage": "https://timonweb.com"
},
"split_keywords": [
"django",
" css",
" bulma",
" theme"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "baecb8506f8b72c5b65d49faac0efc1b4526e0171d250c4af513664074ac49e1",
"md5": "223f13caee05429c5383dce62a419244",
"sha256": "5db8973724629b6b733c6ea836b7c1b2d79d46ecab3c8fe25d235ba5e677dd1b"
},
"downloads": -1,
"filename": "django_bulma-0.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "223f13caee05429c5383dce62a419244",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 205692,
"upload_time": "2024-06-26T09:49:24",
"upload_time_iso_8601": "2024-06-26T09:49:24.996808Z",
"url": "https://files.pythonhosted.org/packages/ba/ec/b8506f8b72c5b65d49faac0efc1b4526e0171d250c4af513664074ac49e1/django_bulma-0.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "525d3ce5150e28bfc503e4e1f8eadf11956a42e87ba583687c15d0b2c336e7bb",
"md5": "138285813921f16c559f56f36ab5b3c9",
"sha256": "755939a7433d4db0f2e599582e0f7403e2f932f1e87c72e4fa277ba84132e233"
},
"downloads": -1,
"filename": "django_bulma-0.9.0.tar.gz",
"has_sig": false,
"md5_digest": "138285813921f16c559f56f36ab5b3c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 196805,
"upload_time": "2024-06-26T09:49:26",
"upload_time_iso_8601": "2024-06-26T09:49:26.591232Z",
"url": "https://files.pythonhosted.org/packages/52/5d/3ce5150e28bfc503e4e1f8eadf11956a42e87ba583687c15d0b2c336e7bb/django_bulma-0.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-26 09:49:26",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "django-bulma"
}