Re: Search results in template

2017-12-19 Thread Matemática A3K
On Tue, Dec 19, 2017 at 10:12 PM, Malik Rumi wrote: > I am implementing search on a local Django project: Django 1.11.5, Python > 3.6.3, Ubuntu 16.04. My issue is getting the search results onto the > template. > > I am using standard CBV for everything else in the site, but for this one > I wrot

Re: Django field for image with FileAPI, croping, size limit and preview

2017-12-19 Thread laya Mahmoudi
Hello, How should i start designing a website with bottle framework?? On 19 Dec 2017 4:40 am, "IL Ka" wrote: > Hello. > > I am looking for Django application to support ImageField with the > following properties: > * JS FIleAPI in Admin (that means file is uploaded once selected and > validated

Search results in template

2017-12-19 Thread Malik Rumi
I am implementing search on a local Django project: Django 1.11.5, Python 3.6.3, Ubuntu 16.04. My issue is getting the search results onto the template. I am using standard CBV for everything else in the site, but for this one I wrote my own. It uses the same template as my ListView, which s

Re: Many to Many fields and through table

2017-12-19 Thread Simon Charette
Hello Mark, The only downside I can think of is that you won't be able to create relationships from the m2m managers, you'll have to create the relationship directly instead. This isn't such a big issue if you plan on adding fields later to the intermediary model later on anyway. You can read mo

Re: Many to Many fields and through table

2017-12-19 Thread James Schneider
On Dec 19, 2017 1:53 PM, "Mark Phillips" wrote: Is there any downside to creating a through table in a many to many relationship when there isn't any "extra" related data, but there might be in the future? I have read that migrating from a simple m2m relationship to a m2m with a through table ta

Many to Many fields and through table

2017-12-19 Thread Mark Phillips
Is there any downside to creating a through table in a many to many relationship when there isn't any "extra" related data, but there might be in the future? I have read that migrating from a simple m2m relationship to a m2m with a through table takes some jumping through hurdles, so I am consider

Re: Channels routing - must parse path to separate between consumers?

2017-12-19 Thread Andrew Godwin
What you describe there seems like a bug - the first include() should be adding path restrictions. What's confusing is that you said _both_ consumers are getting called? As in each event goes to two routing entries? That definitely shouldn't happen. Andrew On Tue, Dec 19, 2017 at 4:07 AM, SK wro

how to integrate django rest framework jwt and angular 4 authentication?

2017-12-19 Thread rakibul
Hi everyone. I want to build a system where user logged in using username & password.In that purpose i am used djangorestframework-jwt in token based authentication system. djangorestframework-jwt provided this *urls*url(r'^api/auth/token/', obtain_jwt_token) if i go this url it shows userna

Re: Can't wrap my head around routing - docs reference & Github issue inside

2017-12-19 Thread SK
*Update: *I feel like I'm getting closer to solving this issue, but still can't understand one thing. If I have my routing file like this: fb_routing = [ route("websocket.connect", consumers.connect_face), route("websocket.receive", consumers.get_face), route("websocket.disconnect", consumers

Re: send / receive data securely from a wifi module... how many steps?

2017-12-19 Thread Constantine Covtushenko
Hi, As soon as I understand you need to enable django authentication for you applications. Please check following django documentation page. Regards, Constantine C. On Fri, Dec 15, 2017 at 11:16 AM, R design wrote: > I've built a couple of

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Antonis Christofides
So nginx chooses the "server {}" block that contains "default_server" to choose the SSL certificate, and after it receives the headers it choose another "server {}" block as needed? If that is the case, you can create another "server {}" block with "default_server" (usually this is somewhere like /

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Dylan Reinhold
John, You could set the logger to send all DisallowedHost errors to a log file, then just check it ever so often for the bad domains you are looking for. Or better yet have a daily script email them to you (you can exclude your IPs then) Dylan On Tue, Dec 19, 2017 at 5:37 AM, Daniel Hepper wro

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Jon Ribbens
On Tuesday, 19 December 2017 13:37:06 UTC, Daniel Hepper wrote: > > This should ensure that only requests with valid Host headers reach your > application while still supporting Non-SNI clients. You can test it with > "open_ssl client" or "gnutls-cli": > Yes, that looks good to me. Many thanks!

Re: Links to comment function in the backend are wrong

2017-12-19 Thread Constantine Covtushenko
Hi Jan, I would suggest to change python version on new server to be the same as on your previous server. Sach an option should be available. Is it a kind of PAAS service in the cloud? If yes, there should be documentation how to do that. Does it make any sense? Regards, Constantine C. On Tue,

Links to comment function in the backend are wrong

2017-12-19 Thread Jan Kout
Hello, after transfer of my website to a server with a newer version of python the links to comment function in the backend does not work any more. I don't really know django vera well and unfortunatelly I don't know how to fix it. I guess that I could set something in a file but I don't know

Re: Multiple roles assign to user in djnago

2017-12-19 Thread Constantine Covtushenko
Sorry but it is still not clear why you can not use Group for that? For instance you can create group `Manager` and assign any additional permissions to it based on your app requirements. Regarding to User you have 2 options here as said on this page

RE: print option with django application

2017-12-19 Thread Matthew Pava
We use gsprint (for Windows printing) and Ghostscript. http://pages.cs.wisc.edu/~ghost/gsview/gsprint.htm https://www.ghostscript.com/ We have generic print view, and when users click on a button on the UI, our app generates a PDF and then sends that to a printer on the local network. The print

Re: Multiple roles assign to user in djnago

2017-12-19 Thread Ketul Suthar
Yes. But I want to assign role to user as normal user and manager based on selection from drop down in admin site and also add new field role_id in auth_user table On Dec 19, 2017 8:13 PM, "Constantine Covtushenko" < constantine@gmail.com> wrote: > Hi Ketul, > > Did you read that

Re: Multiple roles assign to user in djnago

2017-12-19 Thread Constantine Covtushenko
Hi Ketul, Did you read that django documentation? There you can find all about users, their roles/groups and permissions. Also can you please elaborate what do you mean under `admin panel`? Is it just a reference to admin site? Does it make se

Re: print option with django application

2017-12-19 Thread johnf
I wonder what solutions there are for print from a django app? Is it possible to use reportlab for example.  Or is there some other solution that is normally used from django apps? Johnf On 12/19/2017 05:47 AM, Larry Martell wrote: On Tue, Dec 19, 2017 at 1:50 AM, Ketul Suthar wrote: I wan

Re: print option with django application

2017-12-19 Thread Larry Martell
On Tue, Dec 19, 2017 at 1:50 AM, Ketul Suthar wrote: > I want to print data from database when user click on print button. > > how can I achieve it ? > > Is there any in-built module in djnago for printing data ? You cannot force the user to print. What I do in these situations is generate a pfd

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Daniel Hepper
>From my understanding, deciding which certificate to use and actually serving the request are two separate step in Nginx. I assume you only have one valid domain name you want to serve. Every other HTTPS request will result in a certificate warning and should be rejected. You could try a confi

Re: Error when creating a django app in a specified folder with the same name as the app

2017-12-19 Thread Jason
It appears normal https://code.djangoproject.com/ticket/18564#comment:3 specifically Django _already_ prevents you from creating a project with a package name > that conflicts with some other package on sys.path; this is the most we can > reasonably do. > -- You received this message beca

Re: print option with django application

2017-12-19 Thread Jason
if you just want to print data that's already on the page, but in different style, you need to implement a print-specific CSS stylesheet for your templates if you want to print data that doesn't exist in the page, there's no way to do that. You can implement a server side view that will trigge

Error when creating a django app in a specified folder with the same name as the app

2017-12-19 Thread Nick Gilmour
Hi all, when I try to create a django app in a specified folder with the same name as the app I get the following error: *CommandError: 'my_app' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.* These are the commands I'm using: $ m

Can't wrap my head around routing - docs reference & Github issue inside

2017-12-19 Thread SK
Hi, So maybe I'm getting everything wrong, but I'm a little confused with routing. Let's say I want to separate the consumers dealing with messages coming from my domain root: http://domain.com/ and my `/import/` route: http://domain.com/import/ I have my routing as so: fb_routing = [ ro

Channels routing - must parse path to separate between consumers?

2017-12-19 Thread SK
So I just spent quite an amount of time posting a lengthy question with specifics and examples but Google Groups simply didn't post. I'll make this short: In github issue below Andew writes: Ah, well that's because you don't have a path key in your message - the > routing isn't magical, it ju

print option with django application

2017-12-19 Thread Ketul Suthar
I want to print data from database when user click on print button. how can I achieve it ? Is there any in-built module in djnago for printing data ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

Multiple roles assign to user in djnago

2017-12-19 Thread Ketul Suthar
I have admin who can create User and Manager User (id, name, password,role) Manager (id, name, password,role) So how can i achieve using admin panel in djnago ? for that I have to extend User model or create other model ? Can I use same model for User and Manager ? If the i have to add role f

Re: Constant Invalid HTTP_HOST header spam

2017-12-19 Thread Jon Ribbens
On Tuesday, 19 December 2017 07:24:23 UTC, Antonis Christofides wrote: > > I may be wrong of course, but I don't recall SNI having anything to do > with it. Just using something like > > server { > listen 80; > listen 443 ssl; > server_name my.django.site.com; > ... > } > > will on

Re: confusion in models in django

2017-12-19 Thread IL Ka
Apps not listed in INSTALLED_APPS will not participate in many important steps including migrations ("makemigrations" / 'migrate") so your models will not be created in database -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

Re: How to send parameter to view?

2017-12-19 Thread Etienne Robillard
Hi Kubilay, I guess you could use sessions for that. For example: contest = request.session['contest_name'] See: https://docs.djangoproject.com/en/2.0/topics/http/sessions/ HTH Etienne Le 2017-12-18 à 10:36, Kubilay Yazoğlu a écrit : Hello. I have two apps. Posts and Contests. In templat