/admin redirects me to 127.0.0.1:8000/admin on nginx+gunicorn production server

2013-07-17 Thread Daniel Oźminkowski
Hello, first I want to state, that I am a beginner and everything still works a little like magic for me. I have always worked with django by running it with runserver. Recently decided to put it on virtual machine and serve the site with nginx + gunicorn. I understand how to serve static files

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
I tried to make it simple like this: placeTag = "'\%"+placeTag+"\%'" ... query = r""" ... WHERE placeType_id = %s AND placeTag LIKE %s ... """ The query string is correct: WHERE placeType_id = 1 AND placeTag like '\%tes\%' But i got no result in django. When i execute it in mysql client i got re

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 9:13 PM, Harjot Mann wrote: > It is used only for one report and there is some error,so it is there > but not working. Then fix it! -- Kamaljeet Kaur Blog:http://kamalkaur188.wordpress.com/ -- You received this message because you are subscribed to the Google Groups

Re: Every view requires authentication

2013-07-17 Thread Jon Dufresne
On Wed, Jul 17, 2013 at 4:24 PM, Arnold Krille wrote: > Still interesting that you need authentication while not needing any > authorization... Oh, I see what you're saying. The login_required does not need to be added explicitly, because it is added implicitly by the authorization check. Yeah

Re: new user having trouble displaying images stored on local disk drive

2013-07-17 Thread evh
Thanks, but my real problem turned out to be a missing comma after the staticfiles_dirs entry. After adding it I was able to see files stored on my hard drive. On Wednesday, July 17, 2013 2:07:42 AM UTC-4, Lukáš Němec wrote: > > Hi, > > You are not the first to have trouble when serving image

Re: Every view requires authentication

2013-07-17 Thread Arnold Krille
On Wed, 17 Jul 2013 14:18:54 -0700 Jon Dufresne wrote: > On Wed, Jul 17, 2013 at 1:25 PM, Arnold Krille > wrote: > > > On Wed, 17 Jul 2013 11:22:36 -0700 Jon Dufresne > > wrote:The standard-way depende on your > > views: > > - If its function-based views, use the @login_required-decorator. > >

Re: how to display image on a template

2013-07-17 Thread Charly Román
> > What should my template have to get the image ?? > First add an url to this view, next: -- 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+unsub

Custom logging formatter issue

2013-07-17 Thread Tony D
I am attempting to eventually set up django logging via a third-party service. For this I am using python-json-logger and setting up an appropriate formatter in the LOGGING dictionary in settings.py. I believe I have it set up correctly, but when the formatter is enabled the first page I get af

Re: Need help on customizing my django admin page to my own new look

