Re: syntax error while trying to run '$ django-admin startproject mysite' command on command terminal

2020-08-17 Thread coolguy
Hi Mike, since you didn't mention the exact error... just make sure you 
activated virtual environment and installed django in the directory you are 
in...

On Sunday, August 16, 2020 at 4:17:56 PM UTC-4, Michael O wrote:
>
> hello, i cd into the directory by cd\ to start a project and was welcomed 
> by the blinking '...'. i then typed $  $ django-admin startproject mysite 
> and I go syntax Error: invalid syntax. please help by pointing me in the 
> right direction so that I could continue to learn. Thank you.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9939f7c7-b789-4784-aef9-10ab9589b377o%40googlegroups.com.


syntax error while trying to run '$ django-admin startproject mysite' command on command terminal

2020-08-16 Thread Michael O
hello, i cd into the directory by cd\ to start a project and was welcomed 
by the blinking '...'. i then typed $  $ django-admin startproject mysite 
and I go syntax Error: invalid syntax. please help by pointing me in the 
right direction so that I could continue to learn. Thank you.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fe8d7229-5b9c-4951-9d1a-c3008a084605n%40googlegroups.com.


Re: syntax error: export DJANGO_DEBUG=False

2019-10-12 Thread fishbite
Hi there,

Thank you for your answer, which is correct!

Much appreciated.

On Saturday, October 12, 2019 at 5:16:43 AM UTC+1, WD Wang wrote:
>
> hi,
>
> export DJANGO_DEBUG=False
> This is a shell command, you shouldn't add this to your settings.py.
>
> On Fri, Oct 11, 2019 at 9:51 PM fishbite > 
> wrote:
>
>> Hi there,
>>
>> My first post to this group!
>>
>> I've built the locallibrary project following the MDN tutorial and I'm 
>> now preparing to deploy the site on Heroku as described in the same 
>> tutorial and have added these lines to my settings.py file:
>>
>> *import os*
>> *SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
>> 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*
>>
>>
>> export DJANGO_DEBUG=False
>>
>> I get:
>> SyntaxError: invalid syntax
>>
>> Has anyone else encountered this problem and / or know why it is occuring 
>> or how to resolve the issue?
>>
>> Thanks in advance for any help you can provide.
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/779d99cf-2445-4dcf-9c37-e1f7d9ab7bf0%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6e585bf0-b9d7-4a59-a7ae-7df0c483a45e%40googlegroups.com.


Re: MDN Locallibrary project - syntax error on 'export DJANGO_DEBUG=False'

2019-10-12 Thread fishbite
Thank you Daniel, that's a great help. I sat looking at the tutorial 
thinking to myself that it didn't explicitly say that line should be put 
into the settings file, but on the other hand, it didn't say that it 
shohuld be entered at the prompt either!

Thanks again, it is much appreciated.

On Friday, October 11, 2019 at 10:39:18 PM UTC+1, Daniel Hepper wrote:
>
> The export statement does not belong in your settings file, you are 
> supposed to type it into your shell, like you do with “python manage.py 
> ...” commands
>
> Am 11.10.2019 um 15:51 schrieb fishbite 
> >:
>
> 
> Hi there,
>
> I've been working on the MDN Locallibrary project and am just preparing to 
> publish the website on Heroku.
>
> I seem to be stumbling at the first hurdle though and hope someone can 
> help.
>
> The problem is a syntax error pointing to the following line of code in my 
> settings.py file:
>
> export DJANGO_DEBUG=False
>
> the following lines precede this with no errors:
>
> *import os*
> *SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
> 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*
>
>
> *DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'*
>
>
> could someone please tell me why this is happening and how to fix it. The 
> lines have been copied and pasted from the tutorial into the file, so I'm 
> pretty sure there isn't a typo.
>
> Thanks in advance.
>
> -- 
> 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...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c44ebec4-5487-4e83-b1d7-dd7b5a587a62%40googlegroups.com.


Re: syntax error: export DJANGO_DEBUG=False

2019-10-11 Thread wd
hi,

export DJANGO_DEBUG=False
This is a shell command, you shouldn't add this to your settings.py.

On Fri, Oct 11, 2019 at 9:51 PM fishbite  wrote:

> Hi there,
>
> My first post to this group!
>
> I've built the locallibrary project following the MDN tutorial and I'm now
> preparing to deploy the site on Heroku as described in the same tutorial
> and have added these lines to my settings.py file:
>
> *import os*
> *SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
> 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*
>
>
> export DJANGO_DEBUG=False
>
> I get:
> SyntaxError: invalid syntax
>
> Has anyone else encountered this problem and / or know why it is occuring
> or how to resolve the issue?
>
> Thanks in advance for any help you can provide.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/779d99cf-2445-4dcf-9c37-e1f7d9ab7bf0%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABexzmi1SwbnXRGrYAm6OCxH3XO-%2B8mMj-pf2%3DUEjtDYpzgtcQ%40mail.gmail.com.


Re: MDN Locallibrary project - syntax error on 'export DJANGO_DEBUG=False'

2019-10-11 Thread Daniel Hepper
The export statement does not belong in your settings file, you are supposed to 
type it into your shell, like you do with “python manage.py ...” commands

> Am 11.10.2019 um 15:51 schrieb fishbite :
> 
> 
> Hi there,
> 
> I've been working on the MDN Locallibrary project and am just preparing to 
> publish the website on Heroku.
> 
> I seem to be stumbling at the first hurdle though and hope someone can help.
> 
> The problem is a syntax error pointing to the following line of code in my 
> settings.py file:
> 
> export DJANGO_DEBUG=False
> 
> the following lines precede this with no errors:
> 
> import os
> SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
> 'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')
> 
> DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'
> 
> could someone please tell me why this is happening and how to fix it. The 
> lines have been copied and pasted from the tutorial into the file, so I'm 
> pretty sure there isn't a typo.
> 
> Thanks in advance.
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B413ED09-95E4-4C72-B031-69DE9841E33D%40gmail.com.


Re: MDN Locallibrary project - syntax error on 'export DJANGO_DEBUG=False'

2019-10-11 Thread John Martin
Try retyping the lines from scratch. You may have picked up a unicode 
version of single quote, or similar substitution, through copy/pasting.


John

On 11/10/2019 14:12, fishbite wrote:

Hi there,

I've been working on the MDN Locallibrary project and am just 
preparing to publish the website on Heroku.


I seem to be stumbling at the first hurdle though and hope someone can 
help.


The problem is a syntax error pointing to the following line of code 
in my settings.py file:


|
exportDJANGO_DEBUG=False
|

the following lines precede this with no errors:

|
*importos**SECRET_KEY 
=os.environ.get('DJANGO_SECRET_KEY','cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*

|

|
*DEBUG =os.environ.get('DJANGO_DEBUG','')!='False'*
|

could someone please tell me why this is happening and how to fix it. 
The lines have been copied and pasted from the tutorial into the file, 
so I'm pretty sure there isn't a typo.


Thanks in advance.
--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59a52265-3e2f-2c3c-d587-67f2481a4660%40martinhome.org.uk.


syntax error: export DJANGO_DEBUG=False

2019-10-11 Thread fishbite
Hi there,

My first post to this group!

I've built the locallibrary project following the MDN tutorial and I'm now 
preparing to deploy the site on Heroku as described in the same tutorial 
and have added these lines to my settings.py file:

*import os*
*SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*


export DJANGO_DEBUG=False

I get:
SyntaxError: invalid syntax

Has anyone else encountered this problem and / or know why it is occuring 
or how to resolve the issue?

Thanks in advance for any help you can provide.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/779d99cf-2445-4dcf-9c37-e1f7d9ab7bf0%40googlegroups.com.


MDN Locallibrary project - syntax error on 'export DJANGO_DEBUG=False'

2019-10-11 Thread fishbite
Hi there,

I've been working on the MDN Locallibrary project and am just preparing to 
publish the website on Heroku.

I seem to be stumbling at the first hurdle though and hope someone can help.

The problem is a syntax error pointing to the following line of code in my 
settings.py file:

export DJANGO_DEBUG=False

the following lines precede this with no errors:

*import os*
*SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 
'cg#p$g+j9tax!#a3cup@1$8obt2_+&k3q+pmu)5%asj6yjpkag')*


*DEBUG = os.environ.get('DJANGO_DEBUG', '') != 'False'*


could someone please tell me why this is happening and how to fix it. The 
lines have been copied and pasted from the tutorial into the file, so I'm 
pretty sure there isn't a typo.

Thanks in advance.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d3b25700-4b4c-4c4f-b468-6f2d344e6951%40googlegroups.com.


Re: Syntax Error django, python issue

2019-07-28 Thread Kean
Hi James,

Yes this worked. Thanks.

Best,

K
On 28 Jul 2019, at 19:45, James Schneider  wrote:

> 
> On Sun, Jul 28, 2019, 10:54 AM Kean  wrote:
> Hi Chetan
> 
> pls see setup below 
> 
> It looks like you may have copied in the ellipses (...) from the example. 
> Remove those lines and try again.
> 
> -James
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWmVnVz8tckY1yf%3DU6nr2neZ_HbHK1K9pLc1NCkisCvGQ%40mail.gmail.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/B30771B5-DAFD-4E9B-BE92-1396485A0F0D%40gmail.com.


Re: Syntax Error django, python issue

2019-07-28 Thread James Schneider
On Sun, Jul 28, 2019, 10:54 AM Kean  wrote:

> Hi Chetan
>
> pls see setup below
>

It looks like you may have copied in the ellipses (...) from the example.
Remove those lines and try again.

-James

>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWmVnVz8tckY1yf%3DU6nr2neZ_HbHK1K9pLc1NCkisCvGQ%40mail.gmail.com.


Re: Syntax Error django, python issue

2019-07-28 Thread Kean
Hi Chetan

pls see setup below settings.py



This is copied from 
https://django-allauth.readthedocs.io/en/latest/installation.html

Please can clarify in this context?

Best,

K




On 28 Jul 2019, at 18:46, Chetan Ganji  wrote:

> AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',
> # your backends goes here,
> ]
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji.che...@gmail.com
> http://ryucoder.in
> 
> 
> On Sun, Jul 28, 2019 at 11:12 PM Karreerchange  wrote:
> Hi,
> 
> Installing the authentication backend code in settings.py (copy paste..)
> server crashed after save reporting the following, 
> 
>   File "/Users/ProductionEnv/Desktop/devbnt/project/bnt/bnt/settings.py", 
> line 130
> 
> 'django.contrib.auth.backends.ModelBackend',
> 
>   ^
> 
> SyntaxError: invalid syntax
> 
> 
> Please can anyone help?
> 
> Thanks,
> 
> K
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8fce3582-f491-435e-93c1-73af137fff35%40googlegroups.com.
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAMKMUjtVSrHBZ47bdpMECAhq%2B3EyKC5COtcz0xRwkjRr50TeRQ%40mail.gmail.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/877A5DF6-1FBD-4EEC-B273-6A28045BBF1B%40gmail.com.


Re: Syntax Error django, python issue

2019-07-28 Thread Chetan Ganji
AUTHENTICATION_BACKENDS

= ['django.contrib.auth.backends.ModelBackend',

# your backends goes here,

]

Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Sun, Jul 28, 2019 at 11:12 PM Karreerchange  wrote:

> Hi,
>
> Installing the authentication backend code in settings.py (copy paste..)
> server crashed after save reporting the following,
>
>   File "/Users/ProductionEnv/Desktop/devbnt/project/bnt/bnt/settings.py",
> line 130
>
> 'django.contrib.auth.backends.ModelBackend',
>
>   ^
>
> SyntaxError: invalid syntax
>
> Please can anyone help?
>
> Thanks,
>
> K
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8fce3582-f491-435e-93c1-73af137fff35%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMKMUjtVSrHBZ47bdpMECAhq%2B3EyKC5COtcz0xRwkjRr50TeRQ%40mail.gmail.com.


Syntax Error django, python issue

2019-07-28 Thread Karreerchange
Hi,

Installing the authentication backend code in settings.py (copy paste..)
server crashed after save reporting the following, 

  File "/Users/ProductionEnv/Desktop/devbnt/project/bnt/bnt/settings.py", 
line 130

'django.contrib.auth.backends.ModelBackend',

  ^

SyntaxError: invalid syntax

Please can anyone help?

Thanks,

K

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8fce3582-f491-435e-93c1-73af137fff35%40googlegroups.com.


I am trying to create a search button in an input field . I have inserted an HTML code inside ma code but I hv got a syntax error. Can anyone go through my code and help me please . I need help my fel

2019-04-11 Thread Nanjuki Saidat
 the beginning of the code

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import logging

from datetime import timedelta

from django.db import models

from crispy_forms.layout import Div

from crispy_forms.helper import FormHelper

from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder, HTML

from django import forms

from django.conf import settings

from django.urls import reverse

from django.db.models import Q

from django.utils import timezone

from .models import Message, strip_email

logger = logging.getLogger(__name__)

def validate_email(email):

timeframe = timezone.now() - timedelta(hours=24)

stripped_email = strip_email(email)

recent_message_count =
Message.objects.filter(Q(sender_email_stripped=stripped_email) |
Q(recipient_email_stripped=stripped_email), created__gte=timeframe).count()

if recent_message_count > settings.MAX_MESSAGES:

