Re: How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Balaji Shetty
Dear Alexis Roda Sir Thank You very much for your nice reply. I check it. On Tue, May 28, 2019 at 1:55 AM Alexis Roda < alexis.roda.villalo...@gmail.com> wrote: > Not an admin expert here. > > You are modifying the modeladmin instance and, by the behavior you're > describing, it looks like it i

Theme for django admin interface.

2019-05-28 Thread Akshay Jain
Hello, Is anyone aware of any django admin theme for creating a dashboard(similar to django-suit). I've been working with django-suit or quite a while now, but as it's way too outdated and python2.7 is also retiring, I want to use the latest version of django and python. But as per the requirement

reagrding "{% csrf_token %}"issue on my web site login module

2019-05-28 Thread The Aryas
hello guys, i was working on a clone project and got stuck on a problem. the {% csrf_token %} that i have applied is not verified ...and the error login module is following>> =

Re: Theme for django admin interface.

2019-05-28 Thread Mayank Priy
I will send you templates link for admin panel On Tue 28 May, 2019, 1:29 PM Akshay Jain, wrote: > Hello, > > Is anyone aware of any django admin theme for creating a dashboard(similar > to django-suit). I've been working with django-suit or quite a while now, > but as it's way too outdated and p

How to use permissions on a CreateView class?

