Django (Admin Page)

2016-11-07 Thread Rashmi Pandey
How can i display data base table on admin page...

-- 
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/49e2bdc9-681b-42b5-936e-b637d0da4357%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Rest Framework and Swagger

2016-11-07 Thread Tom Christie
https://github.com/marcgibbons/django-rest-swagger

On Saturday, 5 November 2016 16:17:10 UTC, pradam.programming wrote:
>
> Hi Guys,
>  Please I need an advice on the best approach to take on the following 
> issues.
>
> How can i Implement Swagger for CBV and FBV in rest framework ...?
>

-- 
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/19d26fb5-9875-4388-9a29-4438720dbd54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django (Admin Page)

2016-11-07 Thread ludovic coues
Hello,

If you are talking about your model, you need to create a ModelAdmin
class [1] for your models. There is an exemple of how to do so in the
django tutorial [2].

[1] https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#modeladmin-objects
[2] 
https://docs.djangoproject.com/en/1.10/intro/tutorial02/#enter-the-admin-site

2016-11-07 9:52 GMT+01:00 Rashmi Pandey :
> How can i display data base table on admin page...
>
> --
> 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/49e2bdc9-681b-42b5-936e-b637d0da4357%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTbWO9%2B%2BKuOofLnO73jBusdX3XCquVh7V%2BfAnnGxpN6eSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django1.9 Mongodb support

2016-11-07 Thread GMail
Hi, "without any problem" is a bit strong since you can't just plug mongoengine 
into Django. You would have to take care of all models and interaction with 
them. However if Mongo is absolutely required for your project it can be done.

> On 5 Nov 2016, at 01:25, mpita1984  wrote:
> 
> mongoengine test is to handle mongodb with python. although not native to the 
> Django ORM, you can use it without any problem.
> 
> http://mongoengine.org/ 
> 
> El viernes, 4 de noviembre de 2016, 22:13:18 (UTC+1), Sudhir kumar Giri 
> escribió:
> Hello,
>  I didn't find any documentation or tutorial for Django-1.9 with Mongodb.
> Please suggest some docs about it.
> 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/debadd0d-1426-48cf-a69c-de7708adce23%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/FFC72164-D84A-4AB3-8E82-509D03F87C02%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.10.3 with Oracle database and --keepdb

2016-11-07 Thread Carsten Fuchs

Am 05.11.2016 um 15:55 schrieb Carsten Fuchs:

Am 2016-11-05 um 13:11 schrieb Mariusz Felisiak:

Yes. Please, make sure that your main oracle user has *ALTER USER*
permission.


I'll check (it may take until Monday or Tuesday though) and post an update here.


Indeed, after having added the ALTER USER permission everything works properly.

Many thanks to everyone!

Best regards,
Carsten

PS: It would be helpful if ALTER USER was added to the list of required 
permissions at https://docs.djangoproject.com/en/1.10/ref/databases/#oracle-notes




--
Carsten Fuchs Software
Industriegebiet 3, c/o Rofu
D-55768 Hoppstädten-Weiersbach
http://www.cafu.de

--
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/743611e5-26fa-5671-9031-32656010c502%40cafu.de.
For more options, visit https://groups.google.com/d/optout.


External access

2016-11-07 Thread bob gailer
I am running a the django server, listening at port 8000. I can access 
the server using localhost. When I try using my external ip address I 
get "The server at 24.211.133.163 is taking too long to respond." I have 
port 8000 forwarded to my server computer in my router. What more do I 
need to do?



--
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/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread Larry Martell
On Mon, Nov 7, 2016 at 8:48 AM, bob gailer  wrote:
> I am running a the django server, listening at port 8000. I can access the
> server using localhost. When I try using my external ip address I get "The
> server at 24.211.133.163 is taking too long to respond." I have port 8000
> forwarded to my server computer in my router. What more do I need to do?

Is the port open on the firewall? What OS are you on?

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


Re: External access

2016-11-07 Thread GMail
Hi! Seems like port forwarding doesn't work correctly. Do you have any other 
ports forwarded (like ssh or ftp)? If so, do they work as expected?

