• Stars
    star
    1,233
  • Rank 38,074 (Top 0.8 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Let AngularJS play well with Django

django-angular

Let Django play well with AngularJS

Build Status PyPI version Python versions Software license Twitter Follow

Deprecation Warning: AngularJS is dead

Since AngularJS is deprecated now, this library shall not be used for new projects anymore. Instead please proceed with my follow-up project django-formset. All the useful features for Django Form validation have been reimplemented in django-formset, this time in vanilla TypeScript and without depending on any third party package.

What does it offer?

Add AngularJS directives to Django Forms. This allows to handle client side form validation using the constraints provided by the server side Form declaration.

For more information, please visit the demo site.

How to run

git clone https://github.com/jrief/django-angular.git django-angular.git
cd django-angular.git
docker build -t django-angular.git .
docker run -d -it -p 9002:9002 django-angular.git

Open the application at http://{docker-host's-ip}:9002/

Backward Incompatibility

To be compliant with other libraries such as djangorestframework, server-side responses on rejected forms use error code 422, rather than 200. If you use your own form controllers, adopt them accordingly. The JSON format used to communicate errors downstream has changed slightly.

New Features

For a smoother transition path, django-angular added two directives in version 2.0:

<form djng-endpoint="/path/to/endpoint">...</form>, which can be used to upload form data to the server. It also populates the error fields, in case the server rejected some data.

<djng-forms-set endpoint="/path/to/endpoint"><form ...>...</form>...</djng-forms-set> Similar to the above directive, but rather than validating one single form, it validates a set of forms using one shared endpoint.

A promise chain has been introduced. Buttons used to submit form data and then proceed with something else, now can be written as:

<button ng-click="do(update()).then(redirectTo('/path/to/other/page'))">Label</button>

Documentation

Detailed documentation on ReadTheDocs.

Demo on how to combine Django with Angular's form validation.

Please drop me a line, if and where you use this project.

Features

  • Seamless integration of Django forms with AngularJS controllers.
  • Client side form validation for Django forms using AngularJS.
  • Let an AngularJS controller call methods in a Django view - kind of Javascript RPCs.
  • Manage Django URLs for static controller files.
  • Three way data binding to connect AngularJS models with a server side message queue.
  • Perform basic CRUD operations.

Examples

License

Copyright Β© 2019

MIT licensed

More Repositories

1

django-websocket-redis

Websockets for Django applications using Redis as message queue
Python
895
star
2

django-admin-sortable2

Generic drag-and-drop ordering for objects in the Django admin interface
Python
761
star
3

django-sass-processor

SASS processor to compile SCSS files into *.css, while rendering, or offline.
Python
401
star
4

django-formset

The missing widgets and form manipulation library for Django
Python
251
star
5

djangocms-cascade

Build Single Page Applications using the Django-CMS plugin system
Python
165
star
6

django-entangled

Edit JSON-Model Fields using a Standard Django Form.
Python
121
star
7

angular-retina

Add support for Retina displays when using element attribute "ng-src"
JavaScript
120
star
8

djangocms-bootstrap

django-CMS templatetags and HTML snippets to handle the navigation when used in combination with Bootstrap-3/4
HTML
13
star
9

django-nodebow

Just initialized
Python
8
star
10

angular-bootstrap-plus

Additional directives for AngularJS
JavaScript
8
star
11

django-shop-wishlists

Wishlists plugin for django-shop
Python
5
star
12

django-shop-productvariations

Python
5
star
13

django-shop-ipayment

A django-SHOP payment backend for IPayment (https://ipayment.de/)
Python
4
star
14

cookiecutter-djangocms-cascade

Cookiecutter templates to create a django-CMS project using plugins from Cascade
Python
4
star
15

my-shop

Django-SHOP demo generated by cookiecutter-django-shop and used to migrate towards Bootstrap-4
Python
3
star
16

djangocms-reveal

DjangoCMS plugin for presentations based on reveal.js
JavaScript
2
star
17

cmsplugin-text-wrapper

A cms plugin which extends and replaces the text plugin shipped with django-cms with simple wrapper functionalities.
Python
2
star
18

django-girls

Python
1
star