2019-05-28 Thread Fellipe Henrique
Hello, I have these class, based on CreateView class... and I only want allow user with these permissions to add record... class ClienteCreateView(ERPbrViewMixin, CreateView): template_name = 'cadastro/cliente/form.html' permission_required = ('cliente.can_open', 'cliente.can_edit', 'clie

Re: reagrding "{% csrf_token %}"issue on my web site login module

2019-05-28 Thread isorae dennis
Did you indent accurately On Tue, May 28, 2019, 12:32 The Aryas wrote: > hello guys, i was working on a clone project and got stuck on a problem. > the {% csrf_token %} that i have applied is not verified ...and the error > login module is following>> > > > ==

Re: reagrding "{% csrf_token %}"issue on my web site login module

2019-05-28 Thread Jeyakanth T
Hi, add one more line in your view.py header from django.views.decorators.csrf import csrf_exempt then add decorator before your function @csrf_exempt With Regards, Jeyakanth Thangam, +91 89739 - 70708, +91 79046 - 48182 jeyakanth0...@gmail.com On Tue, May 28, 2019 at 5:26 PM isorae de

Re: reagrding "{% csrf_token %}"issue on my web site login module

2019-05-28 Thread Abdulrasheed Ibrahim
For security reasons, It's not recommended to use csrf_exempt, use it only where security doesn't matter On Tue, May 28, 2019, 1:13 PM Jeyakanth T Hi, > add one more line in your view.py header > > from django.views.decorators.csrf import csrf_exempt > > > then add decorator before your function

SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Balaji Shetty
This is the proper code to customize models column userwise. Here we are sharing model among multiple user and depending upon right access, it is visible in admin.py normaluser_fields = ['user','CourtType','SuitType','CaseNumber','CaseYear','CaseAdvocate','CasePartyNames', '

Re: SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Alexis Roda
No, it isn't. It's not thread safe. Changes in shared state in multi-threaded code may lead to race conditions[1]. Depending on your usage it may be very unlikely, but under the right circumstances root may end up having some missing fields in the form or dgp may see fields that it is not intende

Selecting Models by Typing an Identifier

2019-05-28 Thread Derek Dong
I have two questions. The first is: I want to select models in a form. The first is a standard User, the second is a Contest form already defined. Let's take the User as an example. I want to only have to type a string into the form, and have all users with that string as a substring of their us

Model Forms Dynamic

2019-05-28 Thread Yoo
https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/ In the example of model form, they say model = Author Is it possible to set a variable to set the model? Like could I make a variable and set it to whatever model I’d like, then say model = var? -- You received this message because

Re: What's wrong with this model

2019-05-28 Thread Joe Reitman
By default CharField is not Nullable meaning it can't be created with out some data in it. You have two options: Make field nullable: blank=True Or add a default: default=default_text On Monday, May 27, 2019 at 4:52:19 PM UTC-5, Saeed Pooladzadeh wrote: > > Hello > > I made this model and thin

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Joe Reitman
Fellipe, Here is an example of decorating class based views from the documentation : from django.contrib.auth.decorators import login_requiredfrom django.utils.decorators import method_decorator

URL conf error

2019-05-28 Thread Madhur Kabra
I am getting the url conf error. I have attached the relevant files. Thanks for the assistance -- 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+uns

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Jim Illback
I think you can also add to your class (right under your template_name… for example) this statement: permission_required = ‘appname.permission_name' This will limit to logged on users (as below), and also to users who possess this permission. Jim On May 28, 2019, at 9:55 AM, Joe Rei

Re: URL conf error

2019-05-28 Thread anchal agarwal
which version of django you are using? i think it should be url(r'^$', views.index, name=index) On Tue, May 28, 2019 at 11:01 PM Madhur Kabra wrote: > I am getting the url conf error. I have attached the relevant files. > Thanks for the assistance > > -- > You received this message because you

Re: URL conf error

2019-05-28 Thread yavoucko lye
replace name=index by name="index" On Tue, May 28, 2019 at 5:31 PM Madhur Kabra wrote: > I am getting the url conf error. I have attached the relevant files. > Thanks for the assistance > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. >

Display image in template

2019-05-28 Thread anchal agarwal
I want to display image dynamically from the database in a django template. I have used ImageField for this purpose. The code shows no error but it is only displaying an icon of image. This is my template file, here album is the context and album_logo is the variable in which i have stored my image

Re: Display image in template

2019-05-28 Thread Anirudh Jain
You will have to setup MEDIA path f8rst. All your uploded files will be stored in that folder. STATIC path is used only for, well, static content like css and js. On Tue, 28 May 2019, 23:31 anchal agarwal, wrote: > I want to display image dynamically from the database in a django > template. I h

Re: URL conf error

2019-05-28 Thread Madhur Kabra
Thanks for your answer, but it's not working. Could you help me with another solution. On Tuesday, May 28, 2019 at 11:30:19 PM UTC+5:30, youri wrote: > > replace name=index by name="index" > > On Tue, May 28, 2019 at 5:31 PM Madhur Kabra > wrote: > >> I am getting the url conf error. I have att

Re: URL conf error

2019-05-28 Thread Madhur Kabra
I am using Django version 2.2.1 Thanks for your answer, but it's not working. Could you help me with another solution. On Tuesday, May 28, 2019 at 11:18:52 PM UTC+5:30, Anchal Agarwal wrote: > > which version of django you are using? > > i think it should be url(r'^$', views.index, name=index) >

Re: Display image in template

2019-05-28 Thread anchal agarwal
Thanks for the answer but I have already set the MEDIA path here is my urls.py from . import settings from django.contrib.staticfiles.urls import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA

Re: Model Forms Dynamic

2019-05-28 Thread Alexis Roda
Something like that? def model_form_factory(model_class): class MyModelForm(forms.ModelForm): class Meta: model = model_class return MyModelForm AuthorForm = model_form_factory(Author) BookForm = model_form_factory(Book) Missatge de Yoo del dia dt., 28 de maig 2019

Re: Display image in template

2019-05-28 Thread Nitin Kumar
{{ album.album_logo.url }} On Wed, 29 May, 2019, 12:08 AM anchal agarwal Thanks for the answer but I have already set the MEDIA path > here is my urls.py > from . import settings > from django.contrib.staticfiles.urls import static > from django.contrib.staticfiles.urls import staticfiles_urlpat

Re: Display image in template

2019-05-28 Thread Joe Reitman
Have you looked in inspector on your browser to see if the URL is correctly rendered in IMG SRC? Have you installed Pillow? ImageField requires python Pillow. On Tuesday, May 28, 2019 at 1:38:49 PM UTC-5, Anchal Agarwal wrote: > > Thanks for the answer but I have already set the MEDIA path > he

Re: URL conf error

2019-05-28 Thread Victor H. Velasquez Rizo
Hi Madhur. On your urls.py, *change: *url('^$', views.index, name=index), *to:* url('^$', views.index, name="index"), I assume that you imported the *views.* On Tue, May 28, 2019 at 12:31 PM Madhur Kabra wrote: > I am getting the url conf error. I have attached the relevant files. > Thanks fo

Re: URL conf error

2019-05-28 Thread Joe Reitman
What do your views look like? I see you have an app named 'music' in your project URL Config that includes 'music.urls'. Your music app URL Config has a single view that calls the index view. When you type 127.0.0.1/music/ in the browser address bar you should see your index page. Is the index

Where to find my web app within mysite directory ?

2019-05-28 Thread Joseph Jones
Hello fellow community members, > > I’m working on a Django project using PyCharm on my pc. I’ve run command > ‘>py manage.py startapp hypotheticalapp’. > To ensure my app does in fact exist However if I enter into my mysite > directory on file explorer the ‘hypotheticalapp’ file is nowhere to be >

Re: Display image in template

2019-05-28 Thread anchal agarwal
Thanks Nitin. It worked !! -- 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

linking HTML form with database directly without ModelForm

2019-05-28 Thread Fatukasi Kayode
*fase.html* Email address: Phone: the models.py contains email and phone number also -- 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,

Formtools Wizard and Modelform saving data

2019-05-28 Thread Simon John
I am trying to save data to db after all the three from have submited and still getting and error, any work around -- 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

SAVING DATA IN FORMTOOL WIZARD MODELFORM

2019-05-28 Thread Simon John
Hi Any one can help on how to save data using formtool wizard and Modelform The view of my models and form and views and the error are here -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Re: How to use permissions on a CreateView class?

2019-05-28 Thread Fellipe Henrique
Hi Jim, Tried that, as you can see on my code, but not working.. when user type the url, still see the template.. Any suggestions? Regards, T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https:/

How to disable the the Delete button

2019-05-28 Thread Mike Dewhirst
Django 1.11 and Python 3.6 but upgrading to Django 2.2 (slowly) Currently I use a get_readonly_fields callable in the Admin as documented[1]. The callable determines whether request.user is allowed to edit the editable fields or not. This works well. However, the readonly user can still see/u

problem with form

2019-05-28 Thread Saeed Pooladzadeh
Hi I'm trying to make a simple crud applicatio and learn from it. I wonder why my form can't save the data. Here cames my view: from django.shortcuts import render from saeed.forms import SmodelForm from saeed.models import Smodel from django.shortcuts import render, redirect # Create you

[Solved] How to disable the the Delete button

2019-05-28 Thread Mike Dewhirst
I asked too soon. Sorry. There is a method in contrib.admin.options.BaseModelAdmin called ... def has_delete_permission(self, request, obj=None): """ Returns True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj`

[Solved] How to disable the the Delete button

2019-05-28 Thread Mike Dewhirst
(I hate my email formatting) - - - - - - - - - - - - - - - - - - - - - - I asked too soon. Sorry. There is a method in contrib.admin.options.BaseModelAdmin called ... def has_delete_permission(self, request, obj=None): """ Returns True if the given requ

need help - following django tutorial to create polls database - missing "on delete cascade" - using django 2.2.1 with mysql 8.0

2019-05-28 Thread K Tan
Hi, everyone, This is my first time using Django and I think I'm missing something or there is a bug. I am following the instructions on ( https://docs.djangoproject.com/en/2.2/intro/tutorial02/) and I've just added the following chunk of code to "polls/models.py". (I copied/pasted so I know it's

Re: problem with form

2019-05-28 Thread Anirudh Jain
Can you please send the screenshot or text of error. Also, try - form.save(commit=False) On Wed, 29 May 2019, 04:53 Saeed Pooladzadeh, wrote: > Hi > > I'm trying to make a simple crud applicatio and learn from it. I wonder > why my form can't save the data. Here cames my view: > > from django.sh

Re: Where to find my web app within mysite directory ?

2019-05-28 Thread Anirudh Jain
If the command you had run did not show any error, then it should be in the same folder as that of manage.py On Wed, 29 May 2019, 01:16 Joseph Jones, wrote: > > > Hello fellow community members, >> >> I’m working on a Django project using PyCharm on my pc. I’ve run command >> ‘>py manage.py star