What is this command's output:
telnet  8000

> On 7 Nov 2016, at 16:48, bob gailer  wrote:
> 
> I am running a the django server, listening at port 8000. I can access the 
> server using localhost. When I try using my external ip address I get "The 
> server at 24.211.133.163 is taking too long to respond." I have port 8000 
> forwarded to my server computer in my router. What more do I need to do?
> 
> 
> -- 
> 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/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.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/20D132E2-7337-4BCC-B281-052560C21637%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread Andreas Kuhne
Do you have "ALLOWED_HOSTS" correclty configured in django settings?

Regards,

Andréas

2016-11-07 14:48 GMT+01:00 bob gailer :

> I am running a the django server, listening at port 8000. I can access the
> server using localhost. When I try using my external ip address I get "The
> server at 24.211.133.163 is taking too long to respond." I have port 8000
> forwarded to my server computer in my router. What more do I need to do?
>
>
> --
> 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/ms
> gid/django-users/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.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/CALXYUbmDO8hxr%2B1tFbUqtwkaQ9eECkPy%2BtT2M1%2Bj3%3DUj1-oJHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.10.3 with Oracle database and --keepdb

2016-11-07 Thread Mariusz Felisiak
It will appear in the next release.

W dniu poniedziałek, 7 listopada 2016 14:38:46 UTC+1 użytkownik Carsten 
Fuchs napisał:
>
> Am 05.11.2016 um 15:55 schrieb Carsten Fuchs: 
> > Am 2016-11-05 um 13:11 schrieb Mariusz Felisiak: 
> >> Yes. Please, make sure that your main oracle user has *ALTER USER* 
> >> permission. 
> > 
> > I'll check (it may take until Monday or Tuesday though) and post an 
> update here. 
>
> Indeed, after having added the ALTER USER permission everything works 
> properly. 
>
> Many thanks to everyone! 
>
> Best regards, 
> Carsten 
>
> PS: It would be helpful if ALTER USER was added to the list of required 
> permissions at 
> https://docs.djangoproject.com/en/1.10/ref/databases/#oracle-notes 
>
>
>
> -- 
> Carsten Fuchs Software 
> Industriegebiet 3, c/o Rofu 
> D-55768 Hoppstädten-Weiersbach 
> http://www.cafu.de 
>

-- 
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/3b205364-7e5a-413c-9290-cfb5727443c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread Michal Petrucha
On Mon, Nov 07, 2016 at 08:48:25AM -0500, bob gailer wrote:
> I am running a the django server, listening at port 8000. I can access the
> server using localhost. When I try using my external ip address I get "The
> server at 24.211.133.163 is taking too long to respond." I have port 8000
> forwarded to my server computer in my router. What more do I need to do?

By default, runserver only binds to 127.0.0.1:8000, which makes it
only accessible over the loopback interface. If you want to make it
accessible from all interfaces, try starting it up like this:

./manage.py runserver 0.0.0.0:8000

Good luck,

Michal

-- 
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/20161107142550.GM8307%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: Storing settings

2016-11-07 Thread Melvyn Sopacua
Hi,

On Saturday 05 November 2016 15:26:52 Bogdan P. wrote:

> {% for quadrant in priority_groups %}
>   onchange="$('#quadrant-form').submit()">
> {% for option in quadrant.quadrant.all %}
>{% if user_profile.quadrant1 == option.id %}


Can you show the part in the view where you provide this variable to the 
template?
If you don't, then that's your problem and the fix that probably works 
is to use request.user.profile.quadrant1.

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


Re: Need help to catch "cart_id" based on session.

2016-11-07 Thread Melvyn Sopacua
On Sunday 06 November 2016 21:00:44 ludovic coues wrote:

> I would try request.session.get('cart_id', None) instead of
> request.session['card_id'].

Negative.
First, this is part of the 3rd party app "doorsale". Secondly, at this 
stage in the order process a cart id SHALL be present in the session and 
as such we need to error out hard and not suppress.

This is a configuration issue by OP or a bug in the software, but I'm 
not familiar enough with doorsale to say which. At first glance though, 
the view handling it and the views preceeding this stage look solid.

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


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:50 AM, Larry Martell wrote:

