django-vkontakte-iframe 0.4

Django app for developing (aka iframe applications
django-vkontakte-iframe is a Django app for developing (aka largest, Russian social network) iframe applications.

Handles user authentication and registration.


pip install django-vkontakte-iframe


 * vkontakte >= for populating cities and countries info via admin action
 * django-webtest >= 1.2.2 for tests


 1. Register and configure vkontakte iframe application here:
 2. Add your app's settings to

 VK_APP_ID = '1234567' # Application ID
 VK_APP_KEY = 'M1gytuHwni' # Application key
 VK_APP_SECRET = 'MiRFwrDYwcYFCTD18EcY' # Secure key

 3. Add 'vk_iframe' to INSTALLED_APPS
 4. Add 'vk_iframe.backends.VkontakteUserBackend' to AUTHENTICATION_BACKENDS:


 5. Put 'vk_iframe.middleware.AuthenticationMiddleware' and 'vk_iframe.middleware.LoginRequiredMiddleware' to the end of MIDDLEWARE_CLASSES:

 # ...

 Vkontakte visitors will be automatically registered and authorized as django users (username == vkontakte user id).

 LoginRequiredMiddleware is an optional. It returns 403 for all unauthorized requests with urls not listed in settings.PUBLIC_URLS. You should enable it for security reasons. Example of PUBLIC_URLS:


 6. Run python ./ syncdb (or python ./ migrate vk_iframe if South is used)
 7. Optional: load initial geo data (cities and countries):

 python manage loaddata vk-geo

 8. If you want to store more user data then put the following line as the 'First API request' ('Первый запрос к API') option (in your app edit page at


 9. That's all. All your app's visitors are now registered and authenticated django users. Additional profile data is available as user.vk_profile.

last updated on:
November 29th, 2011, 20:53 GMT
license type:
MIT/X Consortium License 
developed by:
Mikhail Korobov
ROOT \ Internet \ Django Plugins
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!
What's New in This Release:
  • request.vk_api with vkontakte.API instance (thanks Anton Smirnov);
  • Workaround for AttributeError in (thanks Evgeniy Kirov);
  • Improved Safari cookie fix (thanks Domantas Jackūnas);
  • IFrameFixMiddleware works now if user agent is not set (thanks Evgeniy Kirov).
read full changelog

Add your review!