raise forms.ValidationError("We can't send emails to this address
at this time. You can try again in 24 hours.")

class MessageSendForm(forms.ModelForm):

# hp = forms.CharField(label="do not fill", required=False)

fasid = forms.CharField(label="FAS Username", required=False)

class Meta:

model = Message

fields = ['recipient_name', 'recipient_email', 'message',

  'sender_named', 'sender_approved_public',
'sender_approved_public_named']

def __init__(self, *args, **kwargs):

self.user = kwargs.pop('user')

super(MessageSendForm, self).__init__(*args, **kwargs)

self.helper = FormHelper()

self.helper.form_class = 'form-horizontal'

self.helper.label_class = 'col-md-3'

self.helper.field_class = 'col-md-8'

self.fields['recipient_name'].label = 'Name'

self.fields['recipient_email'].label = 'Email'

self.fields['recipient_email'].validators = [validate_email]

self.fields['message'].help_text = 'Writer\'s block? Check out our
message inspiration.' % reverse('messaging:inspiration')

self.fields['sender_named'].label = 'I agree to share my name and
email address with the recipient.'

self.fields['sender_approved_public'].label = "I agree to publish
this message and display it publicly in the Happiness Archive."

self.fields['sender_approved_public_named'].label = "... and I
agree to display our names publicly too."

self.fields['sender_approved_public_named'].help_text = "Note: We
only publish information if both the sender and the recipients agree."

self.helper.layout = Layout(

# Fieldset('This Happiness Packet is from...', 'sender_name',
'sender_email', 'hp'),

Fieldset("Search for a FAS Username", 'fasid' ),

#ButtonHolder(

#  Submit('submit', 'Submit', css_class='button white')



#),

I AM TRYING TO INSERT HTML CODE WITH BOOTSTRAP IN MY CRISPY FORM BUT AM
GETTING AN ERROR AND THIS IS THE SOURCE OF THE ERROR , can anyone help me
where am going wrong because am trying to add a search button in an input
field .

HTML(""

  " "

   ""

   ".00"

   ""

   ""),

THIS IS THE END OF HTML CODE I HAVE ADDED.

Fieldset("Send this Happiness Packet to...", 'recipient_name',
'recipient_email'),

Fieldset("Your message is...", 'message'),

Fieldset("Privacy and permissions", 'sender_named',
'sender_approved_public', 'sender_approved_public_named'),

HTML(""),

Submit('submit', 'Send some happiness', css_class='btn-lg
centered'),

)

def clean(self):

super(MessageSendForm, self).clean()

# if self.cleaned_data.get('hp'):

# raise forms.ValidationError('')

if self.cleaned_data.get('sender_approved_public_named') and not
self.cleaned_data.get('sender_approved_public'):

self.add_error('sender_approved_public_named', "If you want us
to publish the message including your names, "

   "you must also
check 'I agree to publish this message and"

   "display it
publicly in the Happiness Archive'")

validate_email(self.user.email)

class MessageRecipientForm(forms.ModelForm):

class Meta:

model = Message

fields = ['recipient_approved_public',
'recipient_approved_public_named']

def __init__(self, *args, **kwargs):

super(MessageRecipientForm, self).__init__(*args, **kwargs)

self.helper = FormHelper()

self.helper.form_class = 'form-horizontal'

self.helper.label_class = 'col-md-3'

self.helper.field_class = 'col-md-8'

self.fields['recipient_approved_public'].label = "I agree to
publish this message and display it publicly in the Happiness Archive."

self.fields['recipi

Re: syntax error

2018-07-25 Thread deepali pandey
The problem was I was using code in command prompt instead of windows
powershell.. now the code is working when I am using it in shell

On Wed 25 Jul, 2018, 5:09 PM akash kandpal, <
9654263057akashkand...@gmail.com> wrote:

> In the she'll try this
> python
> import django
> print (django.VERSION)
>
>
> On Wed, Jul 25, 2018, 4:54 PM Akhil Reddy 
> wrote:
>
>> So what is the solution for this pblm..
>>
>>
>> On Wed 25 Jul, 2018 7:38 am deepali pandey, 
>> wrote:
>>
>>> $ python -m django --version showing syntax error? also i am unable to
>>> create a file.. i am using python 3.7 and django is already installed in my
>>> system, version of django is 2.0.7(which is compatible with python 3.7
>>>
>>> --
>>> 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/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAPND-h7fpu%3D8c9mW27uiGBqt5yn-uKfj4GgKk0fcSB%3Dsbb2ryA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPND-h7fpu%3D8c9mW27uiGBqt5yn-uKfj4GgKk0fcSB%3Dsbb2ryA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAAp1KqXjdfQ5Tc5g_Jq7fdcYjtHgdKQ5VJKqBkfO2MNFz6pj5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syntax error

2018-07-25 Thread akash kandpal
In the she'll try this
python
import django
print (django.VERSION)


On Wed, Jul 25, 2018, 4:54 PM Akhil Reddy  wrote:

> So what is the solution for this pblm..
>
>
> On Wed 25 Jul, 2018 7:38 am deepali pandey, 
> wrote:
>
>> $ python -m django --version showing syntax error? also i am unable to
>> create a file.. i am using python 3.7 and django is already installed in my
>> system, version of django is 2.0.7(which is compatible with python 3.7
>>
>> --
>> 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/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAPND-h7fpu%3D8c9mW27uiGBqt5yn-uKfj4GgKk0fcSB%3Dsbb2ryA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syntax error

2018-07-25 Thread Akhil Reddy
So what is the solution for this pblm..


On Wed 25 Jul, 2018 7:38 am deepali pandey, 
wrote:

> $ python -m django --version showing syntax error? also i am unable to
> create a file.. i am using python 3.7 and django is already installed in my
> system, version of django is 2.0.7(which is compatible with python 3.7
>
> --
> 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/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAMeUrx_Qia08dttTnNd7ZZ9%3DRXegXVyHc9N00O6K8owhf%2BMHfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


syntax error

2018-07-24 Thread deepali pandey
$ python -m django --version showing syntax error? also i am unable to 
create a file.. i am using python 3.7 and django is already installed in my 
system, version of django is 2.0.7(which is compatible with python 3.7

-- 
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/efd25b07-1df8-49a6-adcf-ff658c480dd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax error

2018-05-30 Thread Caleb Bryson
it did thanks :). and changing the { to ( helped also for anyone view for 
future reference
. 

On Wednesday, May 30, 2018 at 8:48:53 PM UTC-4, Michael MacIntosh wrote:
>
> Hi Caleb,
>
> I think there should be a comma here 
>
> basic.html' {'content'
>
> so it should be
>
> basic.html', {'content'
> Hope that helps!
>
> On 5/30/2018 5:45 PM, Caleb Bryson wrote:
>
> I can not seem to figure out what the syntax error is in line 7 of this 
> code, can anyone help 
>
> from django.shortcuts import render
> def index(request):
> return render(request, 'hybridair/home.html')
> def contact(request):
> return render(request, 'hybridair/basic.html' {'content' : ['contact the 
> team at', 'mar...@flymat21.com ']})
> -- 
> 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/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> This message has been scanned for viruses and dangerous content by 
> *E.F.A. Project* <http://www.efa-project.org>, and is believed to be 
> clean. 
> Click here to report this message as spam. 
> <http://lsefa1.linear-systems.com/cgi-bin/learn-msg.cgi?id=F23C9100627.AB423&token=cfc190fea6a5055650a1e751b5e05171>
>  
>
>
>

-- 
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/5131b543-4ac1-49a9-8bc2-4bed615606d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax error

2018-05-30 Thread Michael MacIntosh

Hi Caleb,

I think there should be a comma here

basic.html' {'content'

so it should be

basic.html', {'content'

Hope that helps!

On 5/30/2018 5:45 PM, Caleb Bryson wrote:
I can not seem to figure out what the syntax error is in line 7 of 
this code, can anyone help


from django.shortcuts import render
def index(request):
return render(request, 'hybridair/home.html')
def contact(request):
return render(request, 'hybridair/basic.html' {'content' : ['contact 
the team at', 'mar...@flymat21.com']})

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com?utm_medium=email&utm_source=footer>.

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

--
This message has been scanned for viruses and dangerous content by
*E.F.A. Project* <http://www.efa-project.org>, and is believed to be 
clean.
Click here to report this message as spam. 
<http://lsefa1.linear-systems.com/cgi-bin/learn-msg.cgi?id=F23C9100627.AB423&token=cfc190fea6a5055650a1e751b5e05171> 



--
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/f0630b9d-7eb2-b919-5cbe-1fdb1695e551%40linear-systems.com.
For more options, visit https://groups.google.com/d/optout.


Syntax error

2018-05-30 Thread Caleb Bryson
I can not seem to figure out what the syntax error is in line 7 of this 
code, can anyone help

from django.shortcuts import render

def index(request):
return render(request, 'hybridair/home.html')

def contact(request):
return render(request, 'hybridair/basic.html' {'content' : ['contact the 
team at', 'mar...@flymat21.com']})

-- 
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/efe2686c-1e4d-477e-8057-90a81b1bef00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


template syntax error

2018-03-04 Thread harsh sharma
i created a model in which i have an image filed but when ever i am trying 
to get an uploaded image on the 
in my model.py 

image = models.ImageField(upload_to='static/pictures',)


setting.py

STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static", "./static"),
'/var/www/static/',
]


index.html file

{% load static %}
https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5882b15f-d674-44b9-ba67-74eeecd39137%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-17 Thread PASCUAL Eric
Office oriented editors tend to take initiatives for making the text prettier 
(at least, according to their "standards" 😊).


For programming tasks, you'd better use real programming editors. There are a 
lot of very good ones which are free, and even full IDEs. I'd strongly suggest 
PyCharm Community Edition in this category (I'm not endorsed by JetBrain and 
have no connection at all with them, apart from being a very happy user of 
their products).


Best


Eric

From: django-users@googlegroups.com  on behalf 
of Joe 
Sent: Thursday, February 15, 2018 4:12:54 AM
To: Django users
Subject: Re: Syntax Error when trying to migrate to Postgresql

The problem was with the quotes being weird format, had to copy and paste the 
correct quotes in for it.  Thanks for the help!!

On Wednesday, February 14, 2018 at 9:59:06 PM UTC-5, Joe wrote:
I used TextEdit on Mac to edit the files, maybe using a different editor would 
work better.

On Wednesday, February 14, 2018 at 5:41:24 PM UTC-5, larry@gmail.com wrote:
On Wed, Feb 14, 2018 at 5:32 PM, Joe  wrote:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': ‘postgres’,
> 'USER': ‘postgres’,
> 'PASSWORD': ‘*’,
> 'HOST': ‘localhost’,
> 'PORT': ‘8000’,
> }
> }

Looks like the quotes around the values are some non ascii character.
On my screen I see this:

‘

Change it to ' or "

Did you copy/paste that from Word perhaps?

--
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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto: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/872de896-e541-466b-a158-5bcc59e7914b%40googlegroups.com<https://groups.google.com/d/msgid/django-users/872de896-e541-466b-a158-5bcc59e7914b%40googlegroups.com?utm_medium=email&utm_source=footer>.
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/AM5P193MB0083482D171A3461E8EA184C8CCA0%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Joe
The problem was with the quotes being weird format, had to copy and paste 
the correct quotes in for it.  Thanks for the help!!

On Wednesday, February 14, 2018 at 9:59:06 PM UTC-5, Joe wrote:
>
> I used TextEdit on Mac to edit the files, maybe using a different editor 
> would work better.
>
> On Wednesday, February 14, 2018 at 5:41:24 PM UTC-5, larry@gmail.com 
> wrote:
>>
>> On Wed, Feb 14, 2018 at 5:32 PM, Joe  wrote: 
>> > 
>> > DATABASES = { 
>> > 'default': { 
>> > 'ENGINE': 'django.db.backends.postgresql', 
>> > 'NAME': ‘postgres’, 
>> > 'USER': ‘postgres’, 
>> > 'PASSWORD': ‘*’, 
>> > 'HOST': ‘localhost’, 
>> > 'PORT': ‘8000’, 
>> > } 
>> > } 
>>
>> Looks like the quotes around the values are some non ascii character. 
>> On my screen I see this: 
>>
>> ‘ 
>>
>> Change it to ' or " 
>>
>> Did you copy/paste that from Word perhaps? 
>>
>

-- 
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/872de896-e541-466b-a158-5bcc59e7914b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Joe
I used TextEdit on Mac to edit the files, maybe using a different editor 
would work better.

On Wednesday, February 14, 2018 at 5:41:24 PM UTC-5, larry@gmail.com 
wrote:
>
> On Wed, Feb 14, 2018 at 5:32 PM, Joe > 
> wrote: 
> > 
> > DATABASES = { 
> > 'default': { 
> > 'ENGINE': 'django.db.backends.postgresql', 
> > 'NAME': ‘postgres’, 
> > 'USER': ‘postgres’, 
> > 'PASSWORD': ‘*’, 
> > 'HOST': ‘localhost’, 
> > 'PORT': ‘8000’, 
> > } 
> > } 
>
> Looks like the quotes around the values are some non ascii character. 
> On my screen I see this: 
>
> ‘ 
>
> Change it to ' or " 
>
> Did you copy/paste that from Word perhaps? 
>

-- 
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/92f1bbad-512c-439d-bc4a-d5ae68d41d32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Larry Martell
On Wed, Feb 14, 2018 at 5:32 PM, Joe  wrote:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': ‘postgres’,
> 'USER': ‘postgres’,
> 'PASSWORD': ‘*’,
> 'HOST': ‘localhost’,
> 'PORT': ‘8000’,
> }
> }

Looks like the quotes around the values are some non ascii character.
On my screen I see this:

‘

Change it to ' or "

Did you copy/paste that from Word perhaps?

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


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Joe

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': ‘postgres’,
'USER': ‘postgres’,
'PASSWORD': ‘*’,
'HOST': ‘localhost’,
'PORT': ‘8000’,
}
}

On Wednesday, February 14, 2018 at 3:58:59 AM UTC-5, Andy wrote:
>
> Could you post a few more lines of this settings.py? Preferably the whole 
> DATABASES definition.
>
> Just in case there actually is a weird invisible character try retyping 
> 'postgresql', but more likely it looks as if you are using wrong quotation 
> marks other than ' or ". I dont even have on my keyboard whats in your 
> error message.
>
>
> Am Mittwoch, 14. Februar 2018 01:17:43 UTC+1 schrieb Joe:
>>
>> I have installed django, Postgresql, and psycopg2 and went to migrate a 
>> project to a new database I created on postgresql, This is the error 
>> message I got. 
>>
>> Traceback (most recent call last):
>>
>>   File "manage.py", line 15, in 
>>
>> execute_from_command_line(sys.argv)
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>>  
>> line 371, in execute_from_command_line
>>
>> utility.execute()
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>>  
>> line 317, in execute
>>
>> settings.INSTALLED_APPS
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>>  
>> line 56, in __getattr__
>>
>> self._setup(name)
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>>  
>> line 43, in _setup
>>
>> self._wrapped = Settings(settings_module)
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>>  
>> line 106, in __init__
>>
>> mod = importlib.import_module(self.SETTINGS_MODULE)
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/importlib/__init__.py",
>>  
>> line 126, in import_module
>>
>> return _bootstrap._gcd_import(name[level:], package, level)
>>
>>   File "", line 978, in _gcd_import
>>
>>   File "", line 961, in _find_and_load
>>
>>   File "", line 950, in 
>> _find_and_load_unlocked
>>
>>   File "", line 655, in _load_unlocked
>>
>>   File "", line 674, in exec_module
>>
>>   File "", line 781, in get_code
>>
>>   File "", line 741, in 
>> source_to_code
>>
>>   File "", line 205, in 
>> _call_with_frames_removed
>>
>>   File 
>> "/Users/JosephConrad/Desktop/Joetestsite/MySite/BudgetSite/settings.py", 
>> line 77
>>
>> ‘postgresql’: {
>>
>>^
>>
>> SyntaxError: invalid character in identifier
>>
>>
>>
>> I am able to migrate with sqllite but I can't migrate to postgresql.
>>
>

-- 
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/05c0666e-af6c-483e-9aca-a5730e210506%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Syntax Error when trying to migrate to Postgresql

2018-02-14 Thread Andy
Could you post a few more lines of this settings.py? Preferably the whole 
DATABASES definition.

Just in case there actually is a weird invisible character try retyping 
'postgresql', but more likely it looks as if you are using wrong quotation 
marks other than ' or ". I dont even have on my keyboard whats in your 
error message.


Am Mittwoch, 14. Februar 2018 01:17:43 UTC+1 schrieb Joe:
>
> I have installed django, Postgresql, and psycopg2 and went to migrate a 
> project to a new database I created on postgresql, This is the error 
> message I got. 
>
> Traceback (most recent call last):
>
>   File "manage.py", line 15, in 
>
> execute_from_command_line(sys.argv)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 371, in execute_from_command_line
>
> utility.execute()
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
>  
> line 317, in execute
>
> settings.INSTALLED_APPS
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 56, in __getattr__
>
> self._setup(name)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 43, in _setup
>
> self._wrapped = Settings(settings_module)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
>  
> line 106, in __init__
>
> mod = importlib.import_module(self.SETTINGS_MODULE)
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/importlib/__init__.py",
>  
> line 126, in import_module
>
> return _bootstrap._gcd_import(name[level:], package, level)
>
>   File "", line 978, in _gcd_import
>
>   File "", line 961, in _find_and_load
>
>   File "", line 950, in 
> _find_and_load_unlocked
>
>   File "", line 655, in _load_unlocked
>
>   File "", line 674, in exec_module
>
>   File "", line 781, in get_code
>
>   File "", line 741, in 
> source_to_code
>
>   File "", line 205, in 
> _call_with_frames_removed
>
>   File 
> "/Users/JosephConrad/Desktop/Joetestsite/MySite/BudgetSite/settings.py", 
> line 77
>
> ‘postgresql’: {
>
>^
>
> SyntaxError: invalid character in identifier
>
>
>
> I am able to migrate with sqllite but I can't migrate to postgresql.
>

-- 
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/4a39755e-c408-4f6f-93a2-bde83fbc2bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Syntax Error when trying to migrate to Postgresql

2018-02-13 Thread Joe
I have installed django, Postgresql, and psycopg2 and went to migrate a 
project to a new database I created on postgresql, This is the error 
message I got. 

Traceback (most recent call last):

  File "manage.py", line 15, in 

execute_from_command_line(sys.argv)

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 371, in execute_from_command_line

utility.execute()

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/core/management/__init__.py",
 
line 317, in execute

settings.INSTALLED_APPS

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
 
line 56, in __getattr__

self._setup(name)

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
 
line 43, in _setup

self._wrapped = Settings(settings_module)

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/site-packages/django/conf/__init__.py",
 
line 106, in __init__

mod = importlib.import_module(self.SETTINGS_MODULE)

  File 
"/Users/JosephConrad/Desktop/Joetestsite/lib/python3.6/importlib/__init__.py", 
line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

  File "", line 978, in _gcd_import

  File "", line 961, in _find_and_load

  File "", line 950, in _find_and_load_unlocked

  File "", line 655, in _load_unlocked

  File "", line 674, in exec_module

  File "", line 781, in get_code

  File "", line 741, in source_to_code

  File "", line 205, in 
_call_with_frames_removed

  File 
"/Users/JosephConrad/Desktop/Joetestsite/MySite/BudgetSite/settings.py", 
line 77

‘postgresql’: {

   ^

SyntaxError: invalid character in identifier



I am able to migrate with sqllite but I can't migrate to postgresql.

-- 
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/8f699b48-4f09-4b55-a8d1-c3dfbe5a4166%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Syntax error with TruncDay

2018-02-07 Thread Andrea
I have the following model in Django 1.11.10:

class Test(models.Model):
  ...
  date_start = models.DateTimeField()
  ...

The following works fine:

Test.objects.annotate(day_start=TruncDate(ExpressionWrapper(F('date_start')
- timedelta(hours=5), output_field=models.DateField()))

If I replace TruncDate with TruncDay or TruncMonth:

Test.objects.annotate(day_start=TruncDay(ExpressionWrapper(F('date_start')
- timedelta(hours=5), output_field=models.DateField()))

I get the following error:

ProgrammingError: syntax error at or near "%"
LINE 1: ...TE_TRUNC('day', ("test_test"."date_start" - %s)) AS "d...

Is anyone able to reproduce the problem? The goal is to shift the
`date_start` field in time before applying the `Trunc*` operation. Is that
possible?

Thanks!
Andrea

Andrea Angelini

*Zap 15*
Tailored web solutions
www.zap15.com

-- 
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/CAAPQ7Y0mAPQU5NATzzR%2BeX8jy-VBKBSjvBRdmcvYLMSYw%2BBnpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.db.utils.OperationalError: near ")": syntax error ERROR at $ python3 manage.py migrate

2016-11-14 Thread Simon Charette
Hello Peter,

That looks like https://code.djangoproject.com/ticket/24424

Simon

Le lundi 14 novembre 2016 12:06:41 UTC-5, Peter Sels a écrit :
>
> Dear Django-ers,
>
> I ran into a problem with Django.
>
> --
> Situation:
> --
>
> I am using version 1.10.3 of Django.
>
> For the fifth time I updated my table related classes in models.py.
> The 4 previous time this ran well all through
>
> (1) The server ran and did not complain about syntax errors or anything 
> else.
> and
> (2) $ python3 manage.py makemigrations
>
> but in
>
> (3) $ python3 manage.py migrate
> I get the problem mentioned below when running 
>
> The log of (2) and (3) is given below.
>
> --
> Questions:
> --
> Any tips on how to solve it?
>
> How can I relate this to my own code in models.py?
>
> Do I really need to revert back to my previously (checked in) version of 
> models.py?
> And then do small incremental steps again?
> Or is there a better way?
> (Unluckily I cannot share the models.py file.)
>
> thanks and best regards,
>
> Peter
>
> 
>
> (2)
>
> *$ python3 manage.py makemigrations*
>
> *Migrations for 'market':*
>
>   *market/migrations/0006_auto_20161114_1741.py*:
>
> - Alter field code on bidstate
>
> - Alter field code on coordinationschemevariant
>
> - Alter field code on networktype
>
> - Alter field code on segmenttype
>
> Herettix:SmartNet peter$ 
>
>
>
> (3)
>
> *Herettix:SmartNet peter$ python3 manage.py makemigrations*
>
> Did you rename the market.SegmentType model to SegmentSlope? [y/N] y
>
> Did you rename qbiddataarray.segmentType to qbiddataarray.segmentSlope (a 
> ForeignKey)? [y/N] y
>
> *Migrations for 'market':*
>
>   *market/migrations/0007_auto_20161114_1742.py*:
>
> - Rename model SegmentType to SegmentSlope
>
> - Rename field segmentType on qbiddataarray to segmentSlope
>
> Herettix:SmartNet peter$ 
>
> Herettix:SmartNet peter$ 
>
> Herettix:SmartNet peter$ python3 manage.py migrate
>
> *Operations to perform:*
>
> *  Apply all migrations: *admin, auth, contenttypes, market, sessions
>
> *Running migrations:*
>
>   Applying market.0005_auto_20161114_1254...Traceback (most recent call 
> last):
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
> 64, in execute
>
> return self.cursor.execute(sql, params)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", 
> line 337, in execute
>
> return Database.Cursor.execute(self, query, params)
>
> sqlite3.OperationalError: near ")": syntax error
>
>
> The above exception was the direct cause of the following exception:
>
>
> Traceback (most recent call last):
>
>   File "manage.py", line 22, in 
>
> execute_from_command_line(sys.argv)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
> line 367, in execute_from_command_line
>
> utility.execute()
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
> line 359, in execute
>
> self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
> line 294, in run_from_argv
>
> self.execute(*args, **cmd_options)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
> line 345, in execute
>
> output = self.handle(*args, **options)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
>  
> line 204, in handle
>
> fake_initial=fake_initial,
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 115, in migrate
>
> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
> fake_initial=fake_initial)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 145, in _migrate_all_forwards
>
> state = self.apply_migration(state, migration, fake=fake, 
> fake_initial=fake_initial)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 244, in apply_migration
>
> state = migration.apply(state, schema_editor)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/migration.py", 
> line 129, in apply
>
> operation.d

django.db.utils.OperationalError: near ")": syntax error ERROR at $ python3 manage.py migrate

2016-11-14 Thread Peter Sels
Dear Django-ers,

I ran into a problem with Django.

--
Situation:
--

I am using version 1.10.3 of Django.

For the fifth time I updated my table related classes in models.py.
The 4 previous time this ran well all through

(1) The server ran and did not complain about syntax errors or anything 
else.
and
(2) $ python3 manage.py makemigrations

but in

(3) $ python3 manage.py migrate
I get the problem mentioned below when running 

The log of (2) and (3) is given below.

--
Questions:
--
Any tips on how to solve it?

How can I relate this to my own code in models.py?

Do I really need to revert back to my previously (checked in) version of 
models.py?
And then do small incremental steps again?
Or is there a better way?
(Unluckily I cannot share the models.py file.)

thanks and best regards,

Peter



(2)

*$ python3 manage.py makemigrations*

*Migrations for 'market':*

  *market/migrations/0006_auto_20161114_1741.py*:

- Alter field code on bidstate

- Alter field code on coordinationschemevariant

- Alter field code on networktype

- Alter field code on segmenttype

Herettix:SmartNet peter$ 



(3)

*Herettix:SmartNet peter$ python3 manage.py makemigrations*

Did you rename the market.SegmentType model to SegmentSlope? [y/N] y

Did you rename qbiddataarray.segmentType to qbiddataarray.segmentSlope (a 
ForeignKey)? [y/N] y

*Migrations for 'market':*

  *market/migrations/0007_auto_20161114_1742.py*:

- Rename model SegmentType to SegmentSlope

- Rename field segmentType on qbiddataarray to segmentSlope

Herettix:SmartNet peter$ 

Herettix:SmartNet peter$ 

Herettix:SmartNet peter$ python3 manage.py migrate

*Operations to perform:*

*  Apply all migrations: *admin, auth, contenttypes, market, sessions

*Running migrations:*

  Applying market.0005_auto_20161114_1254...Traceback (most recent call 
last):

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
64, in execute

return self.cursor.execute(sql, params)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", 
line 337, in execute

return Database.Cursor.execute(self, query, params)

sqlite3.OperationalError: near ")": syntax error


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "manage.py", line 22, in 

execute_from_command_line(sys.argv)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
line 367, in execute_from_command_line

utility.execute()

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
line 359, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
line 294, in run_from_argv

self.execute(*args, **cmd_options)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
line 345, in execute

output = self.handle(*args, **options)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
 
line 204, in handle

fake_initial=fake_initial,

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 115, in migrate

state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
fake_initial=fake_initial)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 145, in _migrate_all_forwards

state = self.apply_migration(state, migration, fake=fake, 
fake_initial=fake_initial)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 244, in apply_migration

state = migration.apply(state, schema_editor)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/migration.py", 
line 129, in apply

operation.database_forwards(self.app_label, schema_editor, old_state, 
project_state)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/operations/fields.py",
 
line 147, in database_forwards

schema_editor.remove_field(from_model, 
from_model._meta.get_field(self.name))

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py", 
line 249, in remove_field

self._remake_table(model, delete_fields=[field])

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py", 
line 199, in _remake_table

self.quote_name(model._meta.db_table),

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/base/schema.py", 
line 112, in execute

cursor.execute(sql, params)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
79, in execute

return super(CursorDebugWrapper, self).execute(sql, 

Re: develeopment servers stops at syntax error.

2014-09-17 Thread Collin Anderson
I think it's because of the new check framework. The check framework runs 
and validates more of the website and looks for errors long before the the 
"runserver" management command has a chance to start the reloading process.

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53dc16d4-2d7c-48d4-9f6a-1c73e5ff9e82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: develeopment servers stops at syntax error.

2014-09-13 Thread Yunus Koçyiğit
in django 1.6 on syntax error server also stops. but not fully. when i fix 
the issue and save server restarts without i need to write "runserver" 
command. 

On Saturday, September 13, 2014 12:59:37 PM UTC+3, Andréas Kühne wrote:
>
> That's strange. A syntax error in my django 1.6 also stops the server, 
> without restarting it. I think that's the way it should be, because the 
> server cannot continue processing invalid python files.
>
> Regards,
>
> Andréas
>
> 2014-09-13 10:19 GMT+02:00 Yunus Koçyiğit  >:
>
>>
>> on django 1.7 if i made a syntax error on purpose like"  a = [ 
>> 'blablabla'   "  development server stops immediately with this error :
>>
>> System check identified no issues (0 silenced).
>>
>> September 13, 2014 - 08:18:01
>>
>> Django version 1.7, using settings 'learning_site.settings'
>>
>> Starting development server at http://127.0.0.1:8000/
>>
>> Quit the server with CONTROL-C.
>>
>> Traceback (most recent call last):
>>
>>   File "manage.py", line 10, in 
>>
>> execute_from_command_line(sys.argv)
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 385, in execute_from_command_line
>>
>> utility.execute()
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 354, in execute
>>
>> django.setup()
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/__init__.py",
>>  
>> line 21, in setup
>>
>> apps.populate(settings.INSTALLED_APPS)
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/registry.py",
>>  
>> line 108, in populate
>>
>> app_config.import_models(all_models)
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/config.py",
>>  
>> line 197, in import_models
>>
>> self.models_module = import_module(models_module_name)
>>
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
>>  
>> line 37, in import_module
>>
>> __import__(name)
>>
>>   File 
>> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/learning_site/polls/models.py",
>>  
>> line 38
>>
>> votes = models.IntegerField(default=0)
>>
>> ^
>>
>> SyntaxError: invalid syntax
>>
>>
>>
>> but if i made same with django 1.6   server stops but if i save again 
>> with true syntax server restarts. i think it's a bug there.
>>
>>
>>
>>
>>
>>
>>  -- 
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c972646b-2479-465b-a65c-f3926fe43d5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: develeopment servers stops at syntax error.

2014-09-13 Thread Andreas Kuhne
That's strange. A syntax error in my django 1.6 also stops the server,
without restarting it. I think that's the way it should be, because the
server cannot continue processing invalid python files.

Regards,

Andréas

2014-09-13 10:19 GMT+02:00 Yunus Koçyiğit :

>
> on django 1.7 if i made a syntax error on purpose like"  a = [
> 'blablabla'   "  development server stops immediately with this error :
>
> System check identified no issues (0 silenced).
>
> September 13, 2014 - 08:18:01
>
> Django version 1.7, using settings 'learning_site.settings'
>
> Starting development server at http://127.0.0.1:8000/
>
> Quit the server with CONTROL-C.
>
> Traceback (most recent call last):
>
>   File "manage.py", line 10, in 
>
> execute_from_command_line(sys.argv)
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 385, in execute_from_command_line
>
> utility.execute()
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 354, in execute
>
> django.setup()
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/__init__.py",
> line 21, in setup
>
> apps.populate(settings.INSTALLED_APPS)
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/registry.py",
> line 108, in populate
>
> app_config.import_models(all_models)
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/config.py",
> line 197, in import_models
>
> self.models_module = import_module(models_module_name)
>
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
> line 37, in import_module
>
> __import__(name)
>
>   File
> "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/learning_site/polls/models.py",
> line 38
>
> votes = models.IntegerField(default=0)
>
> ^
>
> SyntaxError: invalid syntax
>
>
>
> but if i made same with django 1.6   server stops but if i save again with
> true syntax server restarts. i think it's a bug there.
>
>
>
>
>
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUb%3DnzZxof-oNmb%2BVikFT6GsEX1UPsCUXGgPwwK%2BYQy02tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: develeopment servers stops at syntax error.

2014-09-13 Thread Yunus Koçyiğit

on django 1.7 if i made a syntax error on purpose like"  a = [ 
'blablabla'   "  development server stops immediately with this error :

System check identified no issues (0 silenced).

September 13, 2014 - 08:18:01

Django version 1.7, using settings 'learning_site.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CONTROL-C.

Traceback (most recent call last):

  File "manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 385, in execute_from_command_line

utility.execute()

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 354, in execute

django.setup()

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/__init__.py",
 
line 21, in setup

apps.populate(settings.INSTALLED_APPS)

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/registry.py",
 
line 108, in populate

app_config.import_models(all_models)

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/config.py",
 
line 197, in import_models

self.models_module = import_module(models_module_name)

  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
 
line 37, in import_module

__import__(name)

  File 
"/Users/kocyigityunus/Desktop/virtual_envs/ENV1/learning_site/polls/models.py", 
line 38

votes = models.IntegerField(default=0)

^

SyntaxError: invalid syntax



but if i made same with django 1.6   server stops but if i save again with 
true syntax server restarts. i think it's a bug there.






-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


develeopment servers stops at syntax error.

2014-09-12 Thread Lee
Providing the actual error and traceback would be the only way we can really 
help you. Could you paste that here?

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/47a70eff-f2f2-4396-b34f-618ce00cdd6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


develeopment servers stops at syntax error.

2014-09-12 Thread Yunus Koçyiğit
when i change source code of a model at django 1.7 with python 2.7. development 
server stops immediately when a syntax error occurs. am i need option with 
runserver ? also in my settings.py debug= true

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cd86371f-7869-4f4d-9061-fd0dfcf0f340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.7a1 - Migration syntax error

2014-02-04 Thread Pradip Caulagi

On Wednesday 05 February 2014 04:49 AM, Russell Keith-Magee wrote:



This is the 0001_initial migration - did you manually write or update
this migration, or is this code entirely automatically generated? If
it's manually written or edited, then fix what you wrote :-) If it's the
result of automated output, then it appears you've found a bug. I'm
guessing it's a problem with the serialisation of datetimes as defaults.
If you can open a ticket describing the model that caused the problem,
that would be very helpful.


Hi Russ,

the file was generated by makemigrations.  I have raised a ticket here - 
https://code.djangoproject.com/ticket/21954


Thanks,
--
Pradip P Caulagi

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52F1D61E.5030900%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: 1.7a1 - Migration syntax error

2014-02-04 Thread Russell Keith-Magee
Hi Pradip,

On Tue, Feb 4, 2014 at 5:18 PM, Pradip Caulagi  wrote:

> I am using the following (simplified) model that doesn't migrate using the
> new migrations in Django 1.7a1 -
>
> ...
>

  File "/tmp/bar/blog/migrations/0001_initial.py", line 17
> ('created', models.DateTimeField(default=datetime.datetime(2014, 2,
> 4, 9, 15, 59, 685251, tzinfo=))),
>
>   ^
> SyntaxError: invalid syntax
> $
> $
>
> What am I missing?  I know that we can have use auto_now for the
> DateTimeField but I want the value to be shown populated with current
> datetime that can be overridden by the user, if they want.
>

A Django migration file is just a Python file. The error you're seeing is a
Python error - the code you've entered, at line 17, at the point where the
caret is pointing, isn't valid syntax.

Specifically - "tzinfo=" isn't legal Python.

This is the 0001_initial migration - did you manually write or update this
migration, or is this code entirely automatically generated? If it's
manually written or edited, then fix what you wrote :-) If it's the result
of automated output, then it appears you've found a bug. I'm guessing it's
a problem with the serialisation of datetimes as defaults. If you can open
a ticket describing the model that caused the problem, that would be very
helpful.

Yours,
Russ Magee %-)

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq849oRZqFUnbr48fTLOO_CfOZn3vXGj23%2B66E0TWuu1KZ9g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


1.7a1 - Migration syntax error

2014-02-04 Thread Pradip Caulagi
I am using the following (simplified) model that doesn't migrate using 
the new migrations in Django 1.7a1 -


$
$ pip freeze
Django==1.7a1
argparse==1.2.1
distribute==0.6.34
wsgiref==0.1.2
$
$ cat blog/models.py
from django.db import models
from django.utils import timezone

class Blog(models.Model):

title = models.CharField(max_length=200)
created = models.DateTimeField(default=timezone.now())

def __unicode__(self):
return self.title

$
$ python manage.py makemigrations
Migrations for 'blog':
  0001_initial.py:
- Create model Blog
$
$ python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/core/management/__init__.py", 
line 427, in execute_from_command_line

utility.execute()
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/core/management/__init__.py", 
line 419, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/core/management/base.py", 
line 288, in run_from_argv

self.execute(*args, **options.__dict__)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/core/management/base.py", 
line 337, in execute

output = self.handle(*args, **options)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/core/management/commands/migrate.py", 
line 62, in handle
executor = MigrationExecutor(connection, 
self.migration_progress_callback)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/db/migrations/executor.py", 
line 14, in __init__

self.loader = MigrationLoader(self.connection)
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/db/migrations/loader.py", 
line 48, in __init__

self.build_graph()
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/db/migrations/loader.py", 
line 145, in build_graph

self.load_disk()
  File 
"/home/pcaulagi/projects/test/local/lib/python2.7/site-packages/Django-1.7a1-py2.7.egg/django/db/migrations/loader.py", 
line 103, in load_disk
migration_module = import_module("%s.%s" % (module_name, 
migration_name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
import_module

__import__(name)
  File "/tmp/bar/blog/migrations/0001_initial.py", line 17
('created', models.DateTimeField(default=datetime.datetime(2014, 2, 
4, 9, 15, 59, 685251, tzinfo=))),


  ^
SyntaxError: invalid syntax
$
$

What am I missing?  I know that we can have use auto_now for the 
DateTimeField but I want the value to be shown populated with current 
datetime that can be overridden by the user, if they want.


Thanks,
Pradip

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52F0B07A.7020203%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Template Syntax Error

2013-09-25 Thread SHANTANU SRIVASTAVA
Thanks ! The urls.py can be viewed here : http://dpaste.com/hold/1394929/

On Tuesday, September 24, 2013 1:10:57 AM UTC+5:30, Alagappan Ramu wrote:
>
> Looks like the is an issue in Django being able to resolve URLs in your 
> application. Can you paste your urls.py for more info. 
>
>
> Regards,
> Alagappan R
>
> Twitter: @_alagappan 
>
> Thanks & Regards,
> Alagappan Ramu
> +1 (716) 598 2730
>
> Graduate Student in Computer Science
> University at Buffalo, The State University of New 
> York.
>
>
>
> On Mon, Sep 23, 2013 at 7:12 AM, SHANTANU SRIVASTAVA <
> shan...@rediffmail.com > wrote:
>
>>  
>> Hi People ! Just started development with Django and am stuck with this 
>> error. When I run my admin panel from the server (default server of django) 
>> the browser shows this error "TemplateSyntaxError
>> " - Caught RuntimeError while rendering: maximum recursion depth exceeded 
>> while calling a Python object. Help me in resolving this ! Any help 
>> appreciated .
>>
>> I am developing on a 64bit x86 machine. OS-Windows - 7. 
>>
>> The tracebacks and detailed report is here : 
>> http://dpaste.com/1392716/plain/
>>
>> It is also attached as an attachment with this mail.
>>
>> -- 
>> 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 http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Template Syntax Error

2013-09-23 Thread Alagappan
Looks like the is an issue in Django being able to resolve URLs in your
application. Can you paste your urls.py for more info.


Regards,
Alagappan R

Twitter: @_alagappan 

Thanks & Regards,
Alagappan Ramu
+1 (716) 598 2730

Graduate Student in Computer Science
University at Buffalo, The State University of New
York.



On Mon, Sep 23, 2013 at 7:12 AM, SHANTANU SRIVASTAVA <
shan_m...@rediffmail.com> wrote:

>
> Hi People ! Just started development with Django and am stuck with this
> error. When I run my admin panel from the server (default server of django)
> the browser shows this error "TemplateSyntaxError
> " - Caught RuntimeError while rendering: maximum recursion depth exceeded
> while calling a Python object. Help me in resolving this ! Any help
> appreciated .
>
> I am developing on a 64bit x86 machine. OS-Windows - 7.
>
> The tracebacks and detailed report is here :
> http://dpaste.com/1392716/plain/
>
> It is also attached as an attachment with this mail.
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: where the syntax error?

2013-01-14 Thread donarb


On Monday, January 14, 2013 12:39:08 PM UTC-8, Érico Oliveira wrote:
>
> class Imovel(models.Model): 
> disponivel = models.BooleanField(choices=DISPO) 
> data_venda =  models.DateTimeField(auto_now_add=True, blank=True) 
>
> def validaData(self): 
> if self.data_venda < datetime.now - timedelta(days=2) <- 
>


The syntax error refers to the missing colon at the end of the condition.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/MIvxYM9aKxYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: where the syntax error?

2013-01-14 Thread John
On 14/01/13 20:39, Érico Oliveira wrote:
> class Imovel(models.Model):
> disponivel = models.BooleanField(choices=DISPO)
> data_venda =  models.DateTimeField(auto_now_add=True, blank=True)
>
> def validaData(self):
> if self.data_venda < datetime.now - timedelta(days=2) <-
>
Python 2.7.2+ (default, Jul 20 2012, 22:15:08)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.now

>>> datetime.datetime.now()
datetime.datetime(2013, 1, 14, 21, 11, 3, 186215)
>>> datetime.datetime.now() - datetime.timedelta(days=2)
datetime.datetime(2013, 1, 12, 21, 12, 34, 832335)

Does that help?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



where the syntax error?

2013-01-14 Thread Érico Oliveira
class Imovel(models.Model):
disponivel = models.BooleanField(choices=DISPO)
data_venda =  models.DateTimeField(auto_now_add=True, blank=True)

def validaData(self):
if self.data_venda < datetime.now - timedelta(days=2) <-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread donarb
Correction, the syntax has changed between 1.4 and 1.5. You are now 
required to quote the name in the url tag.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ijeFeRNw0aMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread donarb
Except, the Django documentation states that url names with dashes are 
acceptable and the examples show url tags using unquoted names. It even 
says you can use any character you want:

*The string used for the URL name can contain any characters you like. You 
are not restricted to valid Python names.*

https://docs.djangoproject.com/en/1.4/topics/http/urls/#id2

On Monday, December 3, 2012 4:54:19 AM UTC-8, Loai Ghoraba wrote:
>
> okay I found it:
>
> it should be  login 
> with quotes. Thanks.
>
> On Mon, Dec 3, 2012 at 2:50 PM, Loai Ghoraba 
> > wrote:
>
>> not working, giving: Reverse for '' with arguments '()' and keyword 
>> arguments '{}' not found.
>>
>> also I want to know about this dash (sorry for using the term score in 
>> the previous post ) thing
>>
>> On Mon, Dec 3, 2012 at 2:34 PM, Nikhil Verma 
>> 
>> > wrote:
>>
>>> {% url auth_login %}
>>
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/2FM_hakKP1QJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Larry Martell
On Mon, Dec 3, 2012 at 7:31 AM, Loai Ghoraba  wrote:
> Hi
>
> I have this in my urls.py
>
> url(r'^accounts/login/$', login,name="accounts-login")
>
> and in a template base.html
>  login
>
> And when I try to open the site, this error is raised: Template syntax
> error: Could not parse the remainder: '-login' from 'accounts-login'
>
> But when I change the name of the url in both urls.py and base.html to
> something without the score '-', it works: like :accountslogin.
>
> So are scores banned in named urls ? I have seen scored-named-urls in the
> documentation !

Hyphens are valid in urls, but not in python. A hyphen is an operator
in python (subtraction operator), so you cannot use it in django.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
okay I found it:

it should be  login
with quotes. Thanks.

On Mon, Dec 3, 2012 at 2:50 PM, Loai Ghoraba  wrote:

> not working, giving: Reverse for '' with arguments '()' and keyword
> arguments '{}' not found.
>
> also I want to know about this dash (sorry for using the term score in the
> previous post ) thing
>
> On Mon, Dec 3, 2012 at 2:34 PM, Nikhil Verma wrote:
>
>> {% url auth_login %}
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
not working, giving: Reverse for '' with arguments '()' and keyword
arguments '{}' not found.

also I want to know about this dash (sorry for using the term score in the
previous post ) thing

On Mon, Dec 3, 2012 at 2:34 PM, Nikhil Verma wrote:

> {% url auth_login %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Nikhil Verma
Try Sign in

On Mon, Dec 3, 2012 at 6:01 PM, Loai Ghoraba  wrote:

> Hi
>
> I have this in my urls.py
>
> url(r'^accounts/login/$', login,name="accounts-login")
>
> and in a template base.html
>  login
>
> And when I try to open the site, this error is raised: Template syntax
> error: Could not parse the remainder: '-login' from 'accounts-login'
>
> But when I change the name of the url in both urls.py and base.html to
> something without the score '-', it works: like :accountslogin.
>
> So are scores banned in named urls ? I have seen scored-named-urls in the
> documentation !
>
> Thanks in advance.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/g19mRQ4vHd4J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards
Nikhil Verma
+91-958-273-3156

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
Hi

I have this in my urls.py

url(r'^accounts/login/$', login,name="accounts-login")

and in a template base.html
 login

And when I try to open the site, this error is raised: Template syntax 
error: Could not parse the remainder: '-login' from 'accounts-login'

But when I change the name of the url in both urls.py and base.html to 
something without the score '-', it works: like :accountslogin.

So are scores banned in named urls ? I have seen scored-named-urls in the 
documentation !

Thanks in advance.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/g19mRQ4vHd4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: cannot locate syntax error in urls.py

2012-04-23 Thread r0pewalker
My bad. Thanks for the quick hint, turns out I was not looking the
right way..

On 23 Apr, 16:42, Daniel Roseman  wrote:
> On Monday, 23 April 2012 15:03:35 UTC+1, r0pewalker wrote:
>
> > Hi everybody. I recently started working on a project involving heavy
> > Django usage.
> > I basically retrieve data in xml  from a SOAP web service using suds,
> > parse the xml into a db and then (I should) popuate a web page.
> > I'm a beginner both in Python and Django, please bear with me and my
> > possibly ill-formed questions!
> > I've formed a reduced set of correct views and templates for the
> > purpose of testing but i cannot step through this:
>
> > 
>
> > Exception Type: SyntaxError at /comunali/
> > Exception Value: invalid syntax (urls.py, line 23)
>
> > which I confirmed by trying to import urls py fin the shell.
> > I'm quite puzzled by the fact that line 23 in my file is not a line of
> > code, since urls.py has only 22 lines. I looked through it in search
> > of tab/whitespace misuse or punctuation errors (that I often get when
> > first running any script I made).
> > Here is urls.py:
>
> > from django.conf.urls.defaults import *
>
> > urlpatterns = patterns('',
> >         #Example:
> >         url('^$','comunali.views.index', name='comunali_index'),
> >         url(r'^provincia/(?P[^/]+)/','comunali.views.provincia',
> > name = 'comunali_provincia'),
> >         url(r'^comune/(?P[^/]+)/', 'comunali.views.comune', name
> > = 'comunali_comune'),
> >         url(r'^ballottaggio/(?P[^/]+)/',
> > 'comunali.views.ballottaggio', name = 'comunali_ballottaggio'),
> >         url(r'^province/(?P[^/]
> > +)/','comunali.views.province', name = 'comunali_province'),
> >         url(r'^province/$','comunali.views.province', name =
> > 'comunali_province'),
> >         url(r'^comuni/(?P[^/]+)/', 'comunali.views.comuni',
> > name = 'comunali_regioni'),
> >         url(r'^comuni/$', 'comunali.views.comuni', name =
> > 'comunali_regioni'),
> >         url(r'^search/(?P[^/]+)/',
> > 'comunali.views.search_comuni', name = 'comunali_search_comuni'),
> >         url(r'^(?P[^/]+)/comune/(?P[^/]+)/',
> > 'comunali.views.comune', name = 'comunali_comune'),
> >         url(r'^incluso/', 'comunali.views.inc', name =
> > 'comunali_incluso'),
>
> >         #Uncomment the admin/doc line below and add
> > 'django.contrib.admindocs'
> >         #to INSTALLED_APPS to enable admin documentation:
> >         (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> >         #Uncomment the next line to enable the admin:
> >         (r'^admin/', include(admin.site.urls)),
>
> > any suggestions are welcome.
>
> Indeed, you're missing a line 23, which would close the parentheses opened
> in the first line.
> --
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: cannot locate syntax error in urls.py

2012-04-23 Thread Daniel Roseman
On Monday, 23 April 2012 15:03:35 UTC+1, r0pewalker wrote:
>
> Hi everybody. I recently started working on a project involving heavy 
> Django usage. 
> I basically retrieve data in xml  from a SOAP web service using suds, 
> parse the xml into a db and then (I should) popuate a web page. 
> I'm a beginner both in Python and Django, please bear with me and my 
> possibly ill-formed questions! 
> I've formed a reduced set of correct views and templates for the 
> purpose of testing but i cannot step through this: 
>
> 
>
 

> Exception Type: SyntaxError at /comunali/ 
> Exception Value: invalid syntax (urls.py, line 23) 
>
>
> which I confirmed by trying to import urls py fin the shell. 
> I'm quite puzzled by the fact that line 23 in my file is not a line of 
> code, since urls.py has only 22 lines. I looked through it in search 
> of tab/whitespace misuse or punctuation errors (that I often get when 
> first running any script I made). 
> Here is urls.py: 
>
> from django.conf.urls.defaults import * 
>
> urlpatterns = patterns('', 
> #Example: 
> url('^$','comunali.views.index', name='comunali_index'), 
> url(r'^provincia/(?P[^/]+)/','comunali.views.provincia', 
> name = 'comunali_provincia'), 
> url(r'^comune/(?P[^/]+)/', 'comunali.views.comune', name 
> = 'comunali_comune'), 
> url(r'^ballottaggio/(?P[^/]+)/', 
> 'comunali.views.ballottaggio', name = 'comunali_ballottaggio'), 
> url(r'^province/(?P[^/] 
> +)/','comunali.views.province', name = 'comunali_province'), 
> url(r'^province/$','comunali.views.province', name = 
> 'comunali_province'), 
> url(r'^comuni/(?P[^/]+)/', 'comunali.views.comuni', 
> name = 'comunali_regioni'), 
> url(r'^comuni/$', 'comunali.views.comuni', name = 
> 'comunali_regioni'), 
> url(r'^search/(?P[^/]+)/', 
> 'comunali.views.search_comuni', name = 'comunali_search_comuni'), 
> url(r'^(?P[^/]+)/comune/(?P[^/]+)/', 
> 'comunali.views.comune', name = 'comunali_comune'), 
> url(r'^incluso/', 'comunali.views.inc', name = 
> 'comunali_incluso'), 
>
> #Uncomment the admin/doc line below and add 
> 'django.contrib.admindocs' 
> #to INSTALLED_APPS to enable admin documentation: 
> (r'^admin/doc/', include('django.contrib.admindocs.urls')), 
>
> #Uncomment the next line to enable the admin: 
> (r'^admin/', include(admin.site.urls)), 
>
> any suggestions are welcome. 
>
>
Indeed, you're missing a line 23, which would close the parentheses opened 
in the first line.
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/zfNEhB7f3lQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



cannot locate syntax error in urls.py

2012-04-23 Thread r0pewalker
Hi everybody. I recently started working on a project involving heavy
Django usage.
I basically retrieve data in xml  from a SOAP web service using suds,
parse the xml into a db and then (I should) popuate a web page.
I'm a beginner both in Python and Django, please bear with me and my
possibly ill-formed questions!
I've formed a reduced set of correct views and templates for the
purpose of testing but i cannot step through this:


Environment:

Request Method: GET
Request URL: http://www.quotidiano.net/elezioni_2012/comunali/
Django Version: 1.1.1
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'comunali',
 'client_soap']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
  82. callback, callback_args, callback_kwargs =
resolver.resolve(
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
resolve
  218. sub_match = pattern.resolve(new_path)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
resolve
  216. for pattern in self.url_patterns:
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
_get_url_patterns
  245. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
_get_urlconf_module
  240. self._urlconf_module =
import_module(self.urlconf_name)
File "/usr/lib/python2.4/site-packages/django/utils/importlib.py" in
import_module
  35. __import__(name)

Exception Type: SyntaxError at /comunali/
Exception Value: invalid syntax (urls.py, line 23)


which I confirmed by trying to import urls py fin the shell.
I'm quite puzzled by the fact that line 23 in my file is not a line of
code, since urls.py has only 22 lines. I looked through it in search
of tab/whitespace misuse or punctuation errors (that I often get when
first running any script I made).
Here is urls.py:

from django.conf.urls.defaults import *

urlpatterns = patterns('',
#Example:
url('^$','comunali.views.index', name='comunali_index'),
url(r'^provincia/(?P[^/]+)/','comunali.views.provincia',
name = 'comunali_provincia'),
url(r'^comune/(?P[^/]+)/', 'comunali.views.comune', name
= 'comunali_comune'),
url(r'^ballottaggio/(?P[^/]+)/',
'comunali.views.ballottaggio', name = 'comunali_ballottaggio'),
url(r'^province/(?P[^/]
+)/','comunali.views.province', name = 'comunali_province'),
url(r'^province/$','comunali.views.province', name =
'comunali_province'),
url(r'^comuni/(?P[^/]+)/', 'comunali.views.comuni',
name = 'comunali_regioni'),
url(r'^comuni/$', 'comunali.views.comuni', name =
'comunali_regioni'),
url(r'^search/(?P[^/]+)/',
'comunali.views.search_comuni', name = 'comunali_search_comuni'),
url(r'^(?P[^/]+)/comune/(?P[^/]+)/',
'comunali.views.comune', name = 'comunali_comune'),
url(r'^incluso/', 'comunali.views.inc', name =
'comunali_incluso'),

#Uncomment the admin/doc line below and add
'django.contrib.admindocs'
#to INSTALLED_APPS to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),

#Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),

any suggestions are welcome.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syntax Error at requested method GET !!!

2011-06-13 Thread Gagan (GPS)
Yes... Thank You...

On Jun 10, 6:22 pm, Tom Evans  wrote:
> On Fri, Jun 10, 2011 at 7:27 AM, Gagan (GPS)  wrote:
> > I have experienced this error on my Ubuntu 11.04. I am unable to even
> > view the / page on this site. Kindly help. I was trying to learn
> > Django by following the video regarding creating a wiki on
> > showmedo.com . The link to the video is:
> >http://showmedo.com/videotutorials/video?name=110&fromSeriesID=110
>
> > Kindly Help.
>
> > Following is the Traceback for reference.
>
> > Environment:
> >  18.   (r'^wikicamp/(?[^/]+)/save/$',
> >  245.         raise error, v # invalid expression
>
> This re is invalid, specifically "(?[^/]+)". I presume you
> meant "(?P[^/]+)".
>
> Cheers
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syntax Error at requested method GET !!!

2011-06-10 Thread Tom Evans
On Fri, Jun 10, 2011 at 7:27 AM, Gagan (GPS)  wrote:
> I have experienced this error on my Ubuntu 11.04. I am unable to even
> view the / page on this site. Kindly help. I was trying to learn
> Django by following the video regarding creating a wiki on
> showmedo.com . The link to the video is:
> http://showmedo.com/videotutorials/video?name=110&fromSeriesID=110
>
> Kindly Help.
>
> Following is the Traceback for reference.
>
> Environment:
>  18.   (r'^wikicamp/(?[^/]+)/save/$',
>  245.         raise error, v # invalid expression

This re is invalid, specifically "(?[^/]+)". I presume you
meant "(?P[^/]+)".

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Syntax Error at requested method GET !!!

2011-06-10 Thread Gagan (GPS)
I have experienced this error on my Ubuntu 11.04. I am unable to even
view the / page on this site. Kindly help. I was trying to learn
Django by following the video regarding creating a wiki on
showmedo.com . The link to the video is:
http://showmedo.com/videotutorials/video?name=110&fromSeriesID=110

Kindly Help.

Following is the Traceback for reference.

Environment:

Request Method: GET
Request URL: http://192.168.2.127:8000/
Django Version: 1.2.5
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'wikicamp.wiki']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/pymodules/python2.7/django/core/handlers/base.py" in
get_response
  91. request.path_info)
File "/usr/lib/pymodules/python2.7/django/core/urlresolvers.py" in
resolve
  215. for pattern in self.url_patterns:
File "/usr/lib/pymodules/python2.7/django/core/urlresolvers.py" in
_get_url_patterns
  244. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "/usr/lib/pymodules/python2.7/django/core/urlresolvers.py" in
_get_urlconf_module
  239. self._urlconf_module =
import_module(self.urlconf_name)
File "/usr/lib/pymodules/python2.7/django/utils/importlib.py" in
import_module
  35. __import__(name)
File "/home/demonstrator/django_projects/wikicamp/../wikicamp/urls.py"
in 
  18.   (r'^wikicamp/(?[^/]+)/save/$',
'wikicamp.wiki.views.save_page'),
File "/usr/lib/pymodules/python2.7/django/conf/urls/defaults.py" in
patterns
  24. t = url(prefix=prefix, *t)
File "/usr/lib/pymodules/python2.7/django/conf/urls/defaults.py" in
url
  34. return RegexURLResolver(regex, urlconf_module, kwargs,
app_name=app_name, namespace=namespace)
File "/usr/lib/pymodules/python2.7/django/core/urlresolvers.py" in
__init__
  143. self.regex = re.compile(regex, re.UNICODE)
File "/usr/lib/python2.7/re.py" in compile
  190. return _compile(pattern, flags)
File "/usr/lib/python2.7/re.py" in _compile
  245. raise error, v # invalid expression

Exception Type: error at /
Exception Value: syntax error

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syntax Error

2011-01-04 Thread hank23
OK. There were some problems with my django installation, due to the
OS upgrade on my machine, and things which were missing in at least
one environment variable. Since correcting these problems the basic
functionality of my tutorial site appears to be working again. Now I
appear to have at least one problem in my views.py file. Thanks for
the suggestion. It did helpme find the problem(s).

hank23

On Jan 4, 11:16 am, cewing  wrote:
> Is it possible that the problem is not in this urls.py, but rather in
> 'polls.urls'?
>
> I'd check line 20 there, just to see if there's an obvious python
> syntax error.
>
> HTH
>
> c
>
> On Jan 4, 8:08 am, hank23  wrote:
>
>
>
> > After removing the commented code, saving urls.py, restarting the
> > server and then requesting the sites admin page now I get the admin
> > login screen. But after I type in my username and pw then it again
> > gives me the following screen:
>
> > TemplateSyntaxError at /admin/
> > Caught SyntaxError while rendering: invalid syntax (urls.py, line
> > 20)Request Method: GET
> > Request URL:http://127.0.0.1:8000/admin/
> > Django Version: 1.2.3
> > Exception Type: TemplateSyntaxError
> > Exception Value: Caught SyntaxError while rendering: invalid syntax
> > (urls.py, line 20)
> > Exception Location: C:\Python27\lib\site-packages\django\utils
> > \importlib.py in import_module, line 35
> > Python Executable: C:\Python27\python.exe
> > Python Version: 2.7.1
> > Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> > \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> > 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> > \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> > Server time: Tue, 4 Jan 2011 09:45:54 -0600
>
> > and still references the same line in urls.py, which is confusing
> > because now it shouldn't have a line 20. Here's what urls.py currently
> > looks like:
>
> > from django.conf.urls.defaults import *
>
> > # Uncomment the next two lines to enable the admin:
> > from django.contrib import admin
> > admin.autodiscover()
>
> > urlpatterns = patterns('',
> >     (r'^polls/', include('polls.urls')),
> >     (r'^admin/', include(admin.site.urls)),
> > )
>
> > Could this problem be related to windows 7 environment variables not
> > being set properly? I ask because I was upgraded recently from Win XP
> > to Windows 7 and have been working to set up my environment variables
> > back to where they should be. I thought I had previously fixed all of
> > them, but maybe I missed something. Please advise. Thanks.
>
> > On Jan 4, 9:36 am, Piotr Zalewa  wrote:
>
> > > what happens if you'remove the commented lines?
>
> > > On 01/04/11 15:22, hank23 wrote:
>
> > > > Can someone explain to me what the following error is trying to tell
> > > > me:
>
> > > > SyntaxError at /polls/1
> > > > invalid syntax (urls.py, line 20)Request Method: GET
> > > > Request URL:http://127.0.0.1:8000/polls/1
> > > > Django Version: 1.2.3
> > > > Exception Type: SyntaxError
> > > > Exception Value: invalid syntax (urls.py, line 20)
> > > > Exception Location: C:\Python27\lib\site-packages\django\utils
> > > > \importlib.py in import_module, line 35
> > > > Python Executable: C:\Python27\python.exe
> > > > Python Version: 2.7.1
> > > > Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> > > > \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> > > > 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> > > > \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> > > > Server time: Tue, 4 Jan 2011 09:12:32 -0600
>
> > > > The urls.py module that it is referring to looks like this:
>
> > > > from django.conf.urls.defaults import *
>
> > > > # Uncomment the next two lines to enable the admin:
> > > > from django.contrib import admin
> > > > admin.autodiscover()
>
> > > > #urlpatterns = patterns('',
> > > >     # Example:
> > > >     # (r'^mysite/', include('mysite.foo.urls')),
> > > >     # Uncomment the admin/doc line below 

Re: Syntax Error

2011-01-04 Thread cewing
Is it possible that the problem is not in this urls.py, but rather in
'polls.urls'?

I'd check line 20 there, just to see if there's an obvious python
syntax error.

HTH

c

On Jan 4, 8:08 am, hank23  wrote:
> After removing the commented code, saving urls.py, restarting the
> server and then requesting the sites admin page now I get the admin
> login screen. But after I type in my username and pw then it again
> gives me the following screen:
>
> TemplateSyntaxError at /admin/
> Caught SyntaxError while rendering: invalid syntax (urls.py, line
> 20)Request Method: GET
> Request URL:http://127.0.0.1:8000/admin/
> Django Version: 1.2.3
> Exception Type: TemplateSyntaxError
> Exception Value: Caught SyntaxError while rendering: invalid syntax
> (urls.py, line 20)
> Exception Location: C:\Python27\lib\site-packages\django\utils
> \importlib.py in import_module, line 35
> Python Executable: C:\Python27\python.exe
> Python Version: 2.7.1
> Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> Server time: Tue, 4 Jan 2011 09:45:54 -0600
>
> and still references the same line in urls.py, which is confusing
> because now it shouldn't have a line 20. Here's what urls.py currently
> looks like:
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
>     (r'^polls/', include('polls.urls')),
>     (r'^admin/', include(admin.site.urls)),
> )
>
> Could this problem be related to windows 7 environment variables not
> being set properly? I ask because I was upgraded recently from Win XP
> to Windows 7 and have been working to set up my environment variables
> back to where they should be. I thought I had previously fixed all of
> them, but maybe I missed something. Please advise. Thanks.
>
> On Jan 4, 9:36 am, Piotr Zalewa  wrote:
>
>
>
> > what happens if you'remove the commented lines?
>
> > On 01/04/11 15:22, hank23 wrote:
>
> > > Can someone explain to me what the following error is trying to tell
> > > me:
>
> > > SyntaxError at /polls/1
> > > invalid syntax (urls.py, line 20)Request Method: GET
> > > Request URL:http://127.0.0.1:8000/polls/1
> > > Django Version: 1.2.3
> > > Exception Type: SyntaxError
> > > Exception Value: invalid syntax (urls.py, line 20)
> > > Exception Location: C:\Python27\lib\site-packages\django\utils
> > > \importlib.py in import_module, line 35
> > > Python Executable: C:\Python27\python.exe
> > > Python Version: 2.7.1
> > > Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> > > \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> > > 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> > > \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> > > Server time: Tue, 4 Jan 2011 09:12:32 -0600
>
> > > The urls.py module that it is referring to looks like this:
>
> > > from django.conf.urls.defaults import *
>
> > > # Uncomment the next two lines to enable the admin:
> > > from django.contrib import admin
> > > admin.autodiscover()
>
> > > #urlpatterns = patterns('',
> > >     # Example:
> > >     # (r'^mysite/', include('mysite.foo.urls')),
> > >     # Uncomment the admin/doc line below to enable admin
> > > documentation:
> > >     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> > >     # Uncomment the next line to enable the admin:
> > >     # (r'^admin/', include(admin.site.urls)),    (r'^polls/$',
> > > 'polls.views.index'),
> > > #    (r'^polls/(?P\d+)/$', 'polls.views.detail'),
> > > #    (r'^polls/(?P\d+)/results/$', 'polls.views.results'),
> > > #    (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'),
> > > #    (r'^admin/', include(admin.site.urls)),
> > > #)
>
> > > urlpatterns = patterns('',
> > >     (r'^polls/', include('polls.urls')),
> > >     (r'^admin/', include(admin.site.urls)),
> > > )
>
> > > and I thought it had previously worked ok when I last tried to use it
> > > back on the 23rd. I would appreciate any help or direction in
> > > debugging this since I'm relatively new to both django and python.
> > > Thanks.
>
> > --
> > blog  http://piotr.zalewa.info
> > jobs  http://webdev.zalewa.info
> > twit  http://twitter.com/zalun
> > face  http://facebook.com/zaloon-Hide quoted text -
>
> > - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syntax Error

2011-01-04 Thread hank23
After removing the commented code, saving urls.py, restarting the
server and then requesting the sites admin page now I get the admin
login screen. But after I type in my username and pw then it again
gives me the following screen:

TemplateSyntaxError at /admin/
Caught SyntaxError while rendering: invalid syntax (urls.py, line
20)Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.2.3
Exception Type: TemplateSyntaxError
Exception Value: Caught SyntaxError while rendering: invalid syntax
(urls.py, line 20)
Exception Location: C:\Python27\lib\site-packages\django\utils
\importlib.py in import_module, line 35
Python Executable: C:\Python27\python.exe
Python Version: 2.7.1
Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
\mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
Server time: Tue, 4 Jan 2011 09:45:54 -0600

and still references the same line in urls.py, which is confusing
because now it shouldn't have a line 20. Here's what urls.py currently
looks like:

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
(r'^polls/', include('polls.urls')),
(r'^admin/', include(admin.site.urls)),
)


Could this problem be related to windows 7 environment variables not
being set properly? I ask because I was upgraded recently from Win XP
to Windows 7 and have been working to set up my environment variables
back to where they should be. I thought I had previously fixed all of
them, but maybe I missed something. Please advise. Thanks.



On Jan 4, 9:36 am, Piotr Zalewa  wrote:
> what happens if you'remove the commented lines?
>
> On 01/04/11 15:22, hank23 wrote:
>
>
>
>
>
> > Can someone explain to me what the following error is trying to tell
> > me:
>
> > SyntaxError at /polls/1
> > invalid syntax (urls.py, line 20)Request Method: GET
> > Request URL:http://127.0.0.1:8000/polls/1
> > Django Version: 1.2.3
> > Exception Type: SyntaxError
> > Exception Value: invalid syntax (urls.py, line 20)
> > Exception Location: C:\Python27\lib\site-packages\django\utils
> > \importlib.py in import_module, line 35
> > Python Executable: C:\Python27\python.exe
> > Python Version: 2.7.1
> > Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> > \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> > 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> > \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> > Server time: Tue, 4 Jan 2011 09:12:32 -0600
>
> > The urls.py module that it is referring to looks like this:
>
> > from django.conf.urls.defaults import *
>
> > # Uncomment the next two lines to enable the admin:
> > from django.contrib import admin
> > admin.autodiscover()
>
> > #urlpatterns = patterns('',
> >     # Example:
> >     # (r'^mysite/', include('mysite.foo.urls')),
> >     # Uncomment the admin/doc line below to enable admin
> > documentation:
> >     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> >     # Uncomment the next line to enable the admin:
> >     # (r'^admin/', include(admin.site.urls)),    (r'^polls/$',
> > 'polls.views.index'),
> > #    (r'^polls/(?P\d+)/$', 'polls.views.detail'),
> > #    (r'^polls/(?P\d+)/results/$', 'polls.views.results'),
> > #    (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'),
> > #    (r'^admin/', include(admin.site.urls)),
> > #)
>
> > urlpatterns = patterns('',
> >     (r'^polls/', include('polls.urls')),
> >     (r'^admin/', include(admin.site.urls)),
> > )
>
> > and I thought it had previously worked ok when I last tried to use it
> > back on the 23rd. I would appreciate any help or direction in
> > debugging this since I'm relatively new to both django and python.
> > Thanks.
>
> --
> blog  http://piotr.zalewa.info
> jobs  http://webdev.zalewa.info
> twit  http://twitter.com/zalun
> face  http://facebook.com/zaloon- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syntax Error

2011-01-04 Thread Piotr Zalewa
what happens if you'remove the commented lines?

On 01/04/11 15:22, hank23 wrote:
> Can someone explain to me what the following error is trying to tell
> me:
> 
> SyntaxError at /polls/1
> invalid syntax (urls.py, line 20)Request Method: GET
> Request URL: http://127.0.0.1:8000/polls/1
> Django Version: 1.2.3
> Exception Type: SyntaxError
> Exception Value: invalid syntax (urls.py, line 20)
> Exception Location: C:\Python27\lib\site-packages\django\utils
> \importlib.py in import_module, line 35
> Python Executable: C:\Python27\python.exe
> Python Version: 2.7.1
> Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> \mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
> 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
> \lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
> Server time: Tue, 4 Jan 2011 09:12:32 -0600
> 
> The urls.py module that it is referring to looks like this:
> 
> from django.conf.urls.defaults import *
> 
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
> 
> #urlpatterns = patterns('',
> # Example:
> # (r'^mysite/', include('mysite.foo.urls')),
> # Uncomment the admin/doc line below to enable admin
> documentation:
> # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> # Uncomment the next line to enable the admin:
> # (r'^admin/', include(admin.site.urls)),(r'^polls/$',
> 'polls.views.index'),
> #(r'^polls/(?P\d+)/$', 'polls.views.detail'),
> #(r'^polls/(?P\d+)/results/$', 'polls.views.results'),
> #(r'^polls/(?P\d+)/vote/$', 'polls.views.vote'),
> #(r'^admin/', include(admin.site.urls)),
> #)
> 
> urlpatterns = patterns('',
> (r'^polls/', include('polls.urls')),
> (r'^admin/', include(admin.site.urls)),
> )
> 
> 
> and I thought it had previously worked ok when I last tried to use it
> back on the 23rd. I would appreciate any help or direction in
> debugging this since I'm relatively new to both django and python.
> Thanks.
> 
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Syntax Error

2011-01-04 Thread hank23
Can someone explain to me what the following error is trying to tell
me:

SyntaxError at /polls/1
invalid syntax (urls.py, line 20)Request Method: GET
Request URL: http://127.0.0.1:8000/polls/1
Django Version: 1.2.3
Exception Type: SyntaxError
Exception Value: invalid syntax (urls.py, line 20)
Exception Location: C:\Python27\lib\site-packages\django\utils
\importlib.py in import_module, line 35
Python Executable: C:\Python27\python.exe
Python Version: 2.7.1
Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
\mysite', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs',
'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\
\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
Server time: Tue, 4 Jan 2011 09:12:32 -0600

The urls.py module that it is referring to looks like this:

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

#urlpatterns = patterns('',
# Example:
# (r'^mysite/', include('mysite.foo.urls')),
# Uncomment the admin/doc line below to enable admin
documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# (r'^admin/', include(admin.site.urls)),(r'^polls/$',
'polls.views.index'),
#(r'^polls/(?P\d+)/$', 'polls.views.detail'),
#(r'^polls/(?P\d+)/results/$', 'polls.views.results'),
#(r'^polls/(?P\d+)/vote/$', 'polls.views.vote'),
#(r'^admin/', include(admin.site.urls)),
#)

urlpatterns = patterns('',
(r'^polls/', include('polls.urls')),
(r'^admin/', include(admin.site.urls)),
)


and I thought it had previously worked ok when I last tried to use it
back on the 23rd. I would appreciate any help or direction in
debugging this since I'm relatively new to both django and python.
Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Question: Syntax Error - Form Class, trying to set e-mail field to required=False

2010-07-22 Thread strayhand
S.

Thanks! I'm completely new to Python (guess I should have paid more
attention to variable names). I might have tried removed the dash
sooner but I was following how it was typed in the book. I'll have to
file a type with the author. Thanks again.

On Jul 22, 5:56 am, Simon Holness  wrote:
> "e-mail" can't have a hyphen in it. Python thinks you're "assigning"
> to the operation e - mail
>
> just type into a shell to see.
>
> e-mail = "blah"
> SyntaxError: can't assign to operator
>
> rename to e_mail or email or something and you should be good to go
>
> On 22 July 2010 06:10, strayhand  wrote:
>
> > I apologize in advance if i'm posting this question in the wrong area.
> > I'm learning about django's form class in "The Definitive Guide To
> > Django" and for some reason that's beyond me I keep getting a syntax
> > error. I've been over my code a dozen times and I'm hoping that
> > someone can point me in the right direction.
>
> > (Taken from page 133-134)
>
> > contactforms.py
>
> > from django import forms
>
> > class ContactForm(forms.Form):
> >        subject = forms.CharField()
> >        e-mail = forms.EmailField(required=False)
> >        message = forms.CharField()
>
> > When I jump into the shell and type the following I get the syntax
> > error:
>
> > from contactforms import ContactForms
> > Traceback (most recent call last):
> >  File "", line 1, in 
> >  File "/Users/bealtr/Personal/YLBBQ/Django Projects/ylbbq/
> > contactforms.py", line 5
> >    e-mail = forms.EmailField(required=False)
> > SyntaxError: can't assign to operator
>
> > What am I doing wrong?
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie Question: Syntax Error - Form Class, trying to set e-mail field to required=False

2010-07-22 Thread Simon Holness
"e-mail" can't have a hyphen in it. Python thinks you're "assigning"
to the operation e - mail

just type into a shell to see.

e-mail = "blah"
SyntaxError: can't assign to operator

rename to e_mail or email or something and you should be good to go

On 22 July 2010 06:10, strayhand  wrote:
> I apologize in advance if i'm posting this question in the wrong area.
> I'm learning about django's form class in "The Definitive Guide To
> Django" and for some reason that's beyond me I keep getting a syntax
> error. I've been over my code a dozen times and I'm hoping that
> someone can point me in the right direction.
>
> (Taken from page 133-134)
>
> contactforms.py
>
> from django import forms
>
> class ContactForm(forms.Form):
>        subject = forms.CharField()
>        e-mail = forms.EmailField(required=False)
>        message = forms.CharField()
>
> When I jump into the shell and type the following I get the syntax
> error:
>
> from contactforms import ContactForms
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/Users/bealtr/Personal/YLBBQ/Django Projects/ylbbq/
> contactforms.py", line 5
>    e-mail = forms.EmailField(required=False)
> SyntaxError: can't assign to operator
>
> What am I doing wrong?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Newbie Question: Syntax Error - Form Class, trying to set e-mail field to required=False

2010-07-22 Thread strayhand
I apologize in advance if i'm posting this question in the wrong area.
I'm learning about django's form class in "The Definitive Guide To
Django" and for some reason that's beyond me I keep getting a syntax
error. I've been over my code a dozen times and I'm hoping that
someone can point me in the right direction.

(Taken from page 133-134)

contactforms.py

from django import forms

class ContactForm(forms.Form):
subject = forms.CharField()
e-mail = forms.EmailField(required=False)
message = forms.CharField()

When I jump into the shell and type the following I get the syntax
error:

from contactforms import ContactForms
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/bealtr/Personal/YLBBQ/Django Projects/ylbbq/
contactforms.py", line 5
e-mail = forms.EmailField(required=False)
SyntaxError: can't assign to operator

What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: URL dispatch with name argument throws syntax error

2010-04-22 Thread vjimw
Thanks! That was it! I had completely overlooked that and the url()
function was even in another URLs file in our project.

On Apr 22, 10:45 am, kmtracey  wrote:
> On Thu, Apr 22, 2010 at 11:34 AM, vjimw  wrote:
> > Adding the name argument seems pretty straight forward, but I must be
> > doing something wrong. I am writing tests and have the URLs named
> > seems like the easiest way to look them up.
>
> > My URL dispatch file was working before I added any of the name='this-
> > name' arguments.
>
> You can't specify name= when you have tuples in your patterns, you must use
> the url() function 
> (http://docs.djangoproject.com/en/dev/topics/http/urls/#url) if you want to
> use that syntax.
>
> Karen
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: URL dispatch with name argument throws syntax error

2010-04-22 Thread kmtracey
On Thu, Apr 22, 2010 at 11:34 AM, vjimw  wrote:

> Adding the name argument seems pretty straight forward, but I must be
> doing something wrong. I am writing tests and have the URLs named
> seems like the easiest way to look them up.
>
> My URL dispatch file was working before I added any of the name='this-
> name' arguments.
>
>
You can't specify name= when you have tuples in your patterns, you must use
the url() function (
http://docs.djangoproject.com/en/dev/topics/http/urls/#url) if you want to
use that syntax.

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



URL dispatch with name argument throws syntax error

2010-04-22 Thread vjimw
Adding the name argument seems pretty straight forward, but I must be
doing something wrong. I am writing tests and have the URLs named
seems like the easiest way to look them up.

My URL dispatch file was working before I added any of the name='this-
name' arguments.

Here is my file:

from django.conf.urls.defaults import *

urlpatterns = patterns('ukca_admin.coupon.mailer_views',
  (r'^notify/(?P\w+)?/?(?P[\w\-]+)?/?(?
P\w+)?/?(?P\w+)?/?$', 'notify_account_manager',
name='notify-account-manager'),
  (r'^build/(?P\d+)?/(?P\w+)?/?(?
P[\w\-]+)?/?(?P\w+)?/?(?P\w+)?/?(?P\w+)?/?
$', 'mailer_index', name='mailer-index'),
  (r'^rebuild/offers/(?P\w+)?/?(?P[\w
\-]+)?/?(?P\w+)?/?(?P\w+)?/?(?P\w+)?/?$',
'rebuild_offers', name='rebuild-offers'),
  (r'^rebuild/recipients/(?P\w+)?/?(?
P[\w\-]+)?/?(?P\w+)?/?(?P\w+)?/?(?P\w+)?/?
$', 'rebuild_recipients', name='rebuild-recipients'),

)


And here is the error I get:

SyntaxError at /mailer/

('invalid syntax', ('/var/www/ccadmin/ukca_admin/../ukca_admin/coupon/
mailer_urls.py', 4, 139, "  (r'^notify/(?P\\w
+)?/?(?P[\\w\\-]+)?/?(?P\\w+)?/?(?P\\w+)?/?$',
'notify_account_manager', name='notify-account-manager'),\n"))

Request Method: GET
Request URL:http://ccadmin.jt.ccbn.net/mailer/
Exception Type: SyntaxError
Exception Value:

('invalid syntax', ('/var/www/ccadmin/ukca_admin/../ukca_admin/coupon/
mailer_urls.py', 4, 139, "  (r'^notify/(?P\\w
+)?/?(?P[\\w\\-]+)?/?(?P\\w+)?/?(?P\\w+)?/?$',
'notify_account_manager', name='notify-account-manager'),\n"))

Exception Location: /usr/lib/python2.6/site-packages/django/utils/
importlib.py in import_module, line 35
Python Executable:  /usr/bin/python
Python Version: 2.6.4
Python Path:['/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/
usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/
lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/
lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages', '/
var/www/ccadmin/ukca_admin/../Django-1.1.1', '/var/www/ccadmin/
ukca_admin', '/var/www/ccadmin/ukca_admin/lib', '/var/www/ccadmin/
ukca_admin/../']
Server time:Thu, 22 Apr 2010 16:27:21 +0100


Thanks!
--Jim

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Template Syntax Error: url config module not found

2009-11-09 Thread m3mitsuppe

Ok, so I narrowed this down a bit: the problem was with
get_absolute_url. I still
do not understand why it would complain about the urls.py not being
found.

I'd still be happy about any hints, but in the meantime I changed my
template code
to a not-so-DRY but working version with explicit urls.

On 9 Nov., 08:46, m3mitsuppe  wrote:
> Hi all,
>
> I have a strange error on a website I developed (quite some time
> ago...).
>
> The main url works:http://www.christina-kratzenberg.de
>
> So do all the links at the bottom except for the "portfolio" one. It's
> of course the interesting part where a photo portfolio is shown.
>
> When I click on that link, Django issues a Template Syntax Error
> saying that the module "tina.urls" cannot be importet. That's kind of
> strange, because it must have been imported this exact module for
> rendering the home page and the other pages that do work.
>
> As this happens during template rendering, I'm a bit at a loss here.
> Can anyone provide me with ideas? I don't really understand where to
> look for a solution.
>
> I'm on Django 1.0.2 with mod_python. Upgrading Django to a newer
> version and/or migrating to mod_wsgi is possible, but I don't want to
> start changing everything without understanding what's happening here.
>
> Thanks!
> Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Template Syntax Error: url config module not found

2009-11-08 Thread m3mitsuppe

Hi all,

I have a strange error on a website I developed (quite some time
ago...).

The main url works: http://www.christina-kratzenberg.de

So do all the links at the bottom except for the "portfolio" one. It's
of course the interesting part where a photo portfolio is shown.

When I click on that link, Django issues a Template Syntax Error
saying that the module "tina.urls" cannot be importet. That's kind of
strange, because it must have been imported this exact module for
rendering the home page and the other pages that do work.

As this happens during template rendering, I'm a bit at a loss here.
Can anyone provide me with ideas? I don't really understand where to
look for a solution.

I'm on Django 1.0.2 with mod_python. Upgrading Django to a newer
version and/or migrating to mod_wsgi is possible, but I don't want to
start changing everything without understanding what's happening here.

Thanks!
Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Nicu Marcu
2009/11/4 Nicu Marcu 

> I'm getting in that specific url, means test_ajax1 view. I test this. It do
> the render_to response. I put a print and a raw_input() in that specific
> view, and it fire up, on that click event. I think the problem is when that
> #test_div is updated.
>
> 2009/11/4 Tom Evans 
>
> On Wed, Nov 4, 2009 at 9:50 AM, NMarcu  wrote:
>>
>>>
>>> Hello all,
>>>
>>>   I got an error, and I don't know how to pass on it. I got this
>>> error when I try to use ajax from django templates.
>>> I use this, from jquery:
>>> $('#create-user').click(function() {
>>>$( '#test_div' ).load( "{% url test_ajax %}");
>>>});
>>>
>>>
>> '{% url test_ajax %}' will only expand to a URL if that file is parsed by
>> django's template engine. Since the url is not expanded, I'm guessing that
>> it isn't - is it in a standalone javascript file?
>>
>> The other code posted is not relevant, you're not getting past the first
>> step here.
>>
>> Cheers
>>
>> Tom
>>
>>
>> >>
>>
>
>
> --
> All the best,
>
> Nicolae MARCU
>



-- 
All the best,

Nicolae MARCU

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Nicu Marcu
I'm getting in that specific url, means test_ajax1 view. I test this. It do
the render_to response. I put a print and a raw_input() in that specific
view, and it fire up, on that click event. I think the problem is when that
#test_div is updated.

2009/11/4 Tom Evans 

> On Wed, Nov 4, 2009 at 9:50 AM, NMarcu  wrote:
>
>>
>> Hello all,
>>
>>   I got an error, and I don't know how to pass on it. I got this
>> error when I try to use ajax from django templates.
>> I use this, from jquery:
>> $('#create-user').click(function() {
>>$( '#test_div' ).load( "{% url test_ajax %}");
>>});
>>
>>
> '{% url test_ajax %}' will only expand to a URL if that file is parsed by
> django's template engine. Since the url is not expanded, I'm guessing that
> it isn't - is it in a standalone javascript file?
>
> The other code posted is not relevant, you're not getting past the first
> step here.
>
> Cheers
>
> Tom
>
>
> >
>


-- 
All the best,

Nicolae MARCU

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Tom Evans
On Wed, Nov 4, 2009 at 9:50 AM, NMarcu  wrote:

>
> Hello all,
>
>   I got an error, and I don't know how to pass on it. I got this
> error when I try to use ajax from django templates.
> I use this, from jquery:
> $('#create-user').click(function() {
>$( '#test_div' ).load( "{% url test_ajax %}");
>});
>
>
'{% url test_ajax %}' will only expand to a URL if that file is parsed by
django's template engine. Since the url is not expanded, I'm guessing that
it isn't - is it in a standalone javascript file?

The other code posted is not relevant, you're not getting past the first
step here.

Cheers

Tom

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Nicu Marcu
I see it with firebug.

2009/11/4 Daniel Roseman 

>
> On Nov 4, 9:50 am, NMarcu  wrote:
> > Hello all,
> >
> >I got an error, and I don't know how to pass on it. I got this
> > error when I try to use ajax from django templates.
> > I use this, from jquery:
> > $('#create-user').click(function() {
> > $( '#test_div' ).load( "{% url test_ajax %}");
> > });
> >
> > I have this button:
> > Add a new operator
> >
> > I have this div:
> >
> > 
> > Test
> > 
> >
> > This is in urls.py:
> >
> > url(r'^operators/', 'ibox2.operators.views.test_ajax1',
> > name='test_ajax'),
> >
> > This is the view:
> >
> > def test_ajax1( request ):
> > if request.is_ajax():
> > template = 'operators/operators_list.html'
> >
> > data = {
> >
> > }
> >
> > return render_to_response( template, data,
> > context_instance = RequestContext( request ) )
> >
> > This is the operators_list.html:
> > After Ajax
> >
> > Somebody get the same error, or know what I'm doing wrong?
>
> What is the error? Where are you seeing it? What is the traceback?
> --
> DR.
> >
>


-- 
All the best,

Nicolae MARCU

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Daniel Roseman

On Nov 4, 9:50 am, NMarcu  wrote:
> Hello all,
>
>    I got an error, and I don't know how to pass on it. I got this
> error when I try to use ajax from django templates.
> I use this, from jquery:
> $('#create-user').click(function() {
>                 $( '#test_div' ).load( "{% url test_ajax %}");
>         });
>
> I have this button:
> Add a new operator
>
> I have this div:
>
> 
>                 Test
> 
>
> This is in urls.py:
>
> url(r'^operators/', 'ibox2.operators.views.test_ajax1',
> name='test_ajax'),
>
> This is the view:
>
> def test_ajax1( request ):
>     if request.is_ajax():
>             template = 'operators/operators_list.html'
>
>             data = {
>
>             }
>
>             return render_to_response( template, data,
> context_instance = RequestContext( request ) )
>
> This is the operators_list.html:
> After Ajax
>
> Somebody get the same error, or know what I'm doing wrong?

What is the error? Where are you seeing it? What is the traceback?
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread NMarcu

Hello all,

   I got an error, and I don't know how to pass on it. I got this
error when I try to use ajax from django templates.
I use this, from jquery:
$('#create-user').click(function() {
$( '#test_div' ).load( "{% url test_ajax %}");
});

I have this button:
Add a new operator

I have this div:


Test


This is in urls.py:

url(r'^operators/', 'ibox2.operators.views.test_ajax1',
name='test_ajax'),

This is the view:

def test_ajax1( request ):
if request.is_ajax():
template = 'operators/operators_list.html'

data = {

}

return render_to_response( template, data,
context_instance = RequestContext( request ) )

This is the operators_list.html:
After Ajax

Somebody get the same error, or know what I'm doing wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



RE: syntax error what am i doing wrong???

2009-10-26 Thread Vincent Jones

Thanks...it worked.

-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Daniel Roseman
Sent: Monday, October 26, 2009 7:01 PM
To: Django users
Subject: Re: syntax error what am i doing wrong???


On Oct 26, 10:35 pm, "jon...@cox.net"  wrote:
> SyntaxError at /
>
> ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
> \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
> Response(output)\n'))
>
> SCRIPT FROM VIEWS.PY
>
> from django.http import HttpResponse
> def main_page(request) :
>    output = '''
>   
>      %s
>      
>         %s%s
>      
>   
> ''' % (
>       'Django Bookmarks',
>       'Welcome to Django Bookmarks',
>       'Where you can store and share bookmarks!'
> )
> return HttpResponse(output)

Looks like your final line is not properly indented - should be lined
up with 'output', not 'def'.
--
DR.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: syntax error what am i doing wrong???

2009-10-26 Thread Daniel Roseman

On Oct 26, 10:35 pm, "jon...@cox.net"  wrote:
> SyntaxError at /
>
> ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
> \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
> Response(output)\n'))
>
> SCRIPT FROM VIEWS.PY
>
> from django.http import HttpResponse
> def main_page(request) :
>    output = '''
>   
>      %s
>      
>         %s%s
>      
>   
> ''' % (
>       'Django Bookmarks',
>       'Welcome to Django Bookmarks',
>       'Where you can store and share bookmarks!'
> )
> return HttpResponse(output)

Looks like your final line is not properly indented - should be lined
up with 'output', not 'def'.
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: syntax error what am i doing wrong???

2009-10-26 Thread Antoni Aloy

2009/10/26 jon...@cox.net :
>
> SyntaxError at /
>
> ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
> \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
> Response(output)\n'))
>
> SCRIPT FROM VIEWS.PY
>
> from django.http import HttpResponse
> def main_page(request) :
>   output = '''
>  
>     %s
>     
>        %s%s
>     
>  
> ''' % (
>      'Django Bookmarks',
>      'Welcome to Django Bookmarks',
>      'Where you can store and share bookmarks!'
> )
> return HttpResponse(output)
>
> >
>

At first sight: you need triple quote string not single.

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



syntax error what am i doing wrong???

2009-10-26 Thread jon...@cox.net

SyntaxError at /

('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\
\..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http
Response(output)\n'))

SCRIPT FROM VIEWS.PY

from django.http import HttpResponse
def main_page(request) :
   output = '''
  
 %s
 
%s%s
 
  
''' % (
  'Django Bookmarks',
  'Welcome to Django Bookmarks',
  'Where you can store and share bookmarks!'
)
return HttpResponse(output)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



SQL syntax error in Admin

2009-10-24 Thread Tim Valenta

If there's nothing I can determine here, I'll move over to submitting
a ticket on the matter.  Wanted to check in here first.

Using...

Django 1.2 SVN revision 11653, (updated just 2 minutes ago)
MySQL 5.1.31

Models:
class Category(models.Model):
category = models.CharField()
class Question(models.Model):
category = models.ForeignKey(Category)
class Template(models.Model):
categories = models.ManyToManyField(Category,
related_name='templates')
questions = models.ManyToManyField('Question',
related_name='templates', limit_choices_to=Q(category__in=F
('templates__categories')))

The error popped up while I was playing with that 'limit_choices_to'
option on Template.questions.

The error text:
Caught an exception while rendering: (1064, "You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near
'`surveys_surveytemplate_categories`.`surveycategory_id`' at line 1")


The logic behind the model setup is that a Template consists of
Categories and Questions.  Since each Question has an underlying
Category of its own, I want to filter the Question list to only
contain items whose own Category is found on the base Template's m2m
relationship to Category.

Please ask if clarification is needed..

This setup works great if I remove the usage of 'F
("templates__categories")' and just hardcode a '[1,2]' in its place.
Something about using 'F' in a 'Q' in 'limit_choices_to' is not
working.

Any ideas on how I could snag the SQL and print it out somehow?  This
isn't like PHP where I can just throw down a print line anywhere in
the code, even if I use an event listener attached to the query-making
pipeline.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread W3

Thanks, that was it. Bit of a simple one I probably should have
spotted.

Andrew

On 25 Sep, 19:42, Tim Chase  wrote:
> > Can somebody tell me why i get a syntax error with this named URL
> > pattern?
>
> > urlpatterns = patterns('',
> >     url(r'^feed/(?P.*)/$',
> >     'django.contrib.syndication.views.feed',
> >     {'feed_dict': feeds}
>
> looks like a missing comma here...
>
> >     name="feed"),
> > )
>
> -tim
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Named URL Patterns -- Syntax Error

2009-09-25 Thread Tim Chase

> Can somebody tell me why i get a syntax error with this named URL
> pattern?
> 
> urlpatterns = patterns('',
> url(r'^feed/(?P.*)/$',
> 'django.contrib.syndication.views.feed',
> {'feed_dict': feeds}

looks like a missing comma here...

> name="feed"),
> )

-tim




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Named URL Patterns -- Syntax Error

2009-09-25 Thread When ideas fail

Can somebody tell me why i get a syntax error with this named URL
pattern?

urlpatterns = patterns('',
url(r'^feed/(?P.*)/$',
'django.contrib.syndication.views.feed',
{'feed_dict': feeds}
name="feed"),
)


This is the traceback:

Traceback:
File "C:\Python26\lib\site-packages\django\core\handlers\base.py" in
get_response
  83. request.path_info)
File "C:\Python26\lib\site-packages\django\core\urlresolvers.py" in
resolve
  216. for pattern in self.url_patterns:
File "C:\Python26\lib\site-packages\django\core\urlresolvers.py" in
_get_url_patterns
  245. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "C:\Python26\lib\site-packages\django\core\urlresolvers.py" in
_get_urlconf_module
  240. self._urlconf_module = import_module
(self.urlconf_name)
File "C:\Python26\lib\site-packages\django\utils\importlib.py" in
import_module
  35. __import__(name)

Exception Type: SyntaxError at /
Exception Value: ('invalid syntax', ('C:\\Apache2.2\\myapp\\urls.py',
28, 73, '{\'feed_dict
\': feeds} name="feed"),\n'))


Thanks,

Andrew
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Syntax error

2009-09-15 Thread Maksymus007

On Tue, Sep 15, 2009 at 1:28 PM, Gonzalo Delgado
 wrote:
> El Tue, 15 Sep 2009 12:49:02 +0200
> Maksymus007  escribió:
>
>> {% if gates.forms %}
>>
>>     {% for form in gates.forms %}
>>
>>         {% if forloop.first %}
>>
>>         {% else %}
>>
>>         {% endif %}
>>
>>
>>     {% endfor $} < ?
>>
>>
>> >> {% else %}
>>
>> {% endif %}
>
>
> --
> P.U. Gonzalo Delgado 
> http://gonzalodelgado.com.ar/
>

Silly me :D Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Syntax error

2009-09-15 Thread Gonzalo Delgado
El Tue, 15 Sep 2009 12:49:02 +0200
Maksymus007  escribió:

> {% if gates.forms %}
> 
>     {% for form in gates.forms %}
> 
>         {% if forloop.first %}
> 
>         {% else %}
> 
>         {% endif %}
> 
> 
>     {% endfor $} < ?
> 
> 
> >> {% else %}
> 
> {% endif %}


-- 
P.U. Gonzalo Delgado 
http://gonzalodelgado.com.ar/


pgpybCgIPfG82.pgp
Description: PGP signature


Syntax error

2009-09-15 Thread Maksymus007

Whats wrong with such template (entire one):? Django returns

TemplateSyntaxError at /scratchcards/

Invalid block tag: 'else'

pointing at tag marked by >>

{% if gates.forms %}

    {% for form in gates.forms %}

        {% if forloop.first %}

        {% else %}

        {% endif %}


    {% endfor $}


>> {% else %}

{% endif %}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Jonquille

Great - the 2.0 book/Chap. 4, moves smoothly from code examples to
Tags without that mention.

Thanks for the quick responses.
Jon

On Mar 10, 3:02 pm, Alex Gaynor  wrote:
> On Tue, Mar 10, 2009 at 1:58 PM, Jonquille  wrote:
>
> > python manage.py shell
> > Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit
> > (Intel)] on win32
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)
> > >>> {% if 1 %}
> >  File "", line 1
> >    {% if 1 5}
> >     ^
> > SyntaxError: invalid syntax
>
> > What am I missing please, and thank you.
> > Jon
>
> What you just pasted is a piece of django template, not Python code, you
> need to put it in a string and use a template object as the djangobook
> shows(and all the docs do), not try to execute it at the Python prompt.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 1:58 PM, Jonquille  wrote:

>
> python manage.py shell
> Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> {% if 1 %}
>  File "", line 1
>{% if 1 5}
> ^
> SyntaxError: invalid syntax
>
> What am I missing please, and thank you.
> Jon
>
> >
>
What you just pasted is a piece of django template, not Python code, you
need to put it in a string and use a template object as the djangobook
shows(and all the docs do), not try to execute it at the Python prompt.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread James Bennett

On Tue, Mar 10, 2009 at 1:58 PM, Jonquille  wrote:
> What am I missing please, and thank you.

You're missing the idea that templates are not Python code and are not
typed at a Python prompt -- they're placed in template files and
templates are loaded and rendered according to the documentation.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Jonquille

python manage.py shell
Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> {% if 1 %}
  File "", line 1
{% if 1 5}
 ^
SyntaxError: invalid syntax

What am I missing please, and thank you.
Jon

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: ultra-n00b models.Model syntax error

2008-09-21 Thread Karen Tracey
On Sun, Sep 21, 2008 at 4:21 PM, notatoad <[EMAIL PROTECTED]> wrote:

>
> i just set up django and started on the tutorial.  i get this after
> calling 'python manage.py sql polls'
>
> [snip]
> File "/usr/local/django-apps/mysite/../mysite/polls/models.py", line 3
>
>class Poll(models.Model)
>
> ^SyntaxError: invalid syntax
>
> i'm working with the tutorial code here:
> http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3
>
> any ideas what's gone wrong?
>
>
Assuming the caret is actually pointing at the last character in the
identified line, then you're missing a ':' on the end of that line.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ultra-n00b models.Model syntax error

2008-09-21 Thread notatoad

i just set up django and started on the tutorial.  i get this after
calling 'python manage.py sql polls'

ceback (most recent call last):

File "manage.py", line 11, in ?

execute_manager(settings)

File "/usr/lib/python2.4/site-packages/django/core/management/
__init__.py", line 340, in execute_manager

utility.execute()

File "/usr/lib/python2.4/site-packages/django/core/management/
__init__.py", line 295, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/usr/lib/python2.4/site-packages/django/core/management/
base.py", line 77, in run_from_argv

self.execute(*args, **options.__dict__)

File "/usr/lib/python2.4/site-packages/django/core/management/
base.py", line 95, in execute

self.validate()

File "/usr/lib/python2.4/site-packages/django/core/management/
base.py", line 122, in validate

num_errors = get_validation_errors(s, app)

File "/usr/lib/python2.4/site-packages/django/core/management/
validation.py", line 28, in get_validation_errors

for (app_name, error) in get_app_errors().items():

File "/usr/lib/python2.4/site-packages/django/db/models/loading.py",
line 128, in get_app_errors

self._populate()

File "/usr/lib/python2.4/site-packages/django/db/models/loading.py",
line 57, in _populate

self.load_app(app_name, True)

File "/usr/lib/python2.4/site-packages/django/db/models/loading.py",
line 72, in load_app

mod = __import__(app_name, {}, {}, ['models'])

File "/usr/local/django-apps/mysite/../mysite/polls/models.py", line 3

class Poll(models.Model)

^SyntaxError: invalid syntax

i'm working with the tutorial code here: 
http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3

any ideas what's gone wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URLs Syntax Error

2008-09-04 Thread djandrow

Is it more practical if i put "date_based.archive_index" in the URL
pattern?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Unaccountable syntax error

2008-09-04 Thread guillaume

Sorry guys, I just need a tip :

where do you get your models.ColorField from ? I've upgraded to django
1.0, and don't have it !

Regards,

Guillaume

On 30 août, 16:03, Leaf <[EMAIL PROTECTED]> wrote:
> Of course. I just look at the error actually occurs on, not the
> context. I guess even Python's awesome debugging still has limits.
> What happened was that I forgot a parenthesis at the end of the
> previous line. Thanks for giving me the tip.
>
> On Aug 30, 9:57 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
>
> > On Sat, Aug 30, 2008 at 9:50 AM, Leaf <[EMAIL PROTECTED]> wrote:
>
> > > I'm having a problem when I try to validate my models. The interpreter
> > > somehow takes offense at this line:
>
> > >    box_text_color = models.ColorField("Box Text Color")
>
> > > I'm using a custom "ColorField" here. What I don't understand is that
> > > it seems almost identical to this ColorField, which it did accept:
>
> > >    bg_color = models.ColorField("Background Color")
>
> > > When it rejected it, the flow looked like this:
>
> > >  File "/Users/leaf/Django/devsite/../devsite/djstyles/models.py",
> > > line 47
> > >    box_text_color = models.ColorField("Box Text Color")
> > >                        ^
> > > SyntaxError: invalid syntax
>
> > > The caret was pointing at the r in "box_text_color". Does anyone know
> > > how this could have happened?
>
> > What's on the line above that?  That's probably where the trouble begins.
>
> > Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URLs Syntax Error

2008-09-03 Thread djandrow

I'm a bit confused here, what is dict, is it the same as archive
infor? And what has happened to date_based.archive_index?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: URLs Syntax Error

2008-09-03 Thread Daniel Hepper

Adding a comma will probably not help, because you then have 5 values in
the tuple, but the expected format is:

(regular expression, Python callback function [, optional dictionary [,
optional name]])

Either you put the argument 'template_name' into the archive_info dict
or you make two separate dicts.

Daniel


Am Mittwoch, den 03.09.2008, 05:26 -0700 schrieb
[EMAIL PROTECTED]:
> i believe you need a comma after archive_info and before
> {'template_name': 'blog/archive.html'}
> 
> On Sep 3, 7:40 am, djandrow <[EMAIL PROTECTED]> wrote:
> > Can no one help me with this, its just these two lines:
> >
> >  (r'^archive/$', date_based.archive_index,archive_info
> > {'template_name': 'blog/archive.html'}),
> >  (r'^archive/(?Pd{4})/?$',date_based.archive_year, archive_info
> > {'template_name': 'blog/archive.html'}),
> >
> > Please?
> >
> > Andrew
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



  1   2   >