On Mon, Nov 7, 2016 at 8:48 AM, bob gailer  wrote:

I am running a the django server, listening at port 8000. I can access the
server using localhost. When I try using my external ip address I get "The
server at 24.211.133.163 is taking too long to respond." I have port 8000
forwarded to my server computer in my router. What more do I need to do?

Is the port open on the firewall?

How would I determine that?

What OS are you on?

Windows 10.

Bob

--
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/d4b6210e-2fe5-edcd-79fe-1e1731cd1971%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:51 AM, GMail wrote:

Hi! Seems like port forwarding doesn't work correctly. Do you have any other 
ports forwarded (like ssh or ftp)? If so, do they work as expected?

What is this command's output:
telnet  8000

Sorry but I'm running Windows 10 which does not recognize "telnet"

Bob

--
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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread Larry Martell
On Mon, Nov 7, 2016 at 1:15 PM, bob gailer  wrote:
> On 11/7/2016 8:50 AM, Larry Martell wrote:
>>
>> On Mon, Nov 7, 2016 at 8:48 AM, bob gailer  wrote:
>>>
>>> I am running a the django server, listening at port 8000. I can access
>>> the
>>> server using localhost. When I try using my external ip address I get
>>> "The
>>> server at 24.211.133.163 is taking too long to respond." I have port 8000
>>> forwarded to my server computer in my router. What more do I need to do?
>>
>> Is the port open on the firewall?
>
> How would I determine that?
>>
>> What OS are you on?
>
> Windows 10.

Sorry, I do not know anything about Windows.I only work with Linux.

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


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 8:58 AM, Andreas Kuhne wrote:

Do you have "ALLOWED_HOSTS" correclty configured in django settings?

Thanks - was not aware of that. Now it looks like:
ALLOWED_HOSTS = ['209.216.2.211', '209.216.15.70', '24.211.133.163']
The last one is my external ip

Adding the ip addresses did not fix the problem.


Regards,

Andréas

2016-11-07 14:48 GMT+01:00 bob gailer >:


I am running a the django server, listening at port 8000. I can
access the server using localhost. When I try using my external ip
address I get "The server at 24.211.133.163 is taking too long to
respond." I have port 8000 forwarded to my server computer in my
router. What more do I need to do?


-- 
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/0fb3e7f8-0c7c-4976-4f8d-a8e914b0b3cb%40gmail.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/CALXYUbmDO8hxr%2B1tFbUqtwkaQ9eECkPy%2BtT2M1%2Bj3%3DUj1-oJHA%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
Image and video hosting by TinyPic

--
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/1e8c42da-150a-12d0-2a67-9c352970392a%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread GMail
Wow... Indeed, in Windows telnet is disabled by default. Here's how you can 
enable it (first link on Google): 
https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-10/ 

I believe the problem is (how somebody already mentioned earlier) your port is 
inaccessible from external network or server is only serving on lo (loopback 
interface, also was mentioned earlier). You could easily test both cases with 
telnet. And I forgot to mention, that you should probably run telnet on 
separate machine (not the one serving Django), since you have no problem 
accessing your server locally.

> On 7 Nov 2016, at 21:19, bob gailer  wrote:
> 
> On 11/7/2016 8:51 AM, GMail wrote:
>> Hi! Seems like port forwarding doesn't work correctly. Do you have any other 
>> ports forwarded (like ssh or ftp)? If so, do they work as expected?
>> 
>> What is this command's output:
>> telnet  8000
> Sorry but I'm running Windows 10 which does not recognize "telnet"
> 
> Bob
> 
> -- 
> 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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.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/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: External access

2016-11-07 Thread bob gailer

On 11/7/2016 1:23 PM, GMail wrote:
Wow... Indeed, in Windows telnet is disabled by default. Here's how 
you can enable it (first link on Google): 
https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-10/

C:\Users\bgailer>telnet 24.211.133.163
Connecting To 24.211.133.163...Could not open connection to the host, on 
port 23: Connect failed.


