Saving xlsx on to the clients file folder

2021-04-01 Thread Django-Learner_27
Dear members,

I have a requirement, where I need to save .xlsx file onto clients local 
folder.

The moment when I click choose folder then immediately it has to show file 
browser with save/save as option to save file based on users choice.

Thanks in advance.
Venu

-- 
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/f0d7a711-debc-4bb4-acbd-396233d90a96n%40googlegroups.com.


Re: How to avoid select lists on formsets and ManyToMany?

2021-04-01 Thread Ryan Nowakowski
Django admin does something like this with raw_id_fields[1]. I think it works 
by just swapping out the form widget. But you could take a look at the admin 
code to see for sure.

[1] 
https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields

On April 1, 2021 10:23:03 PM CDT, Clive Bruton  wrote:
>I have a ManyToMany model set, that on the edit uses a formset to add/ 
>edit rows. I have this working, but the unfortunate part of it is  
>that the select that results from the ManyToMany relationship  
>populates with 16,000 records.
>
>What I would like to do is, once the records are added, just have the  
>delete checkbox and show the 'description' field (uneditable) next to  
>it), and, rather than add records through a huge select list, add the  
>records by id.
>
>To sketch it out, this is how it is:
>
>
> <'Profile.directory-optin' checkbox>
>
> <'Profile.directory-desc'>
>
> <'Class.description' huge select>
>
> 
>
> 
>
> <'Class.description' huge select>
>
> 
>
> 
>
> <'Class.description' huge select>
>
> 
>
> 
>
> 
>
> <'Class.description' huge select>
>
> 
>
> 
>
> 
>
>
>
>And I'd rather it was something like:
>
>
> <'Profile.directory-optin' checkbox>
>
> <'Profile.directory-desc'>
>
>  
>
> 
>
>  
>
> 
>
>  
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>The database tables look something like:
>
>
>Profile  Join table   Class
>===  ==   =
>
>id   id   id
>directory-optin  profile-id   description
>directory-desc   class-id
>
>
>
>Hope someone can help me out!
>
>
>-- Clive
>
>-- 
>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/E30F44E6-07DA-4703-BAB1-BE295C72EF22%40indx.co.uk.

-- 
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/75F0A15E-150A-4F74-BC98-2AE067B843AB%40fattuba.com.


How to avoid select lists on formsets and ManyToMany?

2021-04-01 Thread Clive Bruton
I have a ManyToMany model set, that on the edit uses a formset to add/ 
edit rows. I have this working, but the unfortunate part of it is  
that the select that results from the ManyToMany relationship  
populates with 16,000 records.


What I would like to do is, once the records are added, just have the  
delete checkbox and show the 'description' field (uneditable) next to  
it), and, rather than add records through a huge select list, add the  
records by id.


To sketch it out, this is how it is:


<'Profile.directory-optin' checkbox>

<'Profile.directory-desc'>

<'Class.description' huge select>





<'Class.description' huge select>





<'Class.description' huge select>







<'Class.description' huge select>









And I'd rather it was something like:


<'Profile.directory-optin' checkbox>

<'Profile.directory-desc'>

 



 



 














The database tables look something like:


Profile  Join table   Class
===  ==   =

id   id   id
directory-optin  profile-id   description
directory-desc   class-id



Hope someone can help me out!


-- Clive

--
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/E30F44E6-07DA-4703-BAB1-BE295C72EF22%40indx.co.uk.


Re: Trying to understand duplicate results from related_set

2021-04-01 Thread Ryan Nowakowski
Maybe it has something to do with the fact that once you start iterating 
through a query set it gets evaluated[1]. If you slice a query set before it 
gets evaluated that is different than slicing a query set after it gets 
evaluated. I'm not exactly sure why you're getting different results but 
perhaps it has something to do with the evaluated/not evaluated query set 
behavior.

[1] 
https://docs.djangoproject.com/en/3.1/ref/models/querysets/#when-querysets-are-evaluated



