Looking for a Django co-founder
Hi Zack, find me on finddeepak.com Good to connect with you on this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e745bfb5-9ea2-45de-aa86-3b9b98bc80b8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Using signals to populate another model based on new registered user
Simple Answer: DON'T . Resort to signals only when there is No Alternatives left. Using Signals looks tempting but as project grows, it really becomes a Mess to manage each of them. One simply becomes a confused and debugging becomes a real Hell. I suffered from this Problem. hence recommends to Use them as last resort. On Saturday, March 9, 2019 at 8:14:47 PM UTC+5:30, GavinB841 wrote: > > Hi all, > > I am new to working with signals and triggers, what I am trying to > accomplish is: > >1. When a new user registers, I have another model to deal with >subscriptions. >2. I want to create an instance for that subscription model with all >the default values based on the new user. >3. Otherwise no object is created in this model and it has to be done >via a form. > > Would appreciate any help and if any other code is needed let me know. > > *See code below:* > > *Form part of user registration:* > > class ClubInfoForm(forms.ModelForm): > club_address2 = forms.CharField(required=False) > club_address3 = forms.CharField(required=False) > > class Meta(): > model = ClubInfo > fields = ('club_name', 'club_logo', 'club_address1', 'club_address2', > 'club_address3', 'club_town', 'club_county', > 'club_country',) > > def clean_club_name(self): > club_name = self.cleaned_data['club_name'] > if ClubInfo.objects.filter(club_name=club_name).exists(): > raise ValidationError(_("Club already exists")) > return club_name > > *Views for registration:* > > def register(request): > registered = False > if request.method == 'POST': > user_form = UserForm(data=request.POST) > profile_form = ClubInfoForm(data=request.POST) > if user_form.is_valid() and profile_form.is_valid(): > user = user_form.save() > user.set_password(user.password) > user.save() > profile = profile_form.save(commit=False) > profile.user = user > if 'profile_pic' in request.FILES: > print('found it') > profile.profile_pic = request.FILES['profile_pic'] > profile.save() > registered = True > else: > print(user_form.errors, profile_form.errors) > else: > user_form = UserForm() > profile_form = ClubInfoForm() > return render(request, > 'registration.html', > {'user_form': user_form, >'profile_form': profile_form, >'registered': registered}) > > > *Models for club info used upon registration and the model I want to > update when a new user is created:* > > class ClubInfo(models.Model): > > user = models.OneToOneField(User, on_delete=models.CASCADE) > club_name = models.CharField(max_length=50, default='', unique=True) > club_logo = models.ImageField(upload_to='profile_pics', blank=True) > club_address1 = models.CharField(max_length=30) > club_address2 = models.CharField(max_length=30, default='') > club_address3 = models.CharField(max_length=30, default='') > club_town = models.CharField(max_length=30) > club_county = models.CharField(max_length=30) > club_country = models.CharField(max_length=30) > created_date = models.DateTimeField(default=timezone.now) > > def set_default_packages(sender, **kwargs): > if kwargs['created']: > ClubPackages.objects.create(club_id=kwargs['instance']) > > post_save.connect(set_default_packages, sender=club_name) > > def __str__(self): > return self.club_name > > > class ClubPackages(models.Model): > > club_id = models.ForeignKey(ClubInfo, on_delete=models.CASCADE) > PACKAGE_STATUS = ( > ('0', 'Active'), > ('1', 'Not Active') > ) > player_register_package = models.CharField(default='1', max_length=1, > choices=PACKAGE_STATUS) > player_register_price = models.DecimalField(default=100.00, max_digits=8, > decimal_places=2) > player_register_expiry = models.DateField(default=timezone.now) > roster_package = models.CharField(default='1', max_length=1, > choices=PACKAGE_STATUS) > roster_price = models.DecimalField(default=50.00, max_digits=8, > decimal_places=2) > roster_expiry = models.DateField(default=timezone.now) > rent_a_pitch_package = models.CharField(default='1', max_length=1, > choices=PACKAGE_STATUS) > rent_a_pitch_price = models.DecimalField(default=100.00, max_digits=8, > decimal_places=2) > rent_a_pitch_expiry = models.DateField(default=timezone.now) > shop_package = models.CharField(default='1', max_length=1, > choices=PACKAGE_STATUS) > shop_price = models.DecimalField(default=50.00, max_digits=8, > decimal_places=2) > shop_expiry = models.DateField(default=timezone.now). > > > *Séanadh Ríomhphoist/Email DisclaimerTá an ríomhphost seo agus aon
Re: Django Login Error
I recommend :* DON'T,* because it is by default UserIdentifier, It is used to make UserLogins and you have to override a lot of builtIns to achieve what you are trying to do. But if you still want to: `username` validator is defined in AbstractUser Class, and inheritence flow is like: AbstractUser -> User i believe only way to overide this validation is to create a Proxy Model Discussion here: https://groups.google.com/forum/#!topic/django-developers/rb7v9kVAK3I On Sunday, July 29, 2018 at 5:14:23 PM UTC+5:30, lalitaquasoft wrote: > > IntegrityError at /register/ > > UNIQUE constraint failed: superuser_user.username > > > > How to remove Unique username > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9405b6fd-afb1-439e-83f5-e26cb749932f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How can i add my django project to Bitbucket ?
I have created a simple django project and i have created a simple app in it . Now i want to use Bitbucket for code development since we are working in a team how could i possibly do that ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2a4952bd-bf36-42d9-a479-68e95b623ae2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
virtualenv help needed
A year before I developed an applciation in django==1.4.5 version. Few days before I installed virtualenv with django version 1.4.5. In my application I have to place "media" folder inside /usr/local/lib/[ython2.7/dist-package/django/contrib/admin/media but after installating virtualenv I didn't find any django folder inside dist-package. Can anyone help me out with this, how should I allocate proper path to it? Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f7e72e87-c1d0-4065-983d-6e1f1b77ccca%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: django 1.5.2
On Sun, Sep 22, 2013 at 10:46 PM, Harjot Mann wrote: > While upgrading my django version I am getting this error. > > http://202.164.53.122/~harjotmann/error.png In your urls your are passing three arguments but django 1.5.x accept only one, so delete extra arguments. -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: upgrading to 1.5.1
On Sun, Aug 18, 2013 at 12:21 PM, Harjot Mann wrote: > Hello Everyone > Currently I am using django version 1.4.5 and I want to upgrade it to > 1.5.1, I have an app in django. I want to know that what problems will > I face while upgrading to that version. I have no idea about the > features of new version. Any major points which I need to take into > consideration? Basically in your app. what you need is to change templateview at place of direct_to_template and put every url in double quotes "". -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Avatar save
Hello I am using django-avatar croping tool. Image crop well. That cropped image goes to avatar folder which is in /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/avatar/. I want that user save that cropped image to his/her favorite destination (client side). -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Image cropping tool
I want an image cropping tool in my app. It should work like this when i clicked on browse button, after selecting image image cropping tool pop up and image crop and save in it. I am trying to add jcrop image cropping tool but i don't have much knowledge that how i attached it with python as it also contain php file which perform cropping process. I also try pip command but some error occurred so i discard it. I am totally unknown to that process. What should it do :( ? -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: django admin
On Tue, Jul 2, 2013 at 9:05 PM, Kakar Arunachal Service wrote: > I am really confused here Can i change the admin url??? Or does it always > have to be > "www.example.com/admin" ??? Hi, Yes, you can change this. At the place of www.example.com give your IP address or if you are using this on localhost, change same with localhost. -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Registration error
Hi, @Marcin Thanks for the help. I changed whatever you said but new error occurred. error at /accounts/register/ [Errno 2] No such file or directory My url.py file is like this from django.conf.urls.defaults import * from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^accounts/', include('userprofile.urls')), (r'^$', TemplateView.as_view(template_name="index.html")), ) urlpatterns += patterns('souvenir.contact.views', (r'^contact/', 'contact') ) urlpatterns += patterns('souvenir.student.views', (r'^souvenir/fulldetail/', 'fulldetail'), (r'^souvenir/detail/', 'detail'), (r'^souvenir/CE/', 'ce'), (r'^souvenir/ECE/', 'ece'), (r'^souvenir/ME/', 'me'), (r'^souvenir/PE/', 'pe'), (r'^souvenir/CSE/', 'cse'), (r'^souvenir/EE/', 'ee'), (r'^souvenir/IT/', 'it'), ) And my path where my account folder is present is home/souvenir/userprofile/templates/userprofile/account On Tue, Jun 25, 2013 at 4:14 AM, Marcin Szamotulski wrote: > On 16:12 Mon 24 Jun , Deepak Sharma wrote: >> On Mon, Jun 24, 2013 at 3:58 PM, Tom Evans wrote: >> > >> > Looks like you've updated your {% url %} tags to quote the view name, >> > and in this case, you've quoted both the view name and the argument >> > that should be used. This leads django to not find the view name. >> > >> > Eg: {% url "email_validation_process" key %} >> > >> > and not: {% url "email_validation_process key" %} >> >> >> Okay now that error removed but now i am facing new error >> >> TypeError at /accounts/register/complete/ >> __init__() takes exactly 1 argument (3 given) >> >> In my urls under en.py file i have >> >># Registration >> url(r'^register/$', register, name='signup'), >> >> url(r'^register/validate/$', TemplateView, >> {'template' : 'userprofile/account/validate.html'}, >> name='signup_validate'), >> >> url(r'^register/complete/$', TemplateView, >> {'template': 'userprofile/account/registration_done.html'}, >> name='signup_complete'), >> >> -- >> Deepak Kumar Sharma >> Blog: >> http://deekysharma.wordpress.com > > Hi, > > TemplateView is a generic class based view and to get a view function > out of it you need to call its as_view method, the appropriate lines in > your urls.py should be: > > url(r'^register/validate/$', > > TemplateView.as_view(template_name='userprofile/account/validate.html'), > name='signup_validate'), > > also note that template_name is an argument of as_view method rather > than the view it self (which is returned by TemplateView.as_view() > call). The as_view function can set TemplateView class attributes > (which is shared for all classed based views, since it is how the base > View class behaves). Note also that only the TemplateView passes view > arguments (the way you declared them) to the template context. You > can try to read View (and TemplateView) source code, it should clarify > what I have explained here. > > Best regards, > Marcin > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Registration error
On Mon, Jun 24, 2013 at 3:58 PM, Tom Evans wrote: > > Looks like you've updated your {% url %} tags to quote the view name, > and in this case, you've quoted both the view name and the argument > that should be used. This leads django to not find the view name. > > Eg: {% url "email_validation_process" key %} > > and not: {% url "email_validation_process key" %} Okay now that error removed but now i am facing new error TypeError at /accounts/register/complete/ __init__() takes exactly 1 argument (3 given) In my urls under en.py file i have # Registration url(r'^register/$', register, name='signup'), url(r'^register/validate/$', TemplateView, {'template' : 'userprofile/account/validate.html'}, name='signup_validate'), url(r'^register/complete/$', TemplateView, {'template': 'userprofile/account/registration_done.html'}, name='signup_complete'), -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Registration error
I am running an application everything running properly but when i trying to sign-up it displays an error NoReverseMatch at /accounts/register/ Reverse for 'email_validation_process key' with arguments '()' and keyword arguments '{}' not found. Error during template rendering In template /usr/local/lib/python2.7/dist-packages/userprofile/templates/userprofile/email/validation.txt, error at line 6 Reverse for 'email_validation_process key' with arguments '()' and keyword arguments '{}' not found. 1 {% load i18n %} 2 {% blocktrans %}You're receiving this e-mail because you requested an e-mail validation {% endblocktrans %}. 3 4 {% trans "Following this link, you will validate your e-mail address:" %} 5 6 http://{{domain}}{% url "email_validation_process key" %} 7 8 {% trans "Your username, in case you've forgotten:" %} {{ user.username }} 9 10 {% trans "Thanks for using our site!" %} -- Deepak Kumar Sharma Blog: http://deekysharma.wordpress.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Script to move django 1.4.3 to 1.5.1
Hi everyone I just started learning django. Question arises in my mind to write a script, by using that script i wanted to jump django version 1.5.1 without effecting my previous settings or effecting my application which is currently running on django 1.4.3. Is it possible to do that? If yes than how? I have just little bit knowledge about script. Can anyone help me in this process.? Thanks -- Deepak Kumar Sharma -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.