C:\Users\bgailer>ftp 24.211.133.163
> ftp: connect :Connection timed out
I believe the problem is (how somebody already mentioned earlier) your 
port is inaccessible from external network or server is only serving 
on lo (loopback interface, also was mentioned earlier). You could 
easily test both cases with telnet.

How would I do that?
And I forgot to mention, that you should probably run telnet on 
separate machine (not the one serving Django), since you have no 
problem accessing your server locally.

I have no machines that are not on my lan.


On 7 Nov 2016, at 21:19, bob gailer > wrote:


On 11/7/2016 8:51 AM, GMail wrote:
Hi! Seems like port forwarding doesn't work correctly. Do you have 
any other ports forwarded (like ssh or ftp)? If so, do they work as 
expected?


What is this command's output:
telnet  8000

Sorry but I'm running Windows 10 which does not recognize "telnet"

Bob

--
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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.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/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com 
.

For more options, visit https://groups.google.com/d/optout.



--
Image and video hosting by TinyPic

--
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/4a92ce05-eee8-038c-b1ef-6dd15e699087%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: One template for multiple views

2016-11-07 Thread Moreplavec
Yes, i know i can pass data (variables) from view to template. But my 
question is, if i have report, for example with headline "This month" and 
same report for previous with headline "Previous month", if i can such 
things solve directly in template, based on view which is calling template. 
I don't like the way to put texts into template just to be specific for 
view.

But thanks for answer, it's django-way and i have to respect it :/

Dne středa 2. listopadu 2016 20:28:22 UTC+1 Lekan Wahab napsal(a):
>
> Hi,  
> I'm not sure I completely understand what you need but if I do,  I think 
> passing different contexts to the same template would help you achieve 
> that. 
>
> You could easily have something like :
>
> def initial_view(request) :
>variableone = 'a' 
>variabletwo = 'b' 
>return response(yourtemplate, {'a':variableone, 'b' :variabletwo}) 
>
> Then you can also have another view using the same template but with 
> different contexts. 
> Something like, 
>
> def final_view(request) :
>variableone = 'c' 
>variabletwo = 'd' 
>return response(yourtemplate, {'c':variableone, 'd' :variabletwo}) 
>
> Also,  if you have a repetitive section in your template, you could just 
> write it once and use the {% include %} tag to use it in each of your other 
> templates. 
>
> I hope that helps. 
>
> Lekan.
> Python is the "most powerful language you can still read".
>
> On 2 Nov 2016 19:48, "Moreplavec" > 
> wrote:
>
> Greetings, 
>
> i'm creating template for simple table report. Data shown are for current 
> month. Than i realised i need same report for previous month. I can copy 
> created template and modify texts, but i don't like. Is it possible to use 
> same template for more views and only controll differences based on view, 
> which is template calling? For example, i need to show "Current month" or 
> "Previous month". I can put these texts into variable, but i hope there is 
> better way to controll directly in template.
>
> Please, can you help me or point me to some good article? 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...@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/a61a7a9d-06a2-4749-bf71-f6d2351396af%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/08ec103b-8f35-414e-9c94-a3ee5e398cc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: One template for multiple views

2016-11-07 Thread Matthew Pava
I would use an if block in the template, and actually, I do use an if block.
So I would have either two context variables with this_month and last_month or 
I would look up some filter or template tag to find the month of the current 
datetime object in the Django documentation.


{% if month = this_month %}Current{% elif month = last_month %}Previous{% else 
%}{{ month }}{% endif %} Report



From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Moreplavec
Sent: Monday, November 7, 2016 1:25 PM
To: Django users
Subject: Re: One template for multiple views

Yes, i know i can pass data (variables) from view to template. But my question 
is, if i have report, for example with headline "This month" and same report 
for previous with headline "Previous month", if i can such things solve 
directly in template, based on view which is calling template. I don't like the 
way to put texts into template just to be specific for view.

But thanks for answer, it's django-way and i have to respect it :/

Dne středa 2. listopadu 2016 20:28:22 UTC+1 Lekan Wahab napsal(a):

Hi,
I'm not sure I completely understand what you need but if I do,  I think 
passing different contexts to the same template would help you achieve that.