On March 31, 2021 12:06:48 AM CDT, Michael Ross  wrote:
>Hello,
>
>my first post here.
>I've been poking at this duplicate result thing
>and it's come down to maybe a fundamental what-does-django-do question:
>
>
>class Medium(models.Model):
>artifact = models.ForeignKey('Artifact', on_delete=models.PROTECT) 
>
>
>class Artifact(models.Model):
>def get_medium(self,idx):
>
>try:
>media = self.medium_set.all()
>for m in media:  # <-- THIS
>pass # <-- THIS
>return media[idx]
>except:
>return False
>
>
>Why would iterating over media give me correct results,
>   get_medium(0), get_medium(1) == 9, 13
>
>but if I don't, I get a duplicate row?
>   get_medium(0), get_medium(1) == 9, 9
>
>
>-Michael
>
>
>
>-- 
>Michael Ross 
>
>-- 
>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/20210331070648.1c3915a6f0ccc8a0d69db31a%40ross.cx.

-- 
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/FF582BAC-42CF-4158-9312-5024DC1671FC%40fattuba.com.


Re: AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread Gabriel Araya Garcia
Why you don't explain better your problem ? When appear that

Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




El jue, 1 abr 2021 a las 15:43, Mahendra ()
escribió:

> I think given name is wrong Hlo do you have any idea posting form data?
>
> Mahendra Yadav
>
> On Thu, 1 Apr 2021, 22:32 Salima Begum, 
> wrote:
>
>> Hi all,
>>
>> How to solve this errors
>> ```
>> AttributeError: 'customer' object has no attribute 'is_authenticated'
>> ```
>>
>> ```
>>   AttributeError: 'customer' object has no attribute 'is_anonymous'
>> ```
>>
>> How can I solve this above errors. Help me.
>>
>> Thanks
>> ~Salima
>>
>> --
>> 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/CAMSz6bkcDZeFhhStQeTOeLAst1kNA1xa%2BuVsd0sva1JA0P8kMw%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/CAN-6G3x_vyJcBsfQ-pfN3AgK1-V_SVPSt3Fk6h%2ByLnU4iKorkg%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/CAKVvSDCxW%3DcKpko_oxduQkZyCO00t1tRjbJ55fBTf%3DhjZj6-3g%40mail.gmail.com.


Re: AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread sebasti...@gmail.com
I think this must be wrong. Only User instance have a method 
is_authenticated. Here a example for views:

if request.user.is_authenticated:
   pass

sali...@rohteksolutions.com schrieb am Donnerstag, 1. April 2021 um 
19:03:36 UTC+2:

> Hi all,
>
> How to solve this errors
> ```
> AttributeError: 'customer' object has no attribute 'is_authenticated'
> ```
>
> ```
>   AttributeError: 'customer' object has no attribute 'is_anonymous'  
> ```
>
> How can I solve this above errors. Help me.
>
> Thanks
> ~Salima
>

-- 
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/3e9ee7e0-0616-4150-a778-75e9660b5fb1n%40googlegroups.com.


Re: AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread Mahendra
I think given name is wrong Hlo do you have any idea posting form data?

Mahendra Yadav

On Thu, 1 Apr 2021, 22:32 Salima Begum, 
wrote:

> Hi all,
>
> How to solve this errors
> ```
> AttributeError: 'customer' object has no attribute 'is_authenticated'
> ```
>
> ```
>   AttributeError: 'customer' object has no attribute 'is_anonymous'
> ```
>
> How can I solve this above errors. Help me.
>
> Thanks
> ~Salima
>
> --
> 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/CAMSz6bkcDZeFhhStQeTOeLAst1kNA1xa%2BuVsd0sva1JA0P8kMw%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/CAN-6G3x_vyJcBsfQ-pfN3AgK1-V_SVPSt3Fk6h%2ByLnU4iKorkg%40mail.gmail.com.


