Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-27 Thread Mike Dewhirst
On 26/04/2016 9:41 PM, Bruce Whealton wrote: Mike, Â Â Â Â Â So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. Â It seemed to work ok, in terms of migrating fine. Â However, the database now lacks a

Re: New to Django (stuck at the end of the tutorial)

2016-04-27 Thread Nikhil Beniwal
You can define it like :- url(r'^$', 'apps_name.views.home', name='home'), On Wednesday, April 27, 2016 at 6:28:38 AM UTC+5:30, Cronos Cto wrote: > > Could you give me an example or so Vijay Khemali? > -- You received this message because you are subscribed to the Google Groups "Django

Regarding django session handling:- cookie and session ID

2016-04-27 Thread Samarjeet Singh
While doing CSDL compliance i need to know that does django framework give following feature and if it does which are the API for the same. 1. When cookies are used to carry authentication tokens or session IDs within a web application, and multiple such cookies are present, does django

regarding Session ID and cookie validation

2016-04-27 Thread Samarjeet Singh
Hi All, Your input is very much valuable ,kindly help me out regarding this. I need to have a CSDL compliance for following for a project using django framwork :- But my main concern here is how does django framework validates the session id and cookie and is it defalut in all the

Accept the json request.

2016-04-27 Thread 1175190234
I was wondering if there is any method to the handle the *json* request in an easy and simple way. For examle ( in flask ): names = request.json['names'] But in django, I will use: import json text = request.read() names =json.loads(text)['names'] Is there any way better? -- You received this

run Parent __init__

2016-04-27 Thread Григор Колев
Where is the problem in this code. class A (View): def __init__(self): self.data = ['1', '2'] def get(self, request): pass class B (View, A): def get(self, request): A.__init__(self) -- You received this message because you are subscribed to the

Re: run Parent __init__

2016-04-27 Thread Vijay Khemlani
Class B shouldn't extend View, A already does It doesn't make a lot of sense to call the constructor again (__init__) from another method (get) On Wed, Apr 27, 2016 at 11:18 AM, Григор Колев wrote: > Where is the problem in this code. > > class A (View): > > def

Re: (Newbie) Stuck with annotate() docs

2016-04-27 Thread Ankush Thakur
I'm not sure how Book.objects.first().chapters is different from Book.objects.first().chapters.count(), but the point is that "chapters" is not defined in the models at the top of that page! The snippet makes sense if I treat Book.chapters as another ManyToManyField (like authors), but it's

Re: run Parent __init__

2016-04-27 Thread Григор Колев
I create menu in class A I create html tables with column and row In class B i must change only get method. сряда, 27 април 2016 г., 17:22:59 UTC+3, Vijay Khemlani написа: > > Class B shouldn't extend View, A already does > > It doesn't make a lot of sense to call the constructor again

Re: Using django login functionality in a non django app

2016-04-27 Thread Larry Martell
Well, not really. I have managed to invoke my django login screen from my Qt app, but after I log in, of course my django app comes up. What I would like is to pass in some parameter to the login screen (which is easy), and then have my django app detect that and after successfully or

Re: Using django login functionality in a non django app