You could easily have something like :

def initial_view(request) :
   variableone = 'a'
   variabletwo = 'b'
   return response(yourtemplate, {'a':variableone, 'b' :variabletwo})

Then you can also have another view using the same template but with different 
contexts.
Something like,

def final_view(request) :
   variableone = 'c'
   variabletwo = 'd'
   return response(yourtemplate, {'c':variableone, 'd' :variabletwo})

Also,  if you have a repetitive section in your template, you could just write 
it once and use the {% include %} tag to use it in each of your other templates.

I hope that helps.

Lekan.
Python is the "most powerful language you can still read".

On 2 Nov 2016 19:48, "Moreplavec" > wrote:
Greetings,

i'm creating template for simple table report. Data shown are for current 
month. Than i realised i need same report for previous month. I can copy 
created template and modify texts, but i don't like. Is it possible to use same 
template for more views and only controll differences based on view, which is 
template calling? For example, i need to show "Current month" or "Previous 
month". I can put these texts into variable, but i hope there is better way to 
controll directly in template.

Please, can you help me or point me to some good article? 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...@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/a61a7a9d-06a2-4749-bf71-f6d2351396af%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/08ec103b-8f35-414e-9c94-a3ee5e398cc5%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/d2c3952ed4b0489c920f5dac64f078c2%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: One template for multiple views

2016-11-07 Thread ludovic coues
You can also have a base template, with a block for the title then
extends that base template with the extends tags.

2016-11-07 20:25 GMT+01:00 Moreplavec :
> Yes, i know i can pass data (variables) from view to template. But my
> question is, if i have report, for example with headline "This month" and
> same report for previous with headline "Previous month", if i can such
> things solve directly in template, based on view which is calling template.
> I don't like the way to put texts into template just to be specific for
> view.
>
> But thanks for answer, it's django-way and i have to respect it :/
>
> Dne středa 2. listopadu 2016 20:28:22 UTC+1 Lekan Wahab napsal(a):
>>
>> Hi,
>> I'm not sure I completely understand what you need but if I do,  I think
>> passing different contexts to the same template would help you achieve that.
>>
>> You could easily have something like :
>>
>> def initial_view(request) :
>>variableone = 'a'
>>variabletwo = 'b'
>>return response(yourtemplate, {'a':variableone, 'b' :variabletwo})
>>
>> Then you can also have another view using the same template but with
>> different contexts.
>> Something like,
>>
>> def final_view(request) :
>>variableone = 'c'
>>variabletwo = 'd'
>>return response(yourtemplate, {'c':variableone, 'd' :variabletwo})
>>
>> Also,  if you have a repetitive section in your template, you could just
>> write it once and use the {% include %} tag to use it in each of your other
>> templates.
>>
>> I hope that helps.
>>
>> Lekan.
>> Python is the "most powerful language you can still read".
>>
>>
>> On 2 Nov 2016 19:48, "Moreplavec"  wrote:
>>
>> Greetings,
>>
>> i'm creating template for simple table report. Data shown are for current
>> month. Than i realised i need same report for previous month. I can copy
>> created template and modify texts, but i don't like. Is it possible to use
>> same template for more views and only controll differences based on view,
>> which is template calling? For example, i need to show "Current month" or
>> "Previous month". I can put these texts into variable, but i hope there is
>> better way to controll directly in template.
>>
>> Please, can you help me or point me to some good article? 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...@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/a61a7a9d-06a2-4749-bf71-f6d2351396af%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/08ec103b-8f35-414e-9c94-a3ee5e398cc5%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


Re: External access

2016-11-07 Thread GMail
> Connecting To 24.211.133.163...Could not open connection to the host, on port 
> 23: Connect failed.
You forgot to specify port, command should be 'telnet 24.211.133.163 8000' (if 
you're running Django on different port, change 8000 to your port).

> How would I do that?
I believe it was mentioned earlier in this thread: 'python manage.py runserver 
0.0.0.0:8000' or 'python manage.py runserver [::]:8000' for ipv6 (probably not 
your case though).

