KeyError for CSRF middleware during processing an exception response

2019-09-11 Thread Most. Runa
Fuck me +8801737940981

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/192408c2-c241-4e5a-9099-044a2e1a9f54%40googlegroups.com.


KeyError for CSRF middleware during processing an exception response

2019-09-11 Thread Timothy Gates
If an exception response occurs during the middleware processing it looks 
like the CSRF middleware layer can obscure the issue by getting a KeyError 
exception of its own. The request.META does not contain the CSRF_COOKIE but 
the response handling seems to assume it has already been set. I get the 
error...

File 
"/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py", 
line 34, in inner
 response = get_response(request)
   File 
"/usr/local/lib/python3.6/dist-packages/django/utils/deprecation.py", line 
96, in __call__
 response = self.process_response(request, response)
   File "/usr/local/lib/python3.6/dist-packages/django/middleware/csrf.py", 
line 325, in process_response
 self._set_token(request, response)
   File "/usr/local/lib/python3.6/dist-packages/django/middleware/csrf.py", 
line 189, in _set_token
 request.META['CSRF_COOKIE'],
 KeyError: 'CSRF_COOKIE'


I'd be interested in raising a ticket for this and putting in some code to 
either generate the CSRF Cookie or gracefully ignoring the situation of a 
missing CSRF Cookie. I had a look through the mail archives but couldn't 
find a similar experience which surprised me but I guess the normal 
response is to fix the underlying issue and not worry about the KeyError 
from the CSRF Cookie but I think it would be worth removing the 
red-herring. I also could be way off track so please let me know if this is 
the case.

Thanks,
Tim

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/246c2e11-643a-4425-9742-e4cbf2a5c575%40googlegroups.com.


Re: Problems with "Class Meta" and " __str__"

2019-09-11 Thread Ezequias Rocha
In your base model write a function like this (if your description field is 
called 'name'):

def __str__(self):
return self.name

It works for me.
PS: Take care of python identation. I don't know if your tabulation is the 
same you paste here in forum but it placed wrongly could compromise your 
execution.

Good luck
Ezequias.

On Tuesday, September 10, 2019 at 1:30:28 PM UTC-3, Elmaco7 wrote:
>
> Hello, I do these models but the Django admin page doesn't read the "class 
> Meta" and " __str__".
> This is the models.py document
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *from django.db import models# Create your models here.class 
> Autore(models.Model):nome = models.CharField(max_length=50)cognome 
> = models.CharField(max_length=50)def __str__(self):return 
> self.autore_textclass Meta:verbose_name_plural = "Autori"class 
> Genere(models.Model):descrizione = models.CharField(max_length=30)def 
> __str__(self):return self.genere_textclass Meta:
> verbose_name_plural = "Generi"class Libro(models.Model):titolo = 
> models.CharField(max_length=200)autore = models.ForeignKey(Autore, 
> on_delete=models.CASCADE)genere = models.ForeignKey(Genere, 
> on_delete=models.CASCADE)def __str__(self):return 
> self.libro_textclass Meta:verbose_name_plural = "Libri"*
>
>
> These are the results
>
>
>
>
> Can someone help me?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/131b9bda-ba3c-4ebc-8471-c1fdabb8f5e5%40googlegroups.com.


Re: Get authorization and list users in auth via http request

2019-09-11 Thread Ezequias Rocha
Dear Gabriel

I have already access to the get method but not the creation service.

I will have a creation of thousands of users from another system I am 
integrating. Would be nice if I have an easy way to create this creation 
way by loading from a list.

Have you any idea how could I perform this batch loading of users from 
scratch (and without any register form)?

Sincerely
Ezequias.

On Monday, September 9, 2019 at 7:32:28 PM UTC-3, Gabriel Araya Garcia 
wrote:
>
> ...and why you don't use the Django admin  app ? 
>
> El lun., 9 sept. 2019 a las 15:00, Ezequias Rocha ( >) escribió:
>
>> Hi everyone
>>
>> Could someone tell me if Django encourages the community to implement 
>> auth/user authentication and user creation via http requests?
>>
>> I would like to *create *new users and *get users list* via a simple 
>> POST/GET http requests.
>>
>> Have someone did it here?
>>
>> Sincerely
>> Ezequias
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/eb99b343-bf08-47da-9a5a-dc1bf0ccb797%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Gabriel Araya Garcia
> GMI - Desarrollo de Sistemas Informáticos
> 99.7721.15.70
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aa7d2395-b954-4587-a34a-54c2ba08e83c%40googlegroups.com.


How to inspect MSSQL Database in Django 2.1

2019-09-11 Thread wikils john
I have a large MSSQL server.
I am using it now. I am going to use this database in new django project.
however, inspectdb TableName > models.py this command isn't performed.
How can I fix 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28424f16-ed81-4922-8fd5-6b8c41ca9110%40googlegroups.com.


Re: django-import-export problem with relation of two databases

2019-09-11 Thread Most. Runa
Now i am full sexul mood guys coming my puss kiss

On Wed, 11 Sep 2019, 6:51 a.m. ANi,  wrote:

> Thanks, Jason.
> Then another question, actually why I am asking this is because I am using
> django-export-import,
> I think it is better to have another title.
>
> This is my router, I've set the foreignkey between A Model from default
> database and EmpAXView from emp database.
> django-export-import tells me this:
> no such table: main.View_EmpAX
> or the relation is not allowed.
>
> so I am thinking it is the problem of allow_relation method. but I don't
> get the concept about how to write it..
>
> [image: 擷取.PNG]
>
>
> ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>>
>> Hi,
>>
>> I have my asset table in local db which need to reference to the employee
>> view from another database.
>> But I realized that Django might not allow relations across databases,
>> right?
>>
>> so does it means that I can only store the employee key as string in the
>> asset table?
>> or other way to achieve?
>>
>> many thanks,
>> ANi
>>
>
> ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>>
>> Hi,
>>
>> I have my asset table in local db which need to reference to the employee
>> view from another database.
>> But I realized that Django might not allow relations across databases,
>> right?
>>
>> so does it means that I can only store the employee key as string in the
>> asset table?
>> or other way to achieve?
>>
>> many thanks,
>> ANi
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/19635e18-c095-4cf4-93fa-336a07cb9908%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK1otB%2BFfyLpbtGidBZgP7qG%2BAdpETzHEfONuJphKZp3ffVxeQ%40mail.gmail.com.


null value in column “ProjectName_id” violates not-null constraint

2019-09-11 Thread Robb Rodirguez Jr.
Hello need help on null value in column "ProjectName_id" violates not-null 
constraint, im new to django
i want my ProjectName_id (Foreignkey) is the same/equal id that user choose 
in my majordetails = ProjectNameInviToBid.objects.get(id=sid) please help 
me...

my model views

class ProjectNameInviToBid(models.Model):
ProjectName = models.CharField(max_length=255, verbose_name='Project Name', 
null=True)
DateCreated = models.DateField(auto_now=True)

class InviToBid(models.Model):
today = date.today()
ProjectName = models.ForeignKey('ProjectNameInviToBid', 
on_delete=models.CASCADE)
NameOfFile = models.CharField(max_length=255, verbose_name='Name of File')

my views.py

def project_name_details(request, sid):

majordetails = ProjectNameInviToBid.objects.get(id=sid)

if request.method == 'POST':
form = invitoBidForm(request.POST, request.FILES)
if form.is_valid():
*majordetails = InviToBid.ProjectName*
form.save()
messages.success(request, 'File has been Uploaded')
else:
form = invitoBidForm()

args = {
'majordetails': majordetails,
'form': form

}
return render(request,'content/invitoBid/bacadmininvitoBid.html', args)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f25acfab-8fc3-4597-9905-376d9d27f0b9%40googlegroups.com.


Django redirect to a view function after selecting an item from dropdown box

2019-09-11 Thread Rudolph Louis Cabeltis
Hello,

I am using Forms by Django. And that form has a select box with two options.
After a user selected an option. I would like the user to do the function 
in the django view.
Will I be able to do this without using AJAX or Javascript?

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b55c30b7-09a0-4002-85bc-44f28bf947cd%40googlegroups.com.


django-moderation

2019-09-11 Thread Bernhard Schelling


Python 3.6.8 and django-moderation 0.5.0. I'm using moderation on the cms 
page model. Basic moderation works - but I don't want to moderate the 
creation of new pages, only the publishing of existing ones. 


I'm trying to achieve this by overriding is_auto_approve but the method 
never gets called.


I'm pretty much just starting on django so any input would be highly 
appreciated :)

this is what I'm trying to do in moderation.py


from moderation import moderationfrom moderation.db import ModeratedModelfrom 
moderation.moderator import GenericModeratorfrom cms.models import Page
class PageModerator(GenericModerator):
def is_auto_approve(self, obj, user):
#...check - no moderation for page creation only for publishing 
super(PageModerator, self).is_auto_approve(obj, user)

moderation.register(Page, PageModerator)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6fc9ab4a-65e7-4168-8f63-14b240d60a6b%40googlegroups.com.


Re: Dblink creation from Oracle 11g to postgres

2019-09-11 Thread Peter Mudoko
Inbox me pet...@gmail.com ,



Systems developer

*ANQAD SYSTEMS LTD *

Email *p .mud...@anqad.co.ke
*

Mobile: *+254 7 <%2B254%20729490486>21449067/+255716282017/+254721491491*

*Skype:peter.mudoko15*





On Tue, Sep 10, 2019 at 7:54 PM nitin kumar  wrote:

> Sure, for what we are here.
> How?
>
> On Tue 10 Sep, 2019, 10:18 PM Peter Mudoko,  wrote:
>
>> Hey I have done one can we discuss about it
>>
>> On Tue, 10 Sep 2019, 18:12 nitin kumar,  wrote:
>>
>>> I just want to fetch the data to populate (non editable)in different
>>> interface from Oracle 11g to postgresql.
>>>
>>> How to create the dblink between these two database. What procedure I
>>> have to follow?
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f20f9a61-f6f3-43af-8cde-8024eb55976a%40googlegroups.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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CABfSCxfenog8PgDVm5%3D_zAupV%2ByLsHkhTbfysJaJcg5JQw3BFA%40mail.gmail.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACNQfLGRX_aV5eLZXsF4CuDfOrwJRsE7A7%2BuxyRFKbEjVVbyag%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABfSCxdx6SMHB8qJA_0KkNUWdi2yVB%2BDfstYgB01Q14_d-6nYQ%40mail.gmail.com.