Re: Is it possible to create models inside a database model

2018-07-10 Thread aditya gupta
Well I was thinking is that instead of using related_name is there any
other way I can write and call my images inside css lightbox for the slide
show.

On Wed, Jul 11, 2018, 12:42 AM Alexander Joseph <
alexander.v.jos...@gmail.com> wrote:

> Oh ok I see. The related_name is what you use to access the specific field
> in the template so it needs to be unique to the model field. When you use
> the ForeignKey field type it uses the primaryKey of the related database
> models automatically so you dont need to worry about actually telling it
> which field to use to relate to in a RDBMS sense.
>
> On Tuesday, July 10, 2018 at 11:30:00 AM UTC-6, aditya wrote:
>>
>> I am using CBVs in model.py file and FBVs in views.py file.
>> As in image :-
>>
>> On Tue, Jul 10, 2018, 10:29 PM Alexander Joseph 
>> wrote:
>>
>>> Also- this is assuming you're using CBVs, if youre just using FBVs its
>>> probably even easier on the view side, the model side would be the same
>>>
>>> On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote:

 Good question - I'm looking for a similar solution myself. My
 application is a purchase order app so that a purchase order has details
 about the purchase order but also has an unspecified number of objects that
 belong to it (purchase items).
 The only way I can think this MIGHT work is making a model for each,
 including a foreignKey to relate the puchase items back to the purchase
 order, and possibly putting both in the same
 CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep you
 updated if I find any better solutions though




 On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:
>
> I have created a model Named Gallery and set upload path to media
> folder and in that folder I have 15 more folders with different images.
> Now I want to access each folder and images present inside it using
> database.
> My question is :
> Is it possible to create 15 model inside an model and if possible,
> then How to access them in my Html file? If not then what should I do to
> show them in my Html file ?

 --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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/17af2e69-1756-4156-99ce-20f01cf3aa67%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKXtCfCVg09iyi7ZYpe6SVQ0R40%3D1DZEH4-C0%3Df-CDZsR0B3Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Oh ok I see. The related_name is what you use to access the specific field 
in the template so it needs to be unique to the model field. When you use 
the ForeignKey field type it uses the primaryKey of the related database 
models automatically so you dont need to worry about actually telling it 
which field to use to relate to in a RDBMS sense.

On Tuesday, July 10, 2018 at 11:30:00 AM UTC-6, aditya wrote:
>
> I am using CBVs in model.py file and FBVs in views.py file. 
> As in image :-
>
> On Tue, Jul 10, 2018, 10:29 PM Alexander Joseph  > wrote:
>
>> Also- this is assuming you're using CBVs, if youre just using FBVs its 
>> probably even easier on the view side, the model side would be the same
>>
>> On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote:
>>>
>>> Good question - I'm looking for a similar solution myself. My 
>>> application is a purchase order app so that a purchase order has details 
>>> about the purchase order but also has an unspecified number of objects that 
>>> belong to it (purchase items).
>>> The only way I can think this MIGHT work is making a model for each, 
>>> including a foreignKey to relate the puchase items back to the purchase 
>>> order, and possibly putting both in the same 
>>> CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep you 
>>> updated if I find any better solutions though
>>>
>>>
>>>
>>>
>>> On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:

 I have created a model Named Gallery and set upload path to media 
 folder and in that folder I have 15 more folders with different images. 
 Now I want to access each folder and images present inside it using 
 database. 
 My question is : 
 Is it possible to create 15 model inside an model and if possible, then 
 How to access them in my Html file? If not then what should I do to show 
 them in my Html file ?
>>>
>>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/17af2e69-1756-4156-99ce-20f01cf3aa67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using multiple keyword arguments with reverse()

