Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
If you need it when you already have a request object, (i.e. not during initial setup/install), check out request.META options in the documentation. HTH Jirka On Tue, Jul 2, 2013 at 8:43 AM, Larry Martell wrote: > On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube > wrote: > > It s

Re: Views, Forms not working.

2013-07-02 Thread Nigel Legg
Nick - I removed some irrelevant stuff earlier, and removed those tags by mistake. Cheers, N// Regards, Nigel Legg 07914 740972 http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 1 July 2013 22:20, Nick Dokos wrote: > Nigel Legg writes: > > > template datatab

Re: data transfer between databases

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 4:01pm, Simon Riggs wrote: On 2 July 2013 05:49, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: On Monday, July 1, 2013 10:32:53 PM UTC+10, si...@2ndquadrant.com wrote: On 1 July 2013 13:02, Mike Dewhirst wrote: On 1

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 1:02 AM, Jirka Vejrazka wrote: > If you need it when you already have a request object, (i.e. not during > initial setup/install), check out request.META options in the documentation. I need to get it from a standalone program. It's a django script, but not invoked from a r

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but not invoked from a request. import socket def get_fully_qualified_domain_name(): return socket.getfqdn() -- You received this message because you are subscribed to the Google Gr

AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

2013-07-02 Thread Pratik Mandrekar
Hello, I keep getting the error *AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module' *and the only trace available is as shown below: 'RegexURLResolver' object has no attribute '_urlconf_module' My Sentry Error reporting normally shows the above error along with anothe

Re: AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

2013-07-02 Thread Tom Evans
On Tue, Jul 2, 2013 at 12:14 PM, Pratik Mandrekar wrote: > > Hello, > > > I keep getting the error AttributeError: 'RegexURLResolver' object has no > attribute '_urlconf_module' and the only trace available is as shown below: > > 'RegexURLResolver' object has no attribute '_urlconf_module' > > My

AbstractUser with Django CMS

2013-07-02 Thread Aliona Kutalovskaja
Hey, is possible use AbstractUser with django cms? And how that 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.

Custom Filter in Django (1.5.1) Admin returns SuspiciousOperation

2013-07-02 Thread Matthieu Rigal
Hi all, I was trying to update a snippet to create a custom filter for the Django Admin running under versions 1.4/1.5, but I came across a point I am not able to solve myself anymore... Could anybody get a look at the following (code is imho more readable on stackoverflow) and eventually propo

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst wrote: > On 2/07/2013 5:07pm, Larry Martell wrote: >> >> I need to get it from a standalone program. It's a django script, but >> not invoked from a request. > > > import socket > def get_fully_qualified_domain_name(): > return socket.getfqdn()

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 9:51pm, Larry Martell wrote: On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst wrote: On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but not invoked from a request. import socket def get_fully_qualified_domain_name():

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst wrote: > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst >> wrote: >>> >>> On 2/07/2013 5:07pm, Larry Martell wrote: I need to get it from a standalone program. It's a django script, but >>>

Re: Getting URL root

2013-07-02 Thread Mike Dewhirst
On 2/07/2013 4:43pm, Larry Martell wrote: On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube wrote: It sounds like you want to get the subdomain. Havew a look at the urlparse module and its usage. http://stackoverflow.com/questions/6925825/get-subdomain-from-url-using-python Perhaps I

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 6:46 AM, Mike Dewhirst wrote: > On 2/07/2013 4:43pm, Larry Martell wrote: >> >> On Mon, Jul 1, 2013 at 7:55 PM, Sithembewena Lloyd Dube >> wrote: >>> >>> It sounds like you want to get the subdomain. Havew a look at the >>> urlparse >>> module and its usage. >>> >>> >>> htt

Re: no style in admin pages; learning from djangobook.com

2013-07-02 Thread Jared Nielsen
It was the 'django.contrib.staticfiles' in INSTALLED_APPS. Looks as it should now. Thanks for the help. On Monday, July 1, 2013 9:58:52 AM UTC-7, Vineet Naik wrote: > > Adding to Jacky Tian's reply, if you are running the django dev > server, check if DEBUG is set to True and `django.contrib.st

Re: Getting URL root

2013-07-02 Thread Drew Ferguson
On Tue, 2 Jul 2013 06:13:23 -0600 Larry Martell wrote: > On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst > wrote: > > On 2/07/2013 9:51pm, Larry Martell wrote: > >> > >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst > >> wrote: > >>> > >>> On 2/07/2013 5:07pm, Larry Martell wrote: > > >

