django-1.6

Django 1.6 and django-registration: built-in authentication views not picked up

左心房为你撑大大i 提交于 2019-12-03 06:57:51
问题 I am trying to upgrade my webapp from Django 1.5 to Django 1.6 and as part of my set of django apps I am using django-registration 1.0. After upgrading to Django 1.6 my app does not recognize the built-in authentication views any more. They are integrated in django registration as can be seen here, but they stopped working. The Django release notes describe a change in the way these views should be integrated, when comparing that to the source code in the registration-app that looks fine. I

Setting up two different types of Users in Django 1.5/1.6

邮差的信 提交于 2019-12-03 01:32:28
问题 Please note--this is an updated version of my original question on this subject, but deserves to be asked again with the change in how Django deals with users and authentication. I'm working on a website with two very different kinds of users--let's call them Customers and Store Owners . Both register on the site, but have very different functionality. Customers simply have a single profile and can shop among the stores that they like. Store Owners have a single account but can have access to

Django 1.6 and django-registration: built-in authentication views not picked up

痞子三分冷 提交于 2019-12-02 20:36:39
I am trying to upgrade my webapp from Django 1.5 to Django 1.6 and as part of my set of django apps I am using django-registration 1.0 . After upgrading to Django 1.6 my app does not recognize the built-in authentication views any more. They are integrated in django registration as can be seen here , but they stopped working. The Django release notes describe a change in the way these views should be integrated , when comparing that to the source code in the registration-app that looks fine. I am introducing the registration urls as follows: urlpatterns = patterns('', ..., url(r'^accounts/',

Setting up two different types of Users in Django 1.5/1.6

久未见 提交于 2019-12-02 14:58:28
Please note--this is an updated version of my original question on this subject, but deserves to be asked again with the change in how Django deals with users and authentication. I'm working on a website with two very different kinds of users--let's call them Customers and Store Owners . Both register on the site, but have very different functionality. Customers simply have a single profile and can shop among the stores that they like. Store Owners have a single account but can have access to multiple stores, and each store can have multiple Store Owners . The exact details of the models don't

Django Rest Framework requesting authentication on AllowAny setting

本小妞迷上赌 提交于 2019-12-02 01:21:31
问题 I've created a JWT-Authorised back end for an app. Login, logout, token retrieval and refresh all work fine, and as expected. I added a registration view this morning, which is throwing the usual "detail": "Authentication credentials were not provided. error you'd expect for non-authenticated requests, as that's the default (see below). However, because this is a registration endpoint, I don't want it to only allow authorised requests. (Having checked with a valid token, the rest of the view

Django Rest Framework requesting authentication on AllowAny setting

你说的曾经没有我的故事 提交于 2019-12-01 20:27:38
I've created a JWT-Authorised back end for an app. Login, logout, token retrieval and refresh all work fine, and as expected. I added a registration view this morning, which is throwing the usual "detail": "Authentication credentials were not provided. error you'd expect for non-authenticated requests, as that's the default (see below). However, because this is a registration endpoint, I don't want it to only allow authorised requests. (Having checked with a valid token, the rest of the view works as expected when you supply authentication.) Looking at the permissions section of the DRF docs ,

How can a form within a formset know it's index within the formset?

故事扮演 提交于 2019-12-01 01:10:47
I have a basic Form subclass with a formset generated such as: MyFormset = formset_factory( MyForm, extra=5, max_num=5, ) I would like to be able to access the index of the form from within the form.save() and form.__init__ methods. trecouvr You can subclass BaseFormSet to pass the index to the form: from django.forms.formsets import BaseFormSet class BaseMyFormSet(BaseFormSet): def add_fields(self, form, index): """A hook for adding extra fields on to each form instance.""" super(BaseMyFormSet, self).add_fields(form, index) # here call a custom method or perform any other required action form

How can a form within a formset know it's index within the formset?

不想你离开。 提交于 2019-11-30 19:54:15
问题 I have a basic Form subclass with a formset generated such as: MyFormset = formset_factory( MyForm, extra=5, max_num=5, ) I would like to be able to access the index of the form from within the form.save() and form.__init__ methods. 回答1: You can subclass BaseFormSet to pass the index to the form: from django.forms.formsets import BaseFormSet class BaseMyFormSet(BaseFormSet): def add_fields(self, form, index): """A hook for adding extra fields on to each form instance.""" super(BaseMyFormSet,

django-allauth: custom user generates IntegrityError at /accounts/signup/ (custom fields are nulled or lost)

て烟熏妆下的殇ゞ 提交于 2019-11-30 15:11:21
I'm trying to integrate django-allauth with a custom user model (subclassed AbstractUser, but when I test the signup form I get an integrity error due to field (date_of_birth) being null, but the value submitted was u'1976-4-6' I'm learning the new custom user stuff, as well as class-based views as I'm learning django-allauth, so I'm confident that I'm doing something wrong, but after a couple days of reading the github issues, the few tutorials, readthedocs, and stackoverflow questions I still have no clear idea of what I'm doing wrong (well I know one thing I'm doing wrong: trying different

Django import error - no module named django.conf.urls.defaults

夙愿已清 提交于 2019-11-29 20:47:43
I am trying to run statsd/graphite which uses django 1.6. While accessing graphite URL, I get django module error File "/opt/graphite/webapp/graphite/urls.py", line 15, in from django.conf.urls.defaults import * ImportError: No module named defaults However, I do not find defaults django package inside /Library/Python/2.7/site-packages/django/conf/urls/ Please help fixing this issue. django.conf.urls.defaults has been removed in Django 1.6 . If the problem was in your own code, you would fix it by changing the import to from django.conf.urls import patterns, url, include However, in your case