2013-07-17 Thread Rurangwa Moses
Thx a bunch guys it worked -- 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 djang

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
i tried swap the WHERE condition become like this: WHERE %s placeType_id=%s \ and tags: tags = " (placeTag LIKE '%" + "%' OR placeTag LIKE '%".join(placeTag.split(',')) + "%') AND " but got this error: DatabaseError: (1064, "You have an error in your SQL syntax; check the manual that correspond

Re: Every view requires authentication

2013-07-17 Thread Jon Dufresne
On Wed, Jul 17, 2013 at 1:25 PM, Arnold Krille wrote: > On Wed, 17 Jul 2013 11:22:36 -0700 Jon Dufresne > wrote:The standard-way depende on your views: > - If its function-based views, use the @login_required-decorator. > - For class-based views we use the LoginRequiredMixin from >django-b

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
I've tried the debugger but i have no idea how to use it to find my problem. in Pdb console i've tried check any variable value and everything seems fine On Wednesday, July 17, 2013 10:34:39 PM UTC+7, larry@gmail.com wrote: > > On Wed, Jul 17, 2013 at 9:28 AM, spondbob squelpen > > > wrote

Re: Design for storing likes/dislikes?

2013-07-17 Thread Arnold Krille
On Tue, 16 Jul 2013 17:29:47 -0700 (PDT) Victor Hooi wrote: > We have a list of users, who are going to like/dislike various > widgets. > > My question is regarding how to store the like/dislikes. > > Essentially, there can be three states between a user and a widget - > like, dislike, and unrat

Re: Every view requires authentication

2013-07-17 Thread Arnold Krille
On Wed, 17 Jul 2013 11:22:36 -0700 Jon Dufresne wrote: > My application requires an authenticated user for every view (with > very few exceptions). Is there a standard correct way to handle this > or should I roll my own middleware? I'm probably not the first have > this requirement. The standard

Every view requires authentication

2013-07-17 Thread Jon Dufresne
My application requires an authenticated user for every view (with very few exceptions). Is there a standard correct way to handle this or should I roll my own middleware? I'm probably not the first have this requirement. -- You received this message because you are subscribed to the Google Group

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:26 PM, Kamal Kaur wrote: > Hope this helps: > https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ > > http://stackoverflow.com/questions/1377446/html-to-pdf-for-a-django-site @ Kamal thnks but its already there. -- Harjot Kaur Mann Blog: http://harjotmann.wordp

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:53 PM, Kamal Kaur wrote: > It must work if it is there?? It is used only for one report and there is some error,so it is there but not working. -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ -- You received this message because you are subscribed to the G

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:58 AM, spondbob squelpen wrote: > where do i put those double percentage? like this? > tags = " AND (placeTag LIKE '%%" + "%%' OR placeTag LIKE > '%%".join(placeTag.split(',')) + "%%')" > > but still got the same error: > Warning: Truncated incorrect DOUBLE value: '1 AND

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:24 AM, spondbob squelpen wrote: > I have problem in django using query statement "like %s%" with > Model.objects.raw(). I guess the problem is on '%' character but i don't > know where is it. Here's my model's code: > > def listInRange(self, placeLat, placeLng, typeId

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
sorry i'm new with django, could u please tell me how to use the debugger? On Wednesday, July 17, 2013 10:17:10 PM UTC+7, larry@gmail.com wrote: > > On Wed, Jul 17, 2013 at 9:15 AM, spondbob squelpen > > > wrote: > > the '1' is coming from typeId, so the WHERE condition must be look like:

Re: django templates

2013-07-17 Thread Tom Evans
On Wed, Jul 17, 2013 at 4:01 PM, Harjot Mann wrote: > On Wed, Jul 17, 2013 at 8:20 PM, Tom Evans wrote: >> Does your website currently produce pdfs, or are you asking how to >> turn multiple HTML pages from your site into a single PDF? > > > Yes, I want this it has reportlab and pisa modules to p

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 9:28 AM, spondbob squelpen wrote: > sorry i'm new with django, could u please tell me how to use the debugger? In your python code, add this "import pdb; pdb.set_trace()' at the place you want the breakpoint. Then run: python manage.py runserver Then go to your web page

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 9:15 AM, spondbob squelpen wrote: > the '1' is coming from typeId, so the WHERE condition must be look like: > WHERE placeType_id=1 AND (placeTag LIKE '%test%') > > print out tags: > AND (placeTag LIKE '%test%') > > i have tried your solution by adding double percentage b

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 8:33 PM, Harjot Mann wrote: > @ Kamal thnks but its already there. It must work if it is there?? -- Kamaljeet Kaur Blog:http://kamalkaur188.wordpress.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
the '1' is coming from typeId, so the WHERE condition must be look like: WHERE placeType_id=1 AND (placeTag LIKE '%test%') print out tags: AND (placeTag LIKE '%test%') i have tried your solution by adding double percentage but still got same error On Wednesday, July 17, 2013 10:04:48 PM UTC+7

Re: django templates

2013-07-17 Thread Kamal Kaur
On Wed, Jul 17, 2013 at 8:04 PM, Harjot Mann wrote: > No, this is not admin problem. I am getting the reports templates but > these are not saved anywhere, valuse are coming from database. But I > want to take the print outs i.e the hard copy of all the reports which > are made till now by saving

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 8:20 PM, Tom Evans wrote: > Does your website currently produce pdfs, or are you asking how to > turn multiple HTML pages from your site into a single PDF? Yes, I want this it has reportlab and pisa modules to produce pdfs. -- Harjot Kaur Mann Blog: http://harjotmann.wor

Re: 'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
where do i put those double percentage? like this? tags = " AND (placeTag LIKE '%%" + "%%' OR placeTag LIKE '%%".join(placeTag.split(',')) + "%%')" but still got the same error: Warning: Truncated incorrect DOUBLE value: '1 AND (placeTag LIKE '%%test%%')' On Wednesday, July 17, 2013 9:47:25 PM

Re: django templates

2013-07-17 Thread Larry Martell
On Wed, Jul 17, 2013 at 8:34 AM, Harjot Mann wrote: > On Wed, Jul 17, 2013 at 6:46 PM, Derek wrote: >> One option is to use a Django admin action - the user selects which job/jobs >> are needed from the usual list - >> and your action can then generate the data, passing this into a single >> "mas

Re: django templates

2013-07-17 Thread Tom Evans
On Wed, Jul 17, 2013 at 3:34 PM, Harjot Mann wrote: > No, this is not admin problem. I am getting the reports templates but > these are not saved anywhere, valuse are coming from database. But I > want to take the print outs i.e the hard copy of all the reports which > are made till now by saving

Re: django templates

2013-07-17 Thread Harjot Mann
On Wed, Jul 17, 2013 at 6:46 PM, Derek wrote: > One option is to use a Django admin action - the user selects which job/jobs > are needed from the usual list - > and your action can then generate the data, passing this into a single > "master template" (composite of your other templates) for the u

Re: a bit confused about projects/apps

2013-07-17 Thread Alex Hall
Thanks for the responses. I had considered a cms, but I'd like the practice of making one for myself, at least to start with. Since Django already takes care of users, admins, and (I presume) security, much of the hard work of a cms is already taken care of. My understanding is that I need only

'LIKE' statement in Model.objects.raw() with percentage '%'

2013-07-17 Thread spondbob squelpen
I have problem in django using query statement "like %s%" with Model.objects.raw(). I guess the problem is on '%' character but i don't know where is it. Here's my model's code: def listInRange(self, placeLat, placeLng, typeId, range, placeTag): tags = '' if placeTag:

Re: a bit confused about projects/apps

2013-07-17 Thread Brian Schott
Unless you really want to build it all from scratch, you might want to look at a CMS framework such as Mezzanine (http://mezzanine.jupo.org), DjangoCMS (https://www.django-cms.org), FeinCMS. Think of a project as a Django web server configuration. In the end, manage.py and settings.py are just

Re: Need help on customizing my django admin page to my own new look

2013-07-17 Thread Mário Neto
A path to follow: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates 2013/7/17 Rurangwa Moses > Hey guys, > I need some help on how to customize a django admin page to whole new > different look rather than the default django admin page > > Thanks > > -- > You r

Re: Need help on customizing my django admin page to my own new look

2013-07-17 Thread Rafael E. Ferrero
create a /statics/admin folder in your project and paste into admin folder all django admin folder... css, js, etc... then modify this with your own look... Django first try to execute this if not found go with Django Admin looks (original admin interface, dont remember quite well, but must to be

Need help on customizing my django admin page to my own new look

2013-07-17 Thread Rurangwa Moses
Hey guys, I need some help on how to customize a django admin page to whole new different look rather than the default django admin page Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Travelport API integration with Django

2013-07-17 Thread Sithembewena Lloyd Dube
Hi, I am working on a component of a Django web application (travel booking engine) which aims to integrate with the Travelport Universal API. It would be great to find out if anyone here has had to do something similar and, if applicable, to hear how they handled the integration. The API provide

Re: a bit confused about projects/apps

2013-07-17 Thread Rafael E. Ferrero
Would my entire site be one project, with apps for programming projects, writings/recordings, and ecommerce? I suggest to you must think an apps like independents projects. An app can to be cuted and pasted into other project and work just fine, with that you can have an app to handle user accounts

Re: django templates

2013-07-17 Thread Derek
One option is to use a Django admin action - the user selects which job/jobs are needed from the usual list - and your action can then generate the data, passing this into a single "master template" (composite of your other templates) for the user to print (or you could have an action just to g

Re: showing the checked item alone in template

2013-07-17 Thread Sivaram R
Tom, It is multiplechoice checkbox,it is saving the checked item in number againsted theor respective reportperson_id. The functionality is working only required is to show the saved number into human redable format.Any idea how to do this . Thanks On Wednesday, July 17, 2013 5:26:55 PM UTC+5

a bit confused about projects/apps

2013-07-17 Thread Alex Hall
Hi all, I currently have a boring, small, plain website to give the essential information about my business. I hope to add a projects section, to host programming projects I have done, a section for hosting articles/tutorials/recordings, and, eventually, an ecommerce system so i can charge for

GETTING STARTED: DJANGO AND NUODB

2013-07-17 Thread Michael Waclawiczek
Web development frameworks are the backbone of today’s scale-out database applications. They come in many different flavors, some are minimalistic providing more leeway with various components while others are more fully featured with a tightly integrated stack. At the end of the day, all thes

Re: showing the checked item alone in template

2013-07-17 Thread Tom Evans
On Mon, Jul 15, 2013 at 3:16 PM, Sivaram R wrote: > forms.py > > PERSON_ACTIONS = ( > ('1', '01.Allowed to rest and returned to class'), > ('2', '02.Contacted parents /guardians'), > ('3', '02a.- Unable to Contact'), > ('4', '02b.Unavailable - left message'),) > > class PersonActio

Re: showing the checked item alone in template

2013-07-17 Thread Lukas Nemec
I meant like this: views.py: form = PersonActionsForm() actions = form.fields['actions'] # set checked_choice to None checked_choice = None for choice in actions.choices: # if choice.selected (confirm this against request.POST) checked_choice = choice return render_to_response(

Re: Design for storing likes/dislikes?

2013-07-17 Thread Victor Hooi
Hi, Cool, didn't know that - thanks =). Performance wise, am I better off creating every single relationship between Users/Widgets as I add users/widgets, and defaulting them to Null then? Or is it better to just add the entries as users like/unlike widgets, and infer the null state from the

Re: django templates

2013-07-17 Thread Daniel Oźminkowski
Hello, I am a beginner, but this looks like a job for custom admin command: https://docs.djangoproject.com/en/1.5//howto/custom-management-commands/ I found it very easy, so it should also be easy for you. Best regards, Daniel W dniu wtorek, 16 lipca 2013 18:43:42 UTC+2 użytkownik Harjot Mann

Re: Reserved word issue?

2013-07-17 Thread Tim Chase
On 2013-07-17 11:14, Nigel Legg wrote: > def on_interaction(self, consumer, interaction, hash): ... > result.sm_Link = interaction['interaction']['link'] ... > Looking at the server log (development server) I get > result.sm_Link = interaction['interaction']['link'] > KeyError: 'link' > >

Re: showing the checked item alone in template

2013-07-17 Thread Sivaram R
Can you provide me a sample or related url for reference purpose.I don't know how to right custom templatetag for this. Thanks On Tuesday, July 16, 2013 11:54:17 AM UTC+5:30, Lukáš Němec wrote: > > You should do something like this (I havent tried it but it should work): > > 1. you are missing t

Reserved word issue?

2013-07-17 Thread Nigel Legg
I am working on integrating social search through the Datasift API into my project. The API gives a json object, and I have printed part of it out to the screen, so I know that the link is working and I am receiving the right stuff. I now want to save some of the fields from the json to a model. m