AttributeError: 'customer' object has no attribute 'is_authenticated'

2021-04-01 Thread Salima Begum
Hi all,

How to solve this errors
```
AttributeError: 'customer' object has no attribute 'is_authenticated'
```

```
  AttributeError: 'customer' object has no attribute 'is_anonymous'
```

How can I solve this above errors. Help me.

Thanks
~Salima

-- 
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/CAMSz6bkcDZeFhhStQeTOeLAst1kNA1xa%2BuVsd0sva1JA0P8kMw%40mail.gmail.com.


Re: Django asychronous for millions of users

2021-04-01 Thread Josh moten
Samuel,

Thank you for that tremendous insight; sad to say you are correct on me trying 
to plan for the future of scaling. I am so use to having to plan ahead and have 
a backup for my backup which has a series of more backup to the original plan.  
I still operate as if I am still in the Marine Corps so thank you for helping 
me to see that I should first start simple with a simple deployment and later 
scale as my users grow. The thing I am trying to plan correct for scaling is 
the asynchronous technology part which from the conversations thus far from 
Lars and the rest I have found out about load balancer and cacheing. Thank you 
so much

Sent from my iPhone

> On Apr 1, 2021, at 11:17 AM, Samuel Smith  wrote:
> 
> On 3/30/21 6:32 AM, Josh moten wrote:
>> I am creating an auction that will be hosting millions to possibly billions 
>> of users so I am trying to figure out which would be the best library to use 
>> for scalability at a rapid pace. I am positive to reach a million users in 
>> four months. What is the best library and/or package to us for over 100k+ 
>> users per second?
>> -- 
>> 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/b0ed59a5-5892-4a0e-b159-adc89476da78n%40googlegroups.com
>>  
>> .
> 
> Just being "asychronous" won't get you there. Start small and make sure you 
> are treating your database right. Use database views to limit excessive 
> queries and to better aggregate your data instead of trying to stuff 
> everything into a python object. Use a CDN to host as much static files as 
> possible and even provide limited caching.
> 
> And above all, don't plan out your "scaling" problems until you actually have 
> enough money flowing to do so. I once worked for a startup that planned out 
> having over a million customers on one platform. This was before the days of 
> cheap AWS instances and so we allocated the needed resources and rack space 
> in a data center and paid for expensive licensed software that was "web 
> scale". We were spending over 1.5 million a year on hosting and software 
> license costs. After 5 years we had finally grown to 70,000 customers but 
> that still did not cover the costs of running the company and after a couple 
> more years, closed shop.
> 
> If we would have just started off simple with single django instance running 
> on a box in a closet somewhere that company would probably still exist. They 
> had a good product and market, but planning for a hypothetical future killed 
> it.
> 
> Regards,
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Django users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/django-users/7XmCZgz3XzI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/fb8588ae-6297-c6a9-6512-632e9876caa0%40net153.net.

-- 
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/EE907634-3F23-4A97-82A1-AFB96E056EFB%40gmail.com.


Re: Django asychronous for millions of users

2021-04-01 Thread Samuel Smith

On 3/30/21 6:32 AM, Josh moten wrote:
I am creating an auction that will be hosting millions to possibly 
billions of users so I am trying to figure out which would be the best 
library to use for scalability at a rapid pace. I am positive to reach a 
million users in four months. What is the best library and/or package to 
us for over 100k+ users per second?


--
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/b0ed59a5-5892-4a0e-b159-adc89476da78n%40googlegroups.com 
.


Just being "asychronous" won't get you there. Start small and make sure 
you are treating your database right. Use database views to limit 
excessive queries and to better aggregate your data instead of trying to 
stuff everything into a python object. Use a CDN to host as much static 
files as possible and even provide limited caching.