> I have no machines that are not on my lan.
I've actually tried to connect to your server from my machine:
% telnet 24.211.133.163 80
Trying 24.211.133.163...
telnet: Unable to connect to remote host: Connection refused
% telnet 24.211.133.163 443
Trying 24.211.133.163...
telnet: Unable to connect to remote host: Connection refused
% telnet 24.211.133.163 8000
Trying 24.211.133.163...


It seems like your router or Windows firewall (or it may be any antivirus 
software with embedded firewall installed on your server) is rejecting 
connections to 8000 port. Unfortunately, I can't help you with any 
Windows-related issues.

I could try to help you with your router settings, but I think, since this is 
not about Django anymore, this discussion should not take place in 
django-users@. Feel free to contact me personally though.

> On 7 Nov 2016, at 21:53, bob gailer  wrote:
> 
> On 11/7/2016 1:23 PM, GMail wrote:
>> Wow... Indeed, in Windows telnet is disabled by default. Here's how you can 
>> enable it (first link on Google): 
>> https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-10/
> C:\Users\bgailer>telnet 24.211.133.163
> Connecting To 24.211.133.163...Could not open connection to the host, on port 
> 23: Connect failed.
> 
> C:\Users\bgailer>ftp 24.211.133.163
> > ftp: connect :Connection timed out
>> I believe the problem is (how somebody already mentioned earlier) your port 
>> is inaccessible from external network or server is only serving on lo 
>> (loopback interface, also was mentioned earlier). You could easily test both 
>> cases with telnet.
> How would I do that?
>> And I forgot to mention, that you should probably run telnet on separate 
>> machine (not the one serving Django), since you have no problem accessing 
>> your server locally.
> I have no machines that are not on my lan.
>> 
>>> On 7 Nov 2016, at 21:19, bob gailer >> > wrote:
>>> 
>>> On 11/7/2016 8:51 AM, GMail wrote:
 Hi! Seems like port forwarding doesn't work correctly. Do you have any 
 other ports forwarded (like ssh or ftp)? If so, do they work as expected?
 
 What is this command's output:
 telnet  8000
>>> Sorry but I'm running Windows 10 which does not recognize "telnet"
>>> 
>>> Bob
>>> 
>>> -- 
>>> 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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.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/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> Image and video hosting by TinyPic
> 
> -- 
> 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/4a92ce05-eee8-038c-b1ef-6dd15e699087%40gmail.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

Re: External access

2016-11-07 Thread Thomas Fuller
I don't totally understand how it works under the hood, but using the
answer Michal Petrucha provided earlier has worked for me in this situation
independent of the OS and any router settings.

Run the server using:
python manage.py runserver *0.0.0.0:8000 *

You'll be able to get to at http://:8000 from the machine running
the server. With most default router configurations you should also be able
to access
it from any computer on your LAN at the same url.
If you need to access it outside your LAN you'll have to delve into port
forwarding

-Thomas

On Mon, Nov 7, 2016 at 10:53 AM bob gailer  wrote:

On 11/7/2016 1:23 PM, GMail wrote:
> Wow... Indeed, in Windows telnet is disabled by default. Here's how
> you can enable it (first link on Google):
> https://www.rootusers.com/how-to-enable-the-telnet-client-in-windows-10/
C:\Users\bgailer>telnet 24.211.133.163
Connecting To 24.211.133.163...Could not open connection to the host, on
port 23: Connect failed.

C:\Users\bgailer>ftp 24.211.133.163
 > ftp: connect :Connection timed out
> I believe the problem is (how somebody already mentioned earlier) your
> port is inaccessible from external network or server is only serving
> on lo (loopback interface, also was mentioned earlier). You could
> easily test both cases with telnet.
How would I do that?
> And I forgot to mention, that you should probably run telnet on
> separate machine (not the one serving Django), since you have no
> problem accessing your server locally.
I have no machines that are not on my lan.
>
>> On 7 Nov 2016, at 21:19, bob gailer > > wrote:
>>
>> On 11/7/2016 8:51 AM, GMail wrote:
>>> Hi! Seems like port forwarding doesn't work correctly. Do you have
>>> any other ports forwarded (like ssh or ftp)? If so, do they work as
>>> expected?
>>>
>>> What is this command's output:
>>> telnet  8000
>> Sorry but I'm running Windows 10 which does not recognize "telnet"
>>
>> Bob
>>
>> --
>> 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/41e7d76b-3938-43c3-d61a-21e94ecbd067%40gmail.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/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com
> <
https://groups.google.com/d/msgid/django-users/5F9B0BC5-2D58-46A9-B304-AFA2FF777419%40gmail.com?utm_medium=email&utm_source=footer
>.
> For more options, visit https://groups.google.com/d/optout.


--
Image and video hosting by TinyPic

--
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/4a92ce05-eee8-038c-b1ef-6dd15e699087%40gmail.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/CAFUUR5dwNx9H%2Bxp6P3_SyPmJdN14E4wPh86Y9cLjdYr8SUQ%3DZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


separating group editing permission from custom group extension permission

2016-11-07 Thread Larry Martell
I have extended the group model and added a custom field and
permission. I want to be able to give a user permission to edit this
new field, but not have permission to edit any of the other group
attributes. But if I do not grant the 'can change group' permission
they cannot get to the group admin screen to access this new field.

Is there some way to give them access to only the new custom field?

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


Re: Access request body in the django.request logger

2016-11-07 Thread Justin Wilson
Stumbled across this post while trying to solve the same issue 
*(we've had this issue since 1.10 release, but have kept with 1.9 due to 
this issue).*We're only getting this with Django 1.10+ when running behind 
uWSGI.
The issue goes away if we just run the Django dev server.

On Thursday, September 15, 2016 at 11:09:13 PM UTC-6, Ben Whale wrote:
>
> Thanks for a link to the blob, that is very helpful.
>
> You might be right, but the more I look at this the more I think it is a 
> bug.
>
> The logging message is generated in django/utils/log.py in 
> the ServerFormatter format() method. If the logging setting is 
>
> LOGGING = {   
>   
> 'version': 1, 
>
> 'disable_existing_loggers': False, 
>   
> 'formatters': {   
>  
> 'verbose': {   
> 
> 'format': '%(levelname)s %(asctime)s %(module)s 
> %(process)d %(thread)d %(message)s'
> }, 
> 
> 'simple': {   
>  
> 'format': '%(levelname)s %(message)s' 
>  
> }, 
> 
> 'django.server': { 
> 
> '()': 'django.utils.log.ServerFormatter', 
>  
> 'format': '[%(server_time)s] %(message)s %(request)r', 
> 
> } 
>  
> }, 
> 
> 'filters': {   
> 
> 'require_debug_false': {   
> 
> '()': 'django.utils.log.RequireDebugFalse',   
>  
> }, 
> 
> 'require_debug_true': {   
>  
> '()': 'django.utils.log.RequireDebugTrue', 
> 
> }, 
> 
> }, 
> 
> 'handlers': { 
>  
> 'console': {   
> 
> 'level': 'DEBUG', 
>  
> 'filters': ['require_debug_true'], 
> 
> 'class': 'logging.StreamHandler', 
>  
> }, 
> 
> 'django.server': { 
> 
> 'level': 'INFO',   
> 
> 

Re: Admin site - prepopulating field based on foreign key

2016-11-07 Thread dodrian
Thanks, smart-selects has shown me how to do exactly what I wanted.

On Friday, 4 November 2016 10:36:58 UTC-5, Derek wrote:
>
> You need a third-party app e.g.
>
> https://github.com/digi604/django-smart-selects
>
>
> On Thursday, 3 November 2016 19:21:14 UTC+2, dod...@gmail.com wrote:
>>
>> I'm having trouble with my admin site, would appreciate any pointers.
>>
>> I have these three models in my database with relationships as shown:
>>
>> class Customer(models.Model):
>>   name=models.CharField(max_length=30)
>>
>> class Location(models.Model):
>>   name=models.CharField(max_length=30)
>>   customer = models.ForeignKey(Customer, on_delete = models.PROTECT)
>>
>> class License(models.Model):
>>   location=models.ForeignKey(Location, on_delete=models.PROTECT)
>>
>>
>> When the user creates a new License on the admin site, at the moment they 
>> have to choose what location the License is at via a dropdown box (a very 
>> long, confusing list), or create a new one if necessary.
>>
>> It would be much better if they could choose what Customer the license 
>> belongs to, and then choose the Location from the list of locations that 
>> have that customer as their foreign key.  They still may need to add a new 
>> location or even a new customer when doing this.
>>
>> What is the easiest way to do this on the admin site?  
>>
>> I am thinking that I will have to create a new widget with two dropdowns, 
>> and have the selection of the first make an AJAX query to populate the 
>> second.  Am I on the right track?  How can I then tie in this custom widget 
>> for the location field in License?
>>
>> I'm sure that this isn't a unique situation, but I haven't been able to 
>> find any tutorial or solution showing how to handle a follow-the-foreign 
>> key relationship.
>>
>

-- 
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/9cd8c293-a593-4fb3-bb01-5c88afffbac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access request body in the django.request logger

2016-11-07 Thread Justin Wilson
Sorry, I had those reversed. It works find WITH uWSGI, and fails with the 
Django dev server.

On Monday, November 7, 2016 at 2:48:14 PM UTC-7, Justin Wilson wrote:
>
> Stumbled across this post while trying to solve the same issue 
> *(we've had this issue since 1.10 release, but have kept with 1.9 due to 
> this issue).*We're only getting this with Django 1.10+ when running 
> behind uWSGI.
> The issue goes away if we just run the Django dev server.
>
> On Thursday, September 15, 2016 at 11:09:13 PM UTC-6, Ben Whale wrote:
>>
>> Thanks for a link to the blob, that is very helpful.
>>
>> You might be right, but the more I look at this the more I think it is a 
>> bug.
>>
>> The logging message is generated in django/utils/log.py in 
>> the ServerFormatter format() method. If the logging setting is 
>>
>> LOGGING = {   
>>   
>> 'version': 1, 
>>
>> 'disable_existing_loggers': False,   
>> 
>> 'formatters': {   
>>  
>> 'verbose': { 
>>   
>> 'format': '%(levelname)s %(asctime)s %(module)s 
>> %(process)d %(thread)d %(message)s'
>> },   
>>   
>> 'simple': {   
>>  
>> 'format': '%(levelname)s %(message)s' 
>>  
>> },   
>>   
>> 'django.server': {   
>>   
>> '()': 'django.utils.log.ServerFormatter', 
>>  
>> 'format': '[%(server_time)s] %(message)s %(request)r',   
>>   
>> } 
>>  
>> },   
>>   
>> 'filters': { 
>>   
>> 'require_debug_false': { 
>>   
>> '()': 'django.utils.log.RequireDebugFalse',   
>>  
>> },   
>>   
>> 'require_debug_true': {   
>>  
>> '()': 'django.utils.log.RequireDebugTrue',   
>>   
>> },   
>>   
>> },   
>>   
>> 'handlers': { 
>>  
>> 'console': { 
>>   
>> 'level': 'DEBUG', 
>>  
>> 'filters': ['require_debug_true'],   
>>   
>> 'class': 'logging.StreamHandler', 
>>  
>> },   
>>   
>> 'django.server': {

Re: Rest Framework and Swagger

2016-11-07 Thread pradam programming
Hi Tom,
I have Implemented Swagger for CBV but i dont know how to do it for FBV..?
Please Help me out..!!

On Mon, Nov 7, 2016 at 4:14 PM, Tom Christie  wrote:

> https://github.com/marcgibbons/django-rest-swagger
>
>
> On Saturday, 5 November 2016 16:17:10 UTC, pradam.programming wrote:
>>
>> Hi Guys,
>>  Please I need an advice on the best approach to take on the following
>> issues.
>>
>> How can i Implement Swagger for CBV and FBV in rest framework ...?
>>
> --
> 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/19d26fb5-9875-4388-9a29-4438720dbd54%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/CAGGVXBM364bbGesGmuitHFjXLLcVg1%3D9f7a3-XphnyrxP7uX-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.