2018-07-10 Thread Melvyn Sopacua
On maandag 9 juli 2018 14:58:25 CEST Derek wrote:
> Thanks Melvyn
> 
> The call to reverse() *was* included in my original code snippets: see
> below.
> 
> > return HttpResponseRedirect(
> > 
> > reverse('uploads:upload_details',
> > 
> > kwargs={'view': view, 'mid':result.pk})
> 
> And that call does not work.

Ah, totally read over it. But - it *does* work, otherwise upload_details 
wouldn't get called, 
since the url would not have a 3 in it.

Your problem is somewhere else and I still don't get how the decorator ties in. 
Try to 
reduce it to an mcve[1].
-- 
Melvyn Sopacua


[1] https://stackoverflow.com/help/mcve

-- 
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/2047086.mNi3lG958X%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Django + WSGI: no HTTP_COOKIE in environ

2018-07-10 Thread Melvyn Sopacua
On dinsdag 10 juli 2018 14:40:41 CEST need_some_help wrote:
> I've followed numerous examples, but the only one that does not return
> errors are the implementations of the two functions below. There doesn't
> seem to be an HTTP_COOKIE key in the environ. The request value only gets
> set with POST and GET. Think something is wrong with my setup, because none
> of the common usage patterns I've seen online like request.POST don't work.

...

> You can see their is no HTTP_COOKIE in the keys. If I'm not setting it
> right, or there's something I need to check, please let me know.

Do you know how cookies work? Specifically, that on the first request to a 
server by a new browser (or command line), there never are cookies?

-- 
Melvyn Sopacua

-- 
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/3648020.a4HAOye7Rv%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Django-Autocomplete-light Styling Input Box

2018-07-10 Thread Melvyn Sopacua
On dinsdag 10 juli 2018 15:24:16 CEST umar...@gmail.com wrote:

> But now I'm not able to change the input box create by autocomplete-light.
> I've seen we can create ours custom html base on the receive data from the
> database but is there a way to just use the default Html and CSS created by
> the framework and change some styling attribute like width, of height ?

Yes you can:
- Override html[1] 
- Pass options to Select2[2] 

P.S. Excellently formulated question.
-- 
Melvyn Sopacua


[1] 
http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#displaying-results-using-custom-html
[2] 
http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#passing-options-to-select2

-- 
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/1762850.8RUfgpKREi%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to create a Purchase Order App?

2018-07-10 Thread oon arfiandwi
Hi,

I have similar app which I implement with Django (FBV not CBV, but actually
it would be similar).
My approach is using Django Formset, which I generate the Purchase Order
View with forms.modelform_factory() [1]
and the Purchase Detail View with forms.inlineformset_factory() [2]

but still, to have the Detail View dynamic (Add/Del items), you need bunch
of Ajax.

hope it helps.

[1]
https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/#modelform-factory-function
[2]
https://docs.djangoproject.com/en/2.0/topics/forms/modelforms/#overriding-methods-on-an-inlineformset

-- 
sincerely,
oon

On Wed, Jul 11, 2018 at 1:24 AM Alexander Joseph <
alexander.v.jos...@gmail.com> wrote:

> I'm trying to think of how I would make a purchase order app, where the
> purchase order itself has its details/information (vendor name, shipping
> type, payment terms, etc.) but it also has an unspecified (could be 1,
> could be 10, could be 20) actual purchase items with their own
> details/information (qty., description, price per unit, etc.).
>
> Pretty sure on the model side I would just make two seperate models, one
> for purchase orders and one for purchase items with a ForeignKey to relate
> the purchase items back to its corresponding purchase order, but on the
> view side (I'm using CBVs) would you just include both models in the
> CreateView/UpdateView/DeleteView? And on the template side I'm having
> trouble thinking how this would work, other than first creating your
> purchase order, then having some sort of frankenView for the purchase order
> DetailView/CreateView for purchase items. Thats the only solution I can
> think of without a bunch of fancy AJAX to put a form for the purchase items
> inside the CreateView form for the purchase order. Does anyone know of a
> better way to do this?? 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 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/5786952d-a28a-4dbc-abc2-9d79153d3ded%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CACUNLpUwM_uEjNdWiH0c52YOLSQVbYuaMyo9eHEYAFytfWEdQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Best way to create a Purchase Order App?

2018-07-10 Thread Alexander Joseph
I'm trying to think of how I would make a purchase order app, where the 
purchase order itself has its details/information (vendor name, shipping 
type, payment terms, etc.) but it also has an unspecified (could be 1, 
could be 10, could be 20) actual purchase items with their own 
details/information (qty., description, price per unit, etc.). 

Pretty sure on the model side I would just make two seperate models, one 
for purchase orders and one for purchase items with a ForeignKey to relate 
the purchase items back to its corresponding purchase order, but on the 
view side (I'm using CBVs) would you just include both models in the 
CreateView/UpdateView/DeleteView? And on the template side I'm having 
trouble thinking how this would work, other than first creating your 
purchase order, then having some sort of frankenView for the purchase order 
DetailView/CreateView for purchase items. Thats the only solution I can 
think of without a bunch of fancy AJAX to put a form for the purchase items 
inside the CreateView form for the purchase order. Does anyone know of a 
better way to do this?? 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 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/5786952d-a28a-4dbc-abc2-9d79153d3ded%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Also- this is assuming you're using CBVs, if youre just using FBVs its 
probably even easier on the view side, the model side would be the same

On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote:
>
> Good question - I'm looking for a similar solution myself. My application 
> is a purchase order app so that a purchase order has details about the 
> purchase order but also has an unspecified number of objects that belong to 
> it (purchase items).
> The only way I can think this MIGHT work is making a model for each, 
> including a foreignKey to relate the puchase items back to the purchase 
> order, and possibly putting both in the same 
> CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep you 
> updated if I find any better solutions though
>
>
>
>
> On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:
>>
>> I have created a model Named Gallery and set upload path to media folder 
>> and in that folder I have 15 more folders with different images. 
>> Now I want to access each folder and images present inside it using 
>> database. 
>> My question is : 
>> Is it possible to create 15 model inside an model and if possible, then 
>> How to access them in my Html file? If not then what should I do to show 
>> them in my Html file ?
>
>

-- 
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/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to create models inside a database model

2018-07-10 Thread Alexander Joseph
Good question - I'm looking for a similar solution myself. My application 
is a purchase order app so that a purchase order has details about the 
purchase order but also has an unspecified number of objects that belong to 
it (purchase items).
The only way I can think this MIGHT work is making a model for each, 
including a foreignKey to relate the puchase items back to the purchase 
order, and possibly putting both in the same 
CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep you 
updated if I find any better solutions though




On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:
>
> I have created a model Named Gallery and set upload path to media folder 
> and in that folder I have 15 more folders with different images. 
> Now I want to access each folder and images present inside it using 
> database. 
> My question is : 
> Is it possible to create 15 model inside an model and if possible, then 
> How to access them in my Html file? If not then what should I do to show 
> them in my Html file ?

-- 
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/e083990d-4f2e-49fa-acb4-ff668977d04f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is it possible to create models inside a database model

2018-07-10 Thread aditya
I have created a model Named Gallery and set upload path to media folder and in 
that folder I have 15 more folders with different images. 
Now I want to access each folder and images present inside it using database.
My question is :
Is it possible to create 15 model inside an model and if possible, then How to 
access them in my Html file? If not then what should I do to show them in my 
Html file ?

-- 
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/c94f8ad0-542f-4ac3-a1c7-505742ecb0d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Configuring Remote Existing DB through RDS

2018-07-10 Thread Matthew Pava
One thing that stands out to me is that the exception message indicates that it 
is looking for “detectiondata_dev” instead of “detectiondata-dev”.
Also, did you run migrations?

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of acka...@ucsd.edu
Sent: Monday, July 9, 2018 5:01 PM
To: Django users
Subject: Configuring Remote Existing DB through RDS

Hi everyone,

I'm having trouble connecting an existing MySQL database through the 
settings.py file in my project and was wondering if anyone has ever experienced 
similar issues. The database section of settings.py appears as follows:

DATABASES = {
'default': {
'NAME': 'detectiondata-dev',
'ENGINE': 'django.db.backends.mysql',
'USER': 'user_with_admin_privileges',
'PASSWORD': 'admin_password',
'HOST': 'host_name_from_rds',
'PORT': '3306',
},
}

where 'user_with_admin_privileges' is an obscured (but working) admin username 
- same thing with the password and hostname. Port 3306 is allowed through my 
firewall, inbound/outbound.

The database is a running MySQL instance on an AWS account. Interestingly 
enough, my laptop (running environment is Windows Subsystem for Linux) seems to 
be able to recognize/connect to the database - I'm successfully able to view 
the database using the mysql command in bash:

msql -u 'user_with_admin_privileges' -p -h 'host_name_from_rds'

... where I then enter 'admin_password' and can successfully interact with the 
remote DB. Additionally, commands such as telnet and nc can connect to the 
specified host. I also tried connecting another public database and encountered 
similar errors, even though I could otherwise view the database remotely.

When trying to migrate the existing database, or even run the server, Django 
freaks out (see attached error files). I'm executing from within a virtualenv 
using python 3, not sure what's wrong. Searched all over the web and through 
this group and haven't found a similar problem, so I thought I'd post as a last 
resort. 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 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/cf5a90f0-b6f5-404e-9649-459d3db9159c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/4a0c7b868ef94a40a132b4c192077edc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Django-Autocomplete-light Styling Input Box

2018-07-10 Thread umarcja
Hi,

this is my first post, please tell me if anything is wrong with the way I 
wrote question.

I am actually learning Django and I'm facing a little problem.

I've install a Postgres Database on my PC and link this Database to my 
Django Project.

I've install django-autocomplete-light to search threw the database while 
i'm typing in the input box.

But now I'm not able to change the input box create by autocomplete-light. 
I've seen we can create ours custom html base on the receive data from the 
database but is there a way to just use the default Html and CSS created by 
the framework and change some styling attribute like width, of height ?

I've add 2 pictures of what my app is rendering, and I just want the first 
input box (Created by autocomplete model) to look like the second one 
create by my own input box and css styling sheets.

Thanks a lot

Have a great day everyone.


-- 
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/7e0377a5-2faf-4c4c-b0e9-6590e3a09b64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Beginner

2018-07-10 Thread Harsh Rawat
Identifying a useful name means ?


>
>

-- 
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/785cb34c-4099-4213-9aef-2c81a5a21ef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django + WSGI: no HTTP_COOKIE in environ

2018-07-10 Thread need_some_help
I've followed numerous examples, but the only one that does not return 
errors are the implementations of the two functions below. There doesn't 
seem to be an HTTP_COOKIE key in the environ. The request value only gets 
set with POST and GET. Think something is wrong with my setup, because none 
of the common usage patterns I've seen online like request.POST don't work. 
According to the following:

https://stackoverflow.com/questions/1622793/django-cookies-how-can-i-set-them

https://www.tutorialspoint.com/django/django_cookies_handling.htm

https://overiq.com/django/1.10/cookies-in-django/

I should be using response.set_cookie() which is what I have:

view.py

def index(environ, start_response, request):
print request
print environ.keys()
template = loader.get_template('index-test.html')
response = HttpResponse(template.render(None))
response.set_cookie('name1', 'test-cookie')
response.set_cookie('name2', 'test-cookie')
return response


wsgi.py:

def application(environ, start_response):
try:
request_body_size = int(environ.get('CONTENT_LENGTH', 0))
except (ValueError):
request_body_size = 0
request_body = environ['wsgi.input'].read(request_body_size)
request = parse_qs(request_body)

start_response('200 OK', [('Content-Type', 'text/html')])
# DO I NEED AT SET COOKIE HEADER HERE?
return view.index(environ, start_response, request)

OUTPUT:

request: {}

environ.keys():
['RUN_MAIN', 'HTTP_REFERER', 'XDG_GREETER_DATA_DIR', 'QT4_IM_MODULE', 
'SERVER_SOFTWARE', 'UPSTART_EVENTS', 'SCRIPT_NAME', 'XDG_SESSION_TYPE', 
'REQUEST_METHOD', 'CONTENT_LENGTH', 'SERVER_PROTOCOL', 'HOME', 'DISPLAY', 
'LANG', 'SHELL', 'PATH_INFO', 'XDG_DATA_DIRS', 
'QT_LINUX_ACCESSIBILITY_ALWAYS_ON', 'MANDATORY_PATH', 
'COMPIZ_CONFIG_PROFILE', 'UPSTART_INSTANCE', 'JOB', 'SESSION', 
'LIBGL_ALWAYS_SOFTWARE', 'SERVER_PORT', 'CLUTTER_IM_MODULE', 'XMODIFIERS', 
'GTK2_MODULES', 'HTTP_PRAGMA', 'XDG_RUNTIME_DIR', 'COMPIZ_BIN_PATH', 
'VTE_VERSION', 'HTTP_CACHE_CONTROL', 'HTTP_CONNECTION', 'HTTP_HOST', 
'wsgi.version', 'XDG_CURRENT_DESKTOP', 'XDG_SESSION_ID', 
'DBUS_SESSION_BUS_ADDRESS', 'GNOME_KEYRING_PID', 'HTTP_ACCEPT', 
'DESKTOP_SESSION', 'LESSCLOSE', 'DEFAULTS_PATH', 'wsgi.run_once', 
'wsgi.errors', 'wsgi.multiprocess', 'HTTP_ACCEPT_LANGUAGE', 'INSTANCE', 
'LS_COLORS', 'XDG_SEAT', 'GNOME_DESKTOP_SESSION_ID', 'LESSOPEN', 
'QUERY_STRING', 'QT_IM_MODULE', 'LOGNAME', 'USER', 'GNOME_KEYRING_CONTROL', 
'XDG_VTNR', 'PATH', 'TERM', 'HTTP_USER_AGENT', 'XDG_SESSION_PATH', 
'XAUTHORITY', 'LANGUAGE', 'REMOTE_ADDR', 'SHLVL', 'QT_QPA_PLATFORMTHEME', 
'wsgi.url_scheme', 'QT_ACCESSIBILITY', 'WINDOWID', 'SESSIONTYPE', 
'IM_CONFIG_PHASE', 'GPG_AGENT_INFO', 'XDG_SESSION_DESKTOP', 
'SSH_AUTH_SOCK', 'GDMSESSION', 'UPSTART_JOB', 'wsgi.multithread', 
'XDG_SEAT_PATH', 'TZ', '_', 'wsgi.input', 'GTK_IM_MODULE', 
'UPSTART_SESSION', 'XDG_CONFIG_DIRS', 'SERVER_NAME', 'GATEWAY_INTERFACE', 
'OLDPWD', 'GDM_LANG', 'GTK_MODULES', 'PWD', 'DJANGO_SETTINGS_MODULE', 
'CONTENT_TYPE', 'wsgi.file_wrapper', 'REMOTE_HOST', 'HTTP_ACCEPT_ENCODING']

You can see their is no HTTP_COOKIE in the keys. If I'm not setting it 
right, or there's something I need to check, please let me know.

-- 
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/efca47a4-1a14-426a-88ce-5a9c20474046%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: about book

2018-07-10 Thread Rakesh Singh
you can prefer e-book for better learning.

On Tue, Jul 10, 2018 at 4:46 PM, tribhuvan kishor <
tribhuvankishor...@gmail.com> wrote:

> can any one suggest me a better book for django
>
> --
> 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/CACiphSU%3D4Tip5cLpj%3DjOx15GVrTGGL2fMLOuCoJavbtZ1m
> M9MQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

*Thanks & Regards*

*Rakesh Singh*
*Diverse Lynx LLC*
*Technical Project Manager*
*786 9230 528*
*rakesh...@gmail.com *
P Please consider your environmental responsibility - think before you
print!

-- 
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/CADJJcgZ6LBZtY6Y5vV%3D3bUXpbw%3D%2Bf-xMjYEQ1e32Pq-fygZpoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: manage.py linux mint TypeError

2018-07-10 Thread Daniel Hepper
Your model class definition is wrong. It should be:

class Question(models.Model):

On Tue, Jul 10, 2018 at 1:29 PM Forest Rally Media <
bornsupercars@gmail.com> wrote:

> Hi there guys! I'm pretty new to the "django" game and I'm having a little
> trouble with the manage.py function of the app. It's asking me to put in
> this code
> mysite/manage.py makemigrations polls
> but when selected into the linux terminal this pops up...
> Traceback (most recent call last):
>   File "mysite/manage.py", line 21, in 
> execute_from_command_line(sys.argv)
>   File
> "/home/calumbond/.local/lib/python3.6/site-packages/django/core/management/__init__.py"
> , line 371, in execute_from_command_line
> utility.execute()
>   File
> "/home/calumbond/.local/lib/python3.6/site-packages/django/core/management/__init__.py"
> , line 347, in execute
> django.setup()
>   File
> "/home/calumbond/.local/lib/python3.6/site-packages/django/__init__.py",
> line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "/home/calumbond/.local/lib/python3.6/site-packages/django/apps/registry.py"
> , line 112, in populate
> app_config.import_models()
>   File
> "/home/calumbond/.local/lib/python3.6/site-packages/django/apps/config.py"
> , line 198, in import_models
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File "/home/calumbond/mysite/polls/models.py", line 5, in 
> class Question(models):
> TypeError: module.__init__() takes at most 2 arguments (3 given)
>
> What is going on here?
> Please help!
>
> --
> 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/05b72965-729d-4740-873b-59fbe8b5ec72%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHEnUVW3gWW1tMi3HYUPofNqJX0j6KyE7Lts95in5%3DES2S1kKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


manage.py linux mint TypeError

2018-07-10 Thread Forest Rally Media
Hi there guys! I'm pretty new to the "django" game and I'm having a little 
trouble with the manage.py function of the app. It's asking me to put in 
this code 
mysite/manage.py makemigrations polls
but when selected into the linux terminal this pops up...
Traceback (most recent call last):
  File "mysite/manage.py", line 21, in 
execute_from_command_line(sys.argv)
  File 
"/home/calumbond/.local/lib/python3.6/site-packages/django/core/management/__init__.py"
, line 371, in execute_from_command_line
utility.execute()
  File 
"/home/calumbond/.local/lib/python3.6/site-packages/django/core/management/__init__.py"
, line 347, in execute
django.setup()
  File 
"/home/calumbond/.local/lib/python3.6/site-packages/django/__init__.py", 
line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/calumbond/.local/lib/python3.6/site-packages/django/apps/registry.py"
, line 112, in populate
app_config.import_models()
  File 
"/home/calumbond/.local/lib/python3.6/site-packages/django/apps/config.py", 
line 198, in import_models
self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in _find_and_load_unlocked
  File "", line 665, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File "/home/calumbond/mysite/polls/models.py", line 5, in 
class Question(models):
TypeError: module.__init__() takes at most 2 arguments (3 given)

What is going on here?
Please help!

-- 
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/05b72965-729d-4740-873b-59fbe8b5ec72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


about book

2018-07-10 Thread tribhuvan kishor
can any one suggest me a better book for django

-- 
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/CACiphSU%3D4Tip5cLpj%3DjOx15GVrTGGL2fMLOuCoJavbtZ1mM9MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Beginner

2018-07-10 Thread Harsh Rawat
Thanks a lot

On Thursday, 28 June 2018 12:04:26 UTC+5:30, TonyF-UK wrote:
>
> On 27/06/18 21:23, Harsh Rawat wrote: 
> > I have learnt Django a little bit. I need help regarding the ticket 
> > https://code.djangoproject.com/ticket/28905 .What should I learn in 
> > Django to be able to contribute via this ticket. 
>
> It looks like this doesn't actually require any knowledge of Django 
> particularly;  this feature is actually a feature of pip and Python 
> setuptools. 
>
> What you need to do is identify a set of packages that are often 
> installed with Django - and then identify a useful name for them. 
>
> As commented on the fault, you should probably agree any new set of 
> packages on the developer mailing list, and also make sure that you 
> clearly document which package sets are now supported. 
>
> > -- 
> > 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...@googlegroups.com  
> > . 
> > To post to this group, send email to django...@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/1d490e7d-424f-421f-9278-2b326d95b397%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/django-users/1d490e7d-424f-421f-9278-2b326d95b397%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
> -- 
> -- 
> Anthony Flury 
> email : *anthon...@btinternet.com * 
> Twitter : *@TonyFlury * 
>
>

-- 
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/2b9b6b99-1cef-4938-a896-3a5d9a2d5b54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python / Django slow ? Deciding my next technological stack

2018-07-10 Thread ijazz jazz
*Python Training in Bangalore* *Best Python Training Courses in Bangalore 

 
–  Marathahalli, BTM Layout, Rajajinagar, Kalyan Nagar & Jaya Nagar*. We 
train the students from basic level to advanced concepts with a real-time 
environment. We are the *Best Python Training Institute in bangalore.*

-- 
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/7b0c134a-f289-4b96-a890-cb9ab9a8cb10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python & Django.

2018-07-10 Thread ijazz jazz
*Python Training in Bangalore* *Best Python Training Courses in Bangalore 
–
  
Marathahalli, BTM Layout, Rajajinagar, Kalyan Nagar & Jaya Nagar*. We train 
the students from basic level to advanced concepts with a real-time 
environment. We are the *Best Python Training Institute in bangalore.*

-- 
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/7616369d-d8d9-4598-81a8-688bdb5bdbbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python Training in Bangalore

2018-07-10 Thread ijazz jazz
*Python Training in Bangalore*  
*Best
 
Python Training Courses in Bangalore –  Marathahalli, BTM Layout, 
Rajajinagar, Kalyan Nagar & Jaya Nagar*. We train the students from basic 
level to advanced concepts with a real-time environment. We are the *Best 
Python Training Institute in bangalore.*

*URL 
: 
https://www.besanttechnologies.com/training-courses/python-training-institute-in-bangalore*

-- 
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/2fe78907-13e3-4df2-bb90-7d8fe65c6505%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static files not rendering in project

2018-07-10 Thread useracct222
Thank you for your response. It seems I needed:

from django.contrib.staticfiles.templatetags.staticfiles import static


and then from view.py, call static("image.png") and pass this to the context. 
Not sure why exactly this works,
so if you care to elaborate, I'm all for learning. Thanks.



On Friday, July 6, 2018 at 3:21:29 PM UTC-7, Xarala Academy wrote:
>
> Hi friend, 
>
> Try to change {{STATIC_URL}}  to  
>
> 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 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/228cbf59-fdda-4c41-8066-36a36e27ff51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.