Skip to main content

Help building extra widgets for forms and speciall methods to render forms in templates

Project description

This app helps you to integrate Django apps with Gentelella building extra widgets for forms and speciall methods to render forms in templates.

See Documentation

Installation

Installing from repository (Updated frequently, most of great functionalities are not in pip yet ).

pip install git+https://github.com/luisza/django-gentelella-widgets.git#egg=djgentelella

An stable version on pip, but not all available widget are in this release (new release comming soon)

pip install djgentelella

Configure your settings

INSTALLED_APPS = [ ..
    'djgentelella',
    'rest_framework',
    'markitup',
]
MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
MARKITUP_SET = 'markitup/sets/markdown/'
JQUERY_URL = None

Run migrations

python manage.py migrate

Create statics files downloading from internet (you need to install requests for this step).

pip install requests
python manage.py loaddevstatic

Add djgentelella urls in your project urls.py file

from djgentelella.urls import urlpatterns as djgentelellaurls

urlpatterns = djgentelellaurls + [
                ...
              ]

Usage

In forms

from djgentelella.forms.forms import GTForm
from djgentelella.widgets import core as genwidgets

class myform(GTForm, forms.ModelForm):
    class Meta:
        model = MyObject
        fields = '__all__'
        widgets = {
            'name': genwidgets.TextInput,
            'borddate': genwidgets.DateInput,
            'email': genwidgets.EmailMaskInput
        }

In templates working with forms

{{ form.as_plain }}
{{ form.as_inline }}
{{ form.as_horizontal }}

In templates using base template

{% extends 'gentelella/base.html' %}

Take a look this file to note the template block that you can overwrite

Test

To run the all test use:

cd demo
python manage.py test

To run the responsive test use:

cd demo
python manage.py test demoapp.tests.selenium.responsive

Run the demo

cd demo
python manage.py migrate
python manage.py createdemo
python manage.py demomenu

And More see demo app.

Notes for development

base.js is autogenerated so you need to call

python manage.py createbasejs

Remember update the package version before make deploy it on server.

sudo apt install node-babel-cli npm webpack

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

djgentelella-0.3.16.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

djgentelella-0.3.16-py3-none-any.whl (5.2 MB view details)

Uploaded Python 3

File details

Details for the file djgentelella-0.3.16.tar.gz.

File metadata

  • Download URL: djgentelella-0.3.16.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.2

File hashes

Hashes for djgentelella-0.3.16.tar.gz
Algorithm Hash digest
SHA256 cb4bd0ca522c7f8cd9aa5508160cd002756d635f75dfb978fa9d94f1b3ee7446
MD5 42ba1dae25ae92d46c57362084c13257
BLAKE2b-256 6b90fea77d9709bcd548aec78d0fe08d713058f63f4943b734ec721b837ebec7

See more details on using hashes here.

Provenance

File details

Details for the file djgentelella-0.3.16-py3-none-any.whl.

File metadata

File hashes

Hashes for djgentelella-0.3.16-py3-none-any.whl
Algorithm Hash digest
SHA256 4548c8d57b12d5f5ad46014abd07bb7210b2a00243ff50f8fc049dc3dc67a28a
MD5 c5a1a14d9ef8de312f3a0ec9fc22e923
BLAKE2b-256 5ddcf49441bf916ecb74f499b97a556669d635866cfaf2313c70bcc5013b18d4

See more details on using hashes here.

Provenance

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