Snippet List
If you require lots of forms in your project and do not want to be creating an extended template for each one I propose this solution.
Classes in the html correspond to bootstrap, you can work without them if you do not use bootstrap.
- template
- django
- dynamic
- fields
- forms
- generic
- generic-views
- html
- form
- bootstrap
- reusable
- custom
- modelform
- crud
- dynamic-form
If you need to use some source to construct your form (maybe some database info or some user input), or you use the same fields with the same functionality in various forms and need to write the same piece of code for each of them, then you are looking in the right place. With this snippet you won't have those issues any more. :P
This snippet present a way to wean the fields from the form.
The code is made using crispy-forms, but the same idea can be applied without using it.
Best luck!
- forms
- filters
- reuse
- reusable
- form-field
- crispy-forms
Use this snippet at the end of your main settings.py file to automagically import the settings defined in each app of `INSTALLED_APPS` that begins with `APPS_BASE_NAME`.
Set `APPS_BASE_NAME` to the base name of your Django project (e.g. the parent directory) and put `settings.py` files in every app directory (next to the `models.py` file) you want to have local settings in.
# works in the Django shell
>>> from django.conf import settings
>>> settings.TEST_SETTING_FROM_APP
"this is great for reusable apps"
Please keep in mind that the imported settings will overwrite the already given and preceding settings, e.g. when you use the same setting name in different applications.
Props to [bartTC](http://www.djangosnippets.org/users/bartTC/) for the idea.
- settings
- import
- reusable
- apps
- applications
3 snippets posted so far.