Re: Getting URL root

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 7:12 AM, Drew Ferguson wrote: > On Tue, 2 Jul 2013 06:13:23 -0600 > Larry Martell wrote: > >> On Tue, Jul 2, 2013 at 6:06 AM, Mike Dewhirst >> wrote: >> > On 2/07/2013 9:51pm, Larry Martell wrote: >> >> >> >> On Tue, Jul 2, 2013 at 1:25 AM, Mike Dewhirst >> >> wrote: >> >

Re: Getting URL root

2013-07-02 Thread Jirka Vejrazka
> I know them, but I need to programmatically get it in a way that works everywhere. Sorry, you can't. You might be able to do in in some circumstances, but not reliably "everywhere". There is too many unknowns involved if you are out of the request-response cycle (e.g. named virtual hosts, CNAME

Re: Help in finding how to learn Django

2013-07-02 Thread Randy Baxley
Thank you for your list of things to learn Django. I had already worked through dr chucks web site and MOOC, U of Toronto first and second course at Coursera, Rice's Interactive Python also at Coursera and most of Udacity CS 101 so was getting very familiar with python. Working now through the

Re: AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'

2013-07-02 Thread Pratik Mandrekar
Hey Tom, My ROOT_URLCONF points to 'urls' which is the top level urlconf for my site. Besides all my urls do work. This error keeps coming intermittently but does not affect my application logic in any way I know. So I need to know why this error keeps getting reported and how to fix it. Thank

Embedded documents doubts