And above all, don't plan out your "scaling" problems until you actually 
have enough money flowing to do so. I once worked for a startup that 
planned out having over a million customers on one platform. This was 
before the days of cheap AWS instances and so we allocated the needed 
resources and rack space in a data center and paid for expensive 
licensed software that was "web scale". We were spending over 1.5 
million a year on hosting and software license costs. After 5 years we 
had finally grown to 70,000 customers but that still did not cover the 
costs of running the company and after a couple more years, closed shop.


If we would have just started off simple with single django instance 
running on a box in a closet somewhere that company would probably still 
exist. They had a good product and market, but planning for a 
hypothetical future killed it.


Regards,

--
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/fb8588ae-6297-c6a9-6512-632e9876caa0%40net153.net.


Re: 'WSGIRequest' object has no attribute

2021-04-01 Thread sebasti...@gmail.com
I have found my failure. Thanks

sebasti...@gmail.com schrieb am Donnerstag, 1. April 2021 um 18:00:57 UTC+2:

> Hello,
>
> model.py:
>
> class UserSettings(models.Model):
> user_link = models.OneToOneField(
> User,
> on_delete=models.CASCADE,
> related_name="usersettings_address",primary_key=True,)
>
> and i have a mixin:
>
> class ListviewMixin():
>
> def get_queryset(self):
> print("Order "+str(self.request.usersettings_address.list_orderby))
>
> now i get a exception:
>
> AttributeError at /
> 'WSGIRequest' object has no attribute 'usersettings_address'
> Request Method: GET
> Request URL: http://127.0.0.1:8001/
> Django Version: 3.1.7
> Exception Type: AttributeError
> Exception Value: 
> 'WSGIRequest' object has no attribute 'usersettings_address'
> Exception Location: 
> /home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, 
> line 15, in get_queryset
> Python Executable: /usr/bin/python3
> Python Version: 3.8.5
> Python Path: 
> ['/home/sebastian/PycharmProjects/verwaltung',
>  '/usr/lib/python38.zip',
>  '/usr/lib/python3.8',
>  '/usr/lib/python3.8/lib-dynload',
>  '/home/sebastian/.local/lib/python3.8/site-packages',
>  '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk',
>  '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk/demo',
>  '/usr/local/lib/python3.8/dist-packages',
>  '/usr/lib/python3/dist-packages',
>  '/usr/lib/python3.8/dist-packages']
> Server time: Thu, 01 Apr 2021 15:55:29 +
> Traceback Switch to copy-and-paste view
> /home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/exception.py,
>  
> line 47, in inner
> response = get_response(request) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/base.py,
>  
> line 181, in _get_response
> response = wrapped_callback(request, *callback_args, 
> **callback_kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
>  
> line 70, in view
> return self.dispatch(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/utils/decorators.py,
>  
> line 43, in _wrapper
> return bound_method(*args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/contrib/auth/decorators.py,
>  
> line 21, in _wrapped_view
> return view_func(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
>  
> line 98, in dispatch
> return handler(request, *args, **kwargs) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 78, in get
> self.filterset = self.get_filterset(filterset_class) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 44, in get_filterset
> kwargs = self.get_filterset_kwargs(filterset_class) …
> ▶ Local vars
> /home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
> line 57, in get_filterset_kwargs
> 'queryset': self.get_queryset(), …
> ▶ Local vars
> /home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, line 
> 15, in get_queryset
> print("Order 
> "+str(self.request.usersettings_address.list_orderby)) …
> ▶ Local vars
> Request information
> USER
> root
>
> GET
> No GET data
>
> POST
> No POST data
>
> FILES
> No FILES data
>
> COOKIES
> Variable Value
> csrftoken 
> '15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
> sessionid 
> 'm4julix8y4zyczcuq2tlnf6zzwjlkluc'
> META
> Variable Value
> CINNAMON_VERSION 
> '4.8.6'
> COLORTERM 
> 'truecolor'
> CONTENT_LENGTH 
> ''
> CONTENT_TYPE 
> 'text/plain'
> CSRF_COOKIE 
> '15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
> DBUS_SESSION_BUS_ADDRESS 
> 'unix:path=/run/user/1000/bus'
> DESKTOP_SESSION 
> 'cinnamon'
> DISPLAY 
> ':0'
> DJANGO_SETTINGS_MODULE 
> 'emailmarketing.settings'
> GATEWAY_INTERFACE 
> 'CGI/1.1'
> GDMSESSION 
> 'cinnamon'
> GDM_LANG 
> 'de_DE'
> GJS_DEBUG_OUTPUT 
> 'stderr'
> GJS_DEBUG_TOPICS 
> 'JS ERROR;JS LOG'
> GNOME_DESKTOP_SESSION_ID 
> 'this-is-deprecated'
> GNOME_TERMINAL_SCREEN 
> '/org/gnome/Terminal/screen/0493dca5_c60d_4d79_a657_8d6130e31a36'
> GNOME_TERMINAL_SERVICE 
> ':1.74'
> GPG_AGENT_INFO 
> '/run/user/1000/gnupg/S.gpg-agent:0:1'
> GTK3_MODULES 
> 'xapp-gtk3-module'
> GTK_MODULES 
> 'gail:atk-bridge'
> GTK_OVERLAY_SCROLLING 
> '1'
> HOME 
> '/home/sebastian'
> HTTP_ACCEPT 
>
> 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
> HTTP_ACCEPT_ENCODING 
> 'gzip, deflate, br'
> HTTP_ACCEPT_LANGUAGE 
> 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
> HTTP_CACHE_CONTROL 
> 'max-age=0'
> HTTP_CONNECTION 
> 'keep-alive'
> HTTP_COOKIE 
> ('csrftoken=15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIM

'WSGIRequest' object has no attribute

2021-04-01 Thread sebasti...@gmail.com
Hello,

model.py:

class UserSettings(models.Model):
user_link = models.OneToOneField(
User,
on_delete=models.CASCADE,
related_name="usersettings_address",primary_key=True,)

and i have a mixin:

class ListviewMixin():

def get_queryset(self):
print("Order "+str(self.request.usersettings_address.list_orderby))

now i get a exception:

AttributeError at /
'WSGIRequest' object has no attribute 'usersettings_address'
Request Method: GET
Request URL: http://127.0.0.1:8001/
Django Version: 3.1.7
Exception Type: AttributeError
Exception Value: 
'WSGIRequest' object has no attribute 'usersettings_address'
Exception Location: 
/home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, 
line 15, in get_queryset
Python Executable: /usr/bin/python3
Python Version: 3.8.5
Python Path: 
['/home/sebastian/PycharmProjects/verwaltung',
 '/usr/lib/python38.zip',
 '/usr/lib/python3.8',
 '/usr/lib/python3.8/lib-dynload',
 '/home/sebastian/.local/lib/python3.8/site-packages',
 '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk',
 '/home/sebastian/PycharmProjects/helpdesk/django-helpdesk/demo',
 '/usr/local/lib/python3.8/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/usr/lib/python3.8/dist-packages']
Server time: Thu, 01 Apr 2021 15:55:29 +
Traceback Switch to copy-and-paste view
/home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/exception.py,
 
line 47, in inner
response = get_response(request) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/core/handlers/base.py,
 
line 181, in _get_response
response = wrapped_callback(request, *callback_args, 
**callback_kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
 
line 70, in view
return self.dispatch(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/utils/decorators.py, 
line 43, in _wrapper
return bound_method(*args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/contrib/auth/decorators.py,
 
line 21, in _wrapped_view
return view_func(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django/views/generic/base.py,
 
line 98, in dispatch
return handler(request, *args, **kwargs) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 78, in get
self.filterset = self.get_filterset(filterset_class) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 44, in get_filterset
kwargs = self.get_filterset_kwargs(filterset_class) …
▶ Local vars
/home/sebastian/.local/lib/python3.8/site-packages/django_filters/views.py, 
line 57, in get_filterset_kwargs
'queryset': self.get_queryset(), …
▶ Local vars
/home/sebastian/PycharmProjects/verwaltung/emailmarketing/Mixins.py, line 
15, in get_queryset
print("Order "+str(self.request.usersettings_address.list_orderby)) 
…
▶ Local vars
Request information
USER
root

GET
No GET data

POST
No POST data

FILES
No FILES data

COOKIES
Variable Value
csrftoken 
'15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
sessionid 
'm4julix8y4zyczcuq2tlnf6zzwjlkluc'
META
Variable Value
CINNAMON_VERSION 
'4.8.6'
COLORTERM 
'truecolor'
CONTENT_LENGTH 
''
CONTENT_TYPE 
'text/plain'
CSRF_COOKIE 
'15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA'
DBUS_SESSION_BUS_ADDRESS 
'unix:path=/run/user/1000/bus'
DESKTOP_SESSION 
'cinnamon'
DISPLAY 
':0'
DJANGO_SETTINGS_MODULE 
'emailmarketing.settings'
GATEWAY_INTERFACE 
'CGI/1.1'
GDMSESSION 
'cinnamon'
GDM_LANG 
'de_DE'
GJS_DEBUG_OUTPUT 
'stderr'
GJS_DEBUG_TOPICS 
'JS ERROR;JS LOG'
GNOME_DESKTOP_SESSION_ID 
'this-is-deprecated'
GNOME_TERMINAL_SCREEN 
'/org/gnome/Terminal/screen/0493dca5_c60d_4d79_a657_8d6130e31a36'
GNOME_TERMINAL_SERVICE 
':1.74'
GPG_AGENT_INFO 
'/run/user/1000/gnupg/S.gpg-agent:0:1'
GTK3_MODULES 
'xapp-gtk3-module'
GTK_MODULES 
'gail:atk-bridge'
GTK_OVERLAY_SCROLLING 
'1'
HOME 
'/home/sebastian'
HTTP_ACCEPT 
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
HTTP_ACCEPT_ENCODING 
'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE 
'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
HTTP_CACHE_CONTROL 
'max-age=0'
HTTP_CONNECTION 
'keep-alive'
HTTP_COOKIE 
('csrftoken=15eLiVRTmzsSz1unKLGniM5O3PLaCv1GikIMWWnf7p5tHdkRkYvOKKtM8c6jwGrA; 
'
 'sessionid=m4julix8y4zyczcuq2tlnf6zzwjlkluc')
HTTP_HOST 
'127.0.0.1:8001'
HTTP_SEC_FETCH_DEST 
'document'
HTTP_SEC_FETCH_MODE 
'navigate'
HTTP_SEC_FETCH_SITE 
'none'
HTTP_SEC_FETCH_USER 
'?1'
HTTP_UPGRADE_INSECURE_REQUESTS 
'1'
HTTP_USER_AGENT 
('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) '
 'Chrome/89.0.4389.82 Safari/537.36')
LANG 
'de_DE.UTF-8'
LANGUAGE 
'de_DE'
LESSCLOSE 
'/

Please help me ? forms are not stored in database

2021-04-01 Thread Mahendra
#Model
Form Django import models
Class singupdata(models.model):
 Username=models.CharField(max_len=20)
 Password=models.CharField(max_len=20)
#form
from django import forms
Class Signform (forms.form):
  Username=forms.IntegerFiled(
 labe='E mail',
Widget=forms.Textinput(
   attr={
  'class':'form-control',
  'placeholder':'username'
   }
  )
   )

Password=forms.EmailField(
 labe='Password',
Widget=forms.EmailInput(
   attr={
  'class':'form-control',
  'placeholder':'E-mail'
   }
  )
   )


#views
from .fomrs import Signform
from app.models import signudata
Def Signup(request):
If request.method=='POST':
   sform=Signform (request.post)
  If sform.is_valid():
   username=request.POST.get(Username,' ')
   password=request.POST.get(Password,' ')
   data =Signudata (
   Uname=username,
  Pwd =password,
  )
 data.save
   sform =Signform ()
   return render (request,sign.html,{'sform':sform}
#sign.html

{% csrf_token%}
{{ sform}}





Mahendra Yadav

-- 
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/CAN-6G3y9xAasDRhgGdAPxyK4XYOegLCienE6b3Yxv4pqo3FBWg%40mail.gmail.com.


Re: ModuleNotFoundError -- Please help :)

2021-04-01 Thread 'Ajay Rathore' via Django users
try this

*from reporter.models import Counties*

Regards
*Ajay Rathore*
Python Developer


On Thu, Apr 1, 2021 at 4:17 PM Ryan Nowakowski  wrote:

> Since your models aren't in the migrations python package, I would use an
> absolute path in the import statement here rather than the relative path.
>
> On March 31, 2021 9:50:30 PM CDT, 'Dante Costabile' via Django users <
> django-users@googlegroups.com> wrote:
>>
>> Hiya Folks.  Relatively new to django and quite enjoying it.  However
>> working on a geodjango project and I'm getting this error.
>>
>> [image: Screen Shot 2021-03-31 at 10.48.41 PM.png]
>>
>> Here is the file its referencing:[image: Screen Shot 2021-03-31 at
>> 10.49.30 PM.png]
>>
>> and my file structure:
>>
>> [image: Screen Shot 2021-03-31 at 10.50.11 PM.png]
>>
>> Thanks in advance
>>
>> --
> 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/B54524CA-E163-4718-8D5F-D956F2D4A69B%40fattuba.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/CACDrS2prNfm7e0GuLuHBMX%2BJfu8ny2Jv881a3OXTYQwwF3z-ow%40mail.gmail.com.


Re: ModuleNotFoundError -- Please help :)

2021-04-01 Thread Ryan Nowakowski
Since your models aren't in the migrations python package, I would use an 
absolute path in the import statement here rather than the relative path.

On March 31, 2021 9:50:30 PM CDT, 'Dante Costabile' via Django users 
 wrote:
>Hiya Folks.  Relatively new to django and quite enjoying it.  However 
>working on a geodjango project and I'm getting this error.
>
>[image: Screen Shot 2021-03-31 at 10.48.41 PM.png]
>
>Here is the file its referencing:[image: Screen Shot 2021-03-31 at
>10.49.30 
>PM.png]
>
>and my file structure:
>
>[image: Screen Shot 2021-03-31 at 10.50.11 PM.png]
>
>Thanks in advance
>
>-- 
>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/18188bb2-c691-49a3-bfde-963db6f2ba96n%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/B54524CA-E163-4718-8D5F-D956F2D4A69B%40fattuba.com.


Re: Deploy Django website internally within company network

2021-04-01 Thread Ryan Nowakowski
I typically develop the website and also handle deployment. I've done this in a 
couple of ways.  I get the IT department to give me a virtual machine or an AWS 
account so I can spin up my own EC2 instance. Then I get them to assign a DNS 
name to the server.

On March 31, 2021 6:11:11 PM CDT, tristant  wrote:
>So I am trying to propose building an internal website site at work
>with 
>Django. But I have no idea what is needed from an IT perspective. I
>know 
>how to deploy one on the internet through Heroku or such. But what are
>the 
>steps/resource requirements if I was to deploy within an intranet? The
>IT 
>department has not done this with Django before ( although they have
>done 
>so with other framework such as Angular, etc).
>
>If someone could give me some pointers on this process.
>
>Thanks,
>
>-- 
>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/36ef7600-4f4c-47f2-9bce-66425716a232n%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/2DA92BEF-09B3-4702-90BF-81F816B12B1B%40fattuba.com.