2016-04-27 Thread Gergely Polonkai
I would create a separate view for this, like /falcon_login/, which could give you a plain text result. But that’s totally up to you. Gergely Polonkai [image: https://]about.me/gergely.polonkai

Re: Using django login functionality in a non django app

2016-04-27 Thread Avraham Serour
You can just use the session id, call it a token instead of cookie and be happy On Wed, Apr 27, 2016, 6:53 PM Gergely Polonkai wrote: > I would create a separate view for this, like /falcon_login/, which could > give you a plain text result. But that’s totally up to you. >

Re: Test runner wants to run models package?!

2016-04-27 Thread Torsten Bronger
Hallöchen! Tim Graham writes: > Could you try Python 3.4.x? The problem does not exist with Python 3.4.3. (Ubuntu 14.04) > I ran into some issues with Django's own test suite [0] due to > some import changes in Python 3.5 [1]. If I look at Python 3.5's release notes, the following is

Completed form for an authenticated user

2016-04-27 Thread Said Akhmedbayev
Let's say, for example, I have a reusable form. An authenticated user fills out this form and saves it. How then, I can show to the user a page with the complete form? Sorry, for not being able to explain the question clearly, I am new to django and to the web development in general. -- You

Fwd: Built In Template Tag Request

2016-04-27 Thread Paul Kenjora
Hello, I sometimes have to pass more complex content into an include or another tag as a variable. The {% with %} tag and filters aren't enough to for example render an HTML button and pass it into another include. I'd like to request a {% with_html variable %} tag in the built in tag set.

Re: Completed form for an authenticated user

2016-04-27 Thread Gergely Polonkai
It is indeed unclear, what you want to do. How I understood it: show a bunch of fields to the user that they can fill with data then, they press the Save button, and the data gets into the database (or whatever) then, you want to show the same fields, filled with the data that the user just

Re: admin popup + button help

2016-04-27 Thread Giuseppe
I managed to get this working, sort of. I learned that I need to include jquery.init.js to my parent form. otherwise It wont open in a new window. Now the only issue I am encountering is after I submit my child form, the window goes white, but does not close. I think the code that gets called

Re: (Newbie) Stuck with annotate() docs

2016-04-27 Thread Tim Graham
Please give this a try: https://github.com/django/django/pull/6524 On Wednesday, April 27, 2016 at 10:45:03 AM UTC-4, Ankush Thakur wrote: > > I'm not sure how Book.objects.first().chapters is different > from Book.objects.first().chapters.count(), but the point is that > "chapters" is not

Nagios plugins for Monitoring Django Apps

2016-04-27 Thread Keir W
Does anyone have any tips on monitoring the health & status of a django app, possibly with the use of a Nagios plugin? I am using check_log to grep out any errors from the apache error log file (when using mod_wsgi) but wondered if I was missing a trick and someone had something better to try.

CSRF verification failed. Request aborted.

2016-04-27 Thread Jagga Soorma
Hi Guys, We have a few internal sites that seem to be creating a cookie with domain .xxx.com. If I access one of these sites and then try to access my horizon interface (which creates a yyy.xxx.com domain cookie) I am no longer able to and get the following error message: -- CSRF

Re: Nagios plugins for Monitoring Django Apps

2016-04-27 Thread Gergely Polonkai
Hello, I don’t know of any built-in metrics in Django that you can monitor. If you write some for your apps, you could also write some monitoring scripts, too (probably in the form of a management command). Best, Gergely Gergely Polonkai [image: https://]about.me/gergely.polonkai

Re: I'm new to programming, I don't know where consider as "document root of web server"

2016-04-27 Thread Lachlan Musicman
Mie, Traditionally the document root to your webserver is (depending on your system) /var/www. This will be defined in the webserver (apache2/httpd, nginx, etc) configuration. I normally create a folder in my home dir called www and place my sites within that /home/lachlan/www/site1

Re: I'm new to programming, I don't know where consider as "document root of web server"

2016-04-27 Thread Lachlan Musicman
Sorry, that was a "where is" not a "what is" The document root of your webserver is the *default* location on the file system that the webserver will look for content/websites/things to "serve". cheers L. -- The most dangerous phrase in the language is, "We've always done it this way." -

Re: New to Django (stuck at the end of the tutorial)

2016-04-27 Thread Mie Rex
> > I had a smiliar problem with another Django tutorial. > I was running Django with Anaconda environment and I took the advice from "Two Scoop Django" to have all projects stored in one directory and all the environment in another. Therefore the project "mysite" was initialized and put in

Re: I'm new to programming, I don't know where consider as "document root of web server"

2016-04-27 Thread Mie Rex
for your case, site1 and site2 are two isolate webserver, correct? Will all the files under both of these directories open to public once the server is up and running? Is the article from the tutorial suggest to have .py files store in some other place to avoid it being see by visitors online?

Re: Completed form for an authenticated user

2016-04-27 Thread Said Akhmedbayev
Yes Gergely, it is exactly what I want, simple form that saves a user's input into database. I have gone through tutorial on the django doc website and kind of know how forms work in general. I just cannot figure out how to hook together a user with his/her input data. On Wednesday, April 27,

Re: I'm new to programming, I don't know where consider as "document root of web server"

2016-04-27 Thread Lachlan Musicman
On 28 April 2016 at 14:41, Mie Rex wrote: > for your case, site1 and site2 are two isolate webserver, correct? > Will all the files under both of these directories open to public once the > server is up and running? > Oops - almost, but not quite. Site1 and Site2 are two

Generation of Session IDs in Django

2016-04-27 Thread Arun S
Hi, Just trying to get a few answers on the Session IDs in Django. > how does Django Generate Session IDs/Session Keys. It seems that Django does the following for Session Keys: def _get_new_session_key(self): "Returns session key that isn't being used." while True: session_key =