2013-07-02 Thread Hélio Miranda
Hi I have an application in Django-Tastypie and MongoDB, where I have to enter a club, that club can have multiple contacts. So I was thinking for the document within the document contact club is the best option? I was trying something like this: *class ClubContact (mongoengine.EmbeddedDocument

django admin

2013-07-02 Thread Kakar Arunachal Service
Hi! I am really confused here Can i change the admin url??? Or does it always have to be "www.example.com/admin" ??? -- 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 emai

Re: nginx and apache

2013-07-02 Thread Kakar Arunachal Service
Thanks. So, nginx is good for both static and app files too? On Tue, Jul 2, 2013 at 3:18 AM, Rafael E. Ferrero wrote: > i installed apache, its strong but seems to nginx its more faster... i'll > planning change to nginx... are some people using nginx for static server > and apache for app serve

Re: django admin

2013-07-02 Thread Jonathan Baker
Sure you can change it. Here is the relevant documentation as to how you included it in the first place: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf Simply change 'admin' to something else. Jonathan On Tue, Jul 2, 2013 at 9:35 AM, Kakar

Re: django admin

2013-07-02 Thread Deepak Sharma
On Tue, Jul 2, 2013 at 9:05 PM, Kakar Arunachal Service wrote: > I am really confused here Can i change the admin url??? Or does it always > have to be > "www.example.com/admin" ??? Hi, Yes, you can change this. At the place of www.example.com give your IP address or if you are using this on

Re: django admin

2013-07-02 Thread Kakar Arunachal Service
Thanks a ton! :D On Tue, Jul 2, 2013 at 9:13 PM, Deepak Sharma wrote: > On Tue, Jul 2, 2013 at 9:05 PM, Kakar Arunachal Service > wrote: > > I am really confused here Can i change the admin url??? Or does it always > > have to be > > "www.example.com/admin" ??? > > > Hi, > > Yes, you can

Re: nginx and apache

2013-07-02 Thread Rafael E. Ferrero
Yes! 2013/7/2 Kakar Arunachal Service > Thanks. So, nginx is good for both static and app files too? > > > On Tue, Jul 2, 2013 at 3:18 AM, Rafael E. Ferrero < > rafael.ferr...@gmail.com> wrote: > >> i installed apache, its strong but seems to nginx its more faster... i'll >> planning change to

Re: nginx and apache

2013-07-02 Thread Kakar Arunachal Service
Can you please suggest any good tutorial regarding this. And i'm on windows. :( -- 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...@googlegr

Integrating Django with Trac

2013-07-02 Thread saintger
Hello, I would like to make a website with Django and manage the issues with Trac. I can see that the Django website currently do the same (so it must be a good idea !). I've found the following thread: https://groups.google.com/d/topic/django-users/OD3rP_iAUc0/discussion But I would like to kn

Re: URL shorteners

2013-07-02 Thread Ryan Nowakowski
On Mon, Jul 01, 2013 at 02:20:56PM -0600, Larry Martell wrote: > On Mon, Jul 1, 2013 at 2:18 PM, Amirouche Boubekki > wrote: > > Héllo, > > > > Are you looking for an API for a shorturl service or a standalone app to > > make a short url service ? > > I was looking for a django package that I cou

Re: nginx and apache

2013-07-02 Thread Rafael E. Ferrero
https://code.djangoproject.com/wiki/DjangoAndNginx http://wiki.nginx.org/DjangoFastCGI its a start. ;) 2013/7/2 Kakar Arunachal Service > Can you please suggest any good tutorial regarding this. And i'm on > windows. :( > > -- > You received this message because you are subscribed to the Googl

London based Django Dev: UX/UI (£300 per day)

2013-07-02 Thread George Kazarian
By way of introduction my name is George and I'm the founder and CEO of www.therecipekit.co.uk. We are a London based online retail startup selling recipe kits that include amazing ingredients and simple to follow cooking instructions. Right now, I'm looking for a freelance django developer t

Class Based View returning blank post data

2013-07-02 Thread Lucas Simon
Hi, I think I found a bug and was not sure where to post it other than here. I have created a view defined as follows from django.http import HttpResponse, Http404 from django.views.generic.base import View class TestView(View): def post(self, request, *args, **kwargs): print "*

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
That's the expected output, since your URL pattern to that view doesn't contain any arguments. Take a look at the examples in https://docs.djangoproject.com/en/1.5/topics/http/urls/ ... the URL patterns with groups will have the matched values passed to the view function as arguments (named groups

Re: London based Django Dev: UX/UI (£300 per day)

2013-07-02 Thread Frank Bieniek
Hi George, for that kind of money do not expect to get a senior Cheers Frank Am 02.07.2013 21:57, schrieb George Kazarian: By way of introduction my name is George and I'm the founder and CEO of www.therecipekit.co.uk . We are a London based online retail

Re: Class Based View returning blank post data

2013-07-02 Thread Lucas Simon
How does this fit in with a large JSON document? There should be a way to parse all of this arbitrary data, and filter out the stuff that fits into a form On Tuesday, July 2, 2013 3:08:10 PM UTC-6, Nikolas Stevenson-Molnar wrote: > > That's the expected output, since your URL pattern to that vi

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
Are you sending the JSON document as the body of your POST request? If so, you won't see anything in request.POST, because it's only populated for requests using application/x-www-form-urlencoded. You probably want to use request.body (https://docs.djangoproject.com/en/1.5/ref/request-response/#dja

Re: Class Based View returning blank post data

2013-07-02 Thread Lucas Simon
request.body returns an empty string. Here is a copy of my request *** , POST:, COOKIES:{'csrftoken': 'ivBhSl6RT0TXdrIrTR9WxGeLwyXmpygN'}, META:{'CCACHE_HASHDIR': '', 'COLORTERM': 'gnome-terminal', 'CONTENT_LENGTH': '0', 'CONTENT_TYPE': 'application/json', 'CVS_RSH'

Re: Class Based View returning blank post data

2013-07-02 Thread Lucas Simon
Also, here is my updated view from django.http import HttpResponse, HttpRequest , Http404 from django.views.generic.base import View from django.views.decorators.csrf import csrf_exempt class TestView(View): def post(self, request, *args, **kwargs): print "***" print H

Re: London based Django Dev: UX/UI (£300 per day)

2013-07-02 Thread Sithembewena Lloyd Dube
I'd churn out code for that budget. In my neck of the woods, it's nothing to scoff at. However, I have not seen the code, so I cannot say whether or not the time-frame and remuneration tally. It is an easy mistake to accept a time-frame and a rate without seeing code, only to find that the code ba

Returning data from view to ajax call

2013-07-02 Thread Larry Martell
I'm invoking a view from an ajax call and I want to return data. But the browser interpertates the return as a 500 (internal sever error) and my ajax success function does not get called. How can I return a successful status (like a 201) and also return data? -- You received this message because

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
Two things: 1) The content-length of your request (in your previous email) is 0, suggesting there was no body submitted with the request. What is the CURL command you're using to make the request? 2) HttpRequest.body should be request.body. HttpRequest is a class not the request object (which is

Re: Returning data from view to ajax call

2013-07-02 Thread Sithembewena Lloyd Dube
What data format is your view returning? Django views return HTTP response objects (by default, at least) - although Python lists (and other Python collections?) should work when passed into a view in its context (I have found Django querysets to be an exception). AJAX is Asynchronous Javascript,

can we pass objects in template tags

2013-07-02 Thread surya
I would like to pass object into template tag, then process it.. Is it possible def my_tag(parser, token): return Node() The token object seems to be a string!! but how to get some objects?? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 4:24 PM, Sithembewena Lloyd Dube wrote: > What data format is your view returning? Django views return HTTP response > objects (by default, at least) - although Python lists (and other Python > collections?) should work when passed into a view in its context (I have > found

Exception Value: Reverse for 'vote' with arguments '('',)' and keyword arguments '{}' not found.

2013-07-02 Thread Pepsodent Cola
Hi, 1.) When following the Django 1.5 poll tutorial everything works ok. Until I try to implement the *"Generic views"* to use less code in the poll, then the poll app breaks. https://docs.djangoproject.com/en/1.5/intro/tutorial04/#use-generic-views-less-code-is-better 2.) When go to this lin

Re: Returning data from view to ajax call

2013-07-02 Thread Sanjay Bhangar
On Tue, Jul 2, 2013 at 3:37 PM, Larry Martell wrote: > On Tue, Jul 2, 2013 at 4:24 PM, Sithembewena Lloyd Dube > wrote: > > What data format is your view returning? Django views return HTTP > response > > objects (by default, at least) - although Python lists (and other Python > > collections?) s

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 4:49 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 3:37 PM, Larry Martell > wrote: >> >> On Tue, Jul 2, 2013 at 4:24 PM, Sithembewena Lloyd Dube >> wrote: >> > What data format is your view returning? Django views return HTTP >> > response >> > objects (by default, at

Re: Returning data from view to ajax call

2013-07-02 Thread Sanjay Bhangar
On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell wrote: > > In the browser the response has this: > > HTTP/1.0 200 OK > Date: Tue, 02 Jul 2013 22:53:47 GMT > Server: WSGIServer/0.1 Python/2.7.2 > Vary: Cookie > Content-Type: text/plain > > No content. But I verified from pdb that the python code is

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell > wrote: >> >> >> >> In the browser the response has this: >> >> HTTP/1.0 200 OK >> Date: Tue, 02 Jul 2013 22:53:47 GMT >> Server: WSGIServer/0.1 Python/2.7.2 >> Vary: Cookie >> Content-Type: te

Re: Returning data from view to ajax call

2013-07-02 Thread Sanjay Bhangar
On Tue, Jul 2, 2013 at 4:20 PM, Larry Martell wrote: > On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar > wrote: > > On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell > > wrote: > >> > >> > >> > >> In the browser the response has this: > >> > >> HTTP/1.0 200 OK > >> Date: Tue, 02 Jul 2013 22:53:47 GM

Re: Returning data from view to ajax call

2013-07-02 Thread Larry Martell
On Tue, Jul 2, 2013 at 5:24 PM, Sanjay Bhangar wrote: > On Tue, Jul 2, 2013 at 4:20 PM, Larry Martell > wrote: >> >> On Tue, Jul 2, 2013 at 5:14 PM, Sanjay Bhangar >> wrote: >> > On Tue, Jul 2, 2013 at 4:01 PM, Larry Martell >> > wrote: >> >> >> >> >> >> >> >> In the browser the response has t

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-07-02 Thread Jason Arnst-Goodrich
I think I found one more nicety to add. The following is the verify_token method for TOTPDevice: def verify_token(self, token): OTP_TOTP_SYNC = getattr(settings, 'OTP_TOTP_SYNC', True) try: token = int(token) except StandardError: verified = Fa

django dynamic template tag

2013-07-02 Thread Fadi Samara
I try to build a plugins based application, I have created tags and registered them for each plugin. I have a table stores each page plugins, and need to render any stored plugin in the template accordingly as inclusion tag. Now for the template i use this: {% block slider_region %}{% for p

Passing multiple related fixtures to django management loaddata

2013-07-02 Thread Bayard Randel
Hi there, I have a south migration where I'm using django.core.management.call_command() to load yaml fixtures for 2 models into Postgres. Currently I have multiple fixtures with circular foreign key relationships and concatenate these to a single fixture. Ideally, for ease of maintenance, I w