Skip to main content

Address fields autofill app for forms using brazilian CEP field.

Project description

Travis Python27 Python35 PyPi


This application enables Django powered websites to have autofilled address fields in forms based on brazilian CEP field.


To install django-cep simply run:

pip install django-cep


We need to hook django-cep into our project.

Put cep into your INSTALLED_APPS at settings module:


Bind the cep into your main with something like:

url(r'^cep/', include('cep.urls')),


Currently the only syntax supported is setting the IDs of the address fields in the widget of the CEP field. For other ways to set this up, see the NEXT-STEPS file.

  1. Import the django-cep widget CEPInput in your

    from cep.widgets import CEPInput
  2. Set your CEP field for using the CEPInput, with the correct address fields ID, for example:

    my_cep_field = ChangeToMyCEPFieldModelName(label=u"CEP",
                            help_text="Format: XXXXX-XXX",
                                                     'street': 'id_street_field',
                                                     'district': 'id_district_field',
                                                     'city': 'id_city_field',
                                                     'state': 'id_state_field'
That stands for a street field ID equals id_street_field, district field ID equals id_district_field, city field ID equals id_city_field and a state field ID equals id_state_field.

Also note that the JavaScript used in this app requires JQuery to run properly.

It is highly recommended that you use Django Localflavor’s BRStateChoiceField for the State field, to make it render the correct brazilian state from the list.

Project details

Download files

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

Files for django-cep, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django-cep-1.1.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page