Re: Tutorial Part 1

2020-05-10 Thread maninder singh Kumar
the polls URL needs to be added to urls.py.


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Sun, May 10, 2020 at 1:15 AM Randy Zeitvogel 
wrote:

> This is from my mysite/settings.py file:
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> This is from my polls/urls.py
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('', views.details, name='detail'),
> path('/results/', views.results, name='results'),
> path('/vote/', views.vote, name='vote'),
> ]
>
> This is from polls/apps.py
>
> from django.apps import AppConfig
>
>
> class PollsConfig(AppConfig):
> name = 'polls'
>
>
>
> On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu <
> nagarajusingoth...@gmail.com> wrote:
>
>> Dear Sir,
>>
>>First add your app in settings.py,then after
>> URLs.py
>>  from django.urls import path,include
>>  from ur(appname) import views
>>
>> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
>> wrote:
>>
>>> I just started working with Django in the last couple of days.
>>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
>>> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
>>> In both cases after I create the polls app and try it out, I get this:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://localhost:8000/polls/
>>>
>>> Using the URLconf defined in mysite.urls, Django tried these URL
>>> patterns, in this order:
>>>
>>>1. admin/
>>>
>>> The current path, polls/, didn't match any of these.
>>>
>>> You're seeing this error because you have DEBUG = True in your Django
>>> settings file. Change that to False, and Django will display a standard
>>> 404 page.
>>>
>>>
>>> The feedback from the development web server (python manage.py
>>> runserver) is:
>>>
>>>
>>> jango version 3.0.6, using settings 'mysite.settings'
>>> Starting development server at http://127.0.0.1:8000/
>>> Quit the server with CONTROL-C.
>>> Not Found: /polls/
>>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>>>
>>> My mysite/urls.py looks like this:
>>>
>>>
>>> from django.contrib import admin
>>> from django.urls import include, path
>>>
>>> urlpatterns = [
>>> path('polls/', include('polls.urls')),
>>> path('admin/', admin.site.urls),
>>> ]
>>>
>>>
>>> Any help would be appreciated.
>>>
>>>
>>> --
>>> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%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/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%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/CABOHK3R9J1rHpa_M86-m70eaBkDLS0odU5R6T4JyLRTOLEO%3D3A%40mail.gmail.com.


RE: Tutorial Part 1

2020-05-10 Thread ngallen4
Where is your polls/views.py???

It should at least return HttpResponse

From: django-users@googlegroups.com  On Behalf 
Of tejasri mamidi
Sent: Sunday, 10 May 2020 08:13
To: django-users@googlegroups.com
Subject: Re: Tutorial Part 1

 

Change mysite.urls ,

Path(' ',include('polls.url'))...

 

You were not created any polls function your view and and not import any polls 
view in your mysite.urls

 

On Sun, May 10, 2020, 01:15 Randy Zeitvogel mailto:randyzeitvo...@gmail.com> > wrote:

This is from my mysite/settings.py file:

# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

This is from my polls/urls.py

from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index'),
path('', views.details, name='detail'),
path('/results/', views.results, name='results'),
path('/vote/', views.vote <http://views.vote> , 
name='vote'),
]

This is from polls/apps.py

from django.apps import AppConfig


class PollsConfig(AppConfig):
name = 'polls'

 

 

On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu mailto:nagarajusingoth...@gmail.com> > wrote:

Dear Sir,

 

   First add your app in settings.py,then after 

URLs.py

 from django.urls import path,include

 from ur(appname) import views

 

On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, mailto:randyzeitvo...@gmail.com> > wrote:

I just started working with Django in the last couple of days. 

First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second 
environment is Fedora 31, python 3.7.5, and Django 3.0.6.

In both cases after I create the polls app and try it out, I get this:

 


Page not found (404)


Request Method:

GET


Request URL:

http://localhost:8000/polls/

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in 
this order: 

1.  admin/ 

The current path, polls/, didn't match any of these. 

You're seeing this error because you have DEBUG = True in your Django settings 
file. Change that to False, and Django will display a standard 404 page. 

 

The feedback from the development web server (python manage.py runserver) is:

 

jango version 3.0.6, using settings 'mysite.settings' 
Starting development server at http://127.0.0.1:8000/ 
Quit the server with CONTROL-C. 
Not Found: /polls/ 
[08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957 

My mysite/urls.py looks like this:

 

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]

 

Any help would be appreciated.

 

-- 
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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com
 
<https://groups.google.com/d/msgid/django-users/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com?utm_medium=email_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 
<mailto:django-users+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com?utm_medium=email_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 
<mailto:django-users+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com
 
<https://groups.google.com/d/msgid/django-users/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com?utm_medium=email_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 
<mailto:django-users+unsubscr...@googlegroups.com> .
To view this discussion on the

Re: Tutorial Part 1

2020-05-09 Thread tejasri mamidi
Change mysite.urls ,
Path(' ',include('polls.url'))...

You were not created any polls function your view and and not import any
polls view in your mysite.urls

On Sun, May 10, 2020, 01:15 Randy Zeitvogel 
wrote:

> This is from my mysite/settings.py file:
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> This is from my polls/urls.py
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
> path('', views.index, name='index'),
> path('', views.details, name='detail'),
> path('/results/', views.results, name='results'),
> path('/vote/', views.vote, name='vote'),
> ]
>
> This is from polls/apps.py
>
> from django.apps import AppConfig
>
>
> class PollsConfig(AppConfig):
> name = 'polls'
>
>
>
> On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu <
> nagarajusingoth...@gmail.com> wrote:
>
>> Dear Sir,
>>
>>First add your app in settings.py,then after
>> URLs.py
>>  from django.urls import path,include
>>  from ur(appname) import views
>>
>> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
>> wrote:
>>
>>> I just started working with Django in the last couple of days.
>>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
>>> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
>>> In both cases after I create the polls app and try it out, I get this:
>>>
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: http://localhost:8000/polls/
>>>
>>> Using the URLconf defined in mysite.urls, Django tried these URL
>>> patterns, in this order:
>>>
>>>1. admin/
>>>
>>> The current path, polls/, didn't match any of these.
>>>
>>> You're seeing this error because you have DEBUG = True in your Django
>>> settings file. Change that to False, and Django will display a standard
>>> 404 page.
>>>
>>>
>>> The feedback from the development web server (python manage.py
>>> runserver) is:
>>>
>>>
>>> jango version 3.0.6, using settings 'mysite.settings'
>>> Starting development server at http://127.0.0.1:8000/
>>> Quit the server with CONTROL-C.
>>> Not Found: /polls/
>>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>>>
>>> My mysite/urls.py looks like this:
>>>
>>>
>>> from django.contrib import admin
>>> from django.urls import include, path
>>>
>>> urlpatterns = [
>>> path('polls/', include('polls.urls')),
>>> path('admin/', admin.site.urls),
>>> ]
>>>
>>>
>>> Any help would be appreciated.
>>>
>>>
>>> --
>>> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%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/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%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/CAP6hVmA0-TCTj%2B%3DqqseEq%2BKjaVtiCo7bbSiLmNKX9-AnSZiCqg%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-09 Thread Randy Zeitvogel
This is from my mysite/settings.py file:

# Application definition

INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

This is from my polls/urls.py

from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name='index'),
path('', views.details, name='detail'),
path('/results/', views.results, name='results'),
path('/vote/', views.vote, name='vote'),
]

This is from polls/apps.py

from django.apps import AppConfig


class PollsConfig(AppConfig):
name = 'polls'



On Sat, May 9, 2020 at 9:41 AM Nagaraju Singothu <
nagarajusingoth...@gmail.com> wrote:

> Dear Sir,
>
>First add your app in settings.py,then after
> URLs.py
>  from django.urls import path,include
>  from ur(appname) import views
>
> On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
> wrote:
>
>> I just started working with Django in the last couple of days.
>> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
>> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
>> In both cases after I create the polls app and try it out, I get this:
>>
>> Page not found (404)
>> Request Method: GET
>> Request URL: http://localhost:8000/polls/
>>
>> Using the URLconf defined in mysite.urls, Django tried these URL
>> patterns, in this order:
>>
>>1. admin/
>>
>> The current path, polls/, didn't match any of these.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>>
>> The feedback from the development web server (python manage.py runserver)
>> is:
>>
>>
>> jango version 3.0.6, using settings 'mysite.settings'
>> Starting development server at http://127.0.0.1:8000/
>> Quit the server with CONTROL-C.
>> Not Found: /polls/
>> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>>
>> My mysite/urls.py looks like this:
>>
>>
>> from django.contrib import admin
>> from django.urls import include, path
>>
>> urlpatterns = [
>> path('polls/', include('polls.urls')),
>> path('admin/', admin.site.urls),
>> ]
>>
>>
>> Any help would be appreciated.
>>
>>
>> --
>> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%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/CALzWbqwm7A9SiaPfJVcYhMPPxFQe999nairQ0z1AqJwgxwkXxg%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-09 Thread Nagaraju Singothu
Dear Sir,

   First add your app in settings.py,then after
URLs.py
 from django.urls import path,include
 from ur(appname) import views

On Sat 9 May, 2020, 5:42 AM Randy Zeitvogel, 
wrote:

> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/CAMyGuAYu%2BpcZcgv9ciiiz9fpYQLWJSuMOa9ZE5V02V7r0UASZA%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-09 Thread tejasri mamidi
Did ,you place ur appname in installed app in settings

On Sat, May 9, 2020, 05:42 Randy Zeitvogel  wrote:

> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/CAP6hVmBJa%2BQ%2BuS6GkoHuwJvPStWK%2B0SdF6Hk3t%3DdkgcazmNPFA%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-09 Thread ola neat
Check your app url,  does the url match with wath u have on your browser,

On Sat, May 9, 2020, 01:59 Luqman Jr  wrote:

> Hello
> Did you create urls.py under polls app?
> You should have urls.py under polls app which will list all urls fall
> under this app.
> Then share with us polls/urls.py and polls/views.py so that we can help
> more on this.
> On 9 May 2020, 03:11 +0300, Randy Zeitvogel ,
> wrote:
>
> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/polls/
>
> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard
> 404 page.
>
>
> The feedback from the development web server (python manage.py runserver)
> is:
>
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> Any help would be appreciated.
>
>
> --
> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/3baac878-0c7c-4bec-8788-5d04b21b%40Spark
> 
> .
>

-- 
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/CAHLKn72nXUhtAgixbk6YNLY1kmrNycuj36VeM80S6kX7GZQPKg%40mail.gmail.com.


Re: Tutorial Part 1

2020-05-08 Thread Luqman Jr
Hello
Did you create urls.py under polls app?
You should have urls.py under polls app which will list all urls fall under 
this app.
Then share with us polls/urls.py and polls/views.py so that we can help more on 
this.
On 9 May 2020, 03:11 +0300, Randy Zeitvogel , wrote:
> I just started working with Django in the last couple of days.
> First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second 
> environment is Fedora 31, python 3.7.5, and Django 3.0.6.
> In both cases after I create the polls app and try it out, I get this:
>
> Page not found (404)
> Request Method:
> GET
> Request URL:
> http://localhost:8000/polls/
> Using the URLconf defined in mysite.urls, Django tried these URL patterns, in 
> this order:
>
> 1. admin/
>
> The current path, polls/, didn't match any of these.
> You're seeing this error because you have DEBUG = True in your Django 
> settings file. Change that to False, and Django will display a standard 404 
> page.
>
> The feedback from the development web server (python manage.py runserver) is:
>
> jango version 3.0.6, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> Not Found: /polls/
> [08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957
>
> My mysite/urls.py looks like this:
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
>path('polls/', include('polls.urls')),
>path('admin/', admin.site.urls),
> ]
>
> Any help would be appreciated.
>
> --
> 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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%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/3baac878-0c7c-4bec-8788-5d04b21b%40Spark.


Tutorial Part 1

2020-05-08 Thread Randy Zeitvogel
I just started working with Django in the last couple of days. 
First environment is Ubuntu 19.10, python 3.7.5 and Django 3.1.  Second 
environment is Fedora 31, python 3.7.5, and Django 3.0.6.
In both cases after I create the polls app and try it out, I get this:

Page not found (404) 
Request Method: GET 
Request URL: http://localhost:8000/polls/ 

Using the URLconf defined in mysite.urls, Django tried these URL patterns, 
in this order: 

   1. admin/ 

The current path, polls/, didn't match any of these. 

You're seeing this error because you have DEBUG = True in your Django 
settings file. Change that to False, and Django will display a standard 404 
page. 


The feedback from the development web server (python manage.py runserver) 
is:


jango version 3.0.6, using settings 'mysite.settings' 
Starting development server at http://127.0.0.1:8000/ 
Quit the server with CONTROL-C. 
Not Found: /polls/ 
[08/May/2020 17:28:16] "GET /polls/ HTTP/1.1" 404 1957 

My mysite/urls.py looks like this:


from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]


Any help would be appreciated.


-- 
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/b7b3b071-7255-4fc1-84c8-db7d1766e5dd%40googlegroups.com.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Sorry for my last message! I only checked the main page which don´t have 
any page. Forgot to check the /polls/ 

You are perfectly right - not completing the ^ with return before the next 
character makes the difference! 
Thanks!


tirsdag 7. mars 2017 18.02.48 UTC+1 skrev Vanja Falck følgende:
>
> Checked the ^ sign, but it was only missing a return - no syntax-error or 
> change in the current 404 error, so I assume it is interpreted right.
>
> The error message is only this (deliberately exchanged my actual site with 
> xxx) - with the 404 header:
>
> Using the URLconf defined in xxx.urls, Django tried these URL patterns, 
> in this order:
>
>1. ^polls/
>2. ^admin/
>
> The current URL, , didn't match any of these.
>
>
>
> tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>>
>> Is there any information on the 404 page ? 
>> I remember django being quite chatty as long it's in debug mode 
>>
>> 2017-03-07 10:56 GMT+01:00 Vanja Falck : 
>> > Hi, 
>> > I have startet the first part of the djangoproject tutorial and get 
>> stuck in 
>> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
>> > Any one have an idea about what is wrong? 
>> > 
>> > Followed the instructions carefully (django 1.10 - version). Running in 
>> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
>> > Did follow an advice in this group and added the polls app in 
>> settings.py, 
>> > but it did not help. Nothing else is changed in the autosettings from a 
>> > fresh install of django 10.1.6. 
>> > 
>> > Is this a python problem or an OS problem? 
>> > 
>> > Here is my code: 
>> > 
>> > # Your first view: opprettet polls/urls.py 
>> > 
>> > from django.conf.urls import url 
>> > 
>> > from . import views 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆ$', views.index, name='index'), 
>> > ] 
>> > 
>> > # Your first view polls/views.py 
>> > 
>> > from django.http import HttpResponse 
>> > 
>> > def index(request): 
>> > return HttpResponse("Hoppla, polls index her..") 
>> > 
>> > # Site/urls.py 
>> > 
>> > from django.conf.urls import include, url 
>> > from django.contrib import admin 
>> > 
>> > urlpatterns = [ 
>> > url(r'ˆpolls/', include('polls.urls')), 
>> > url(r'^admin/', admin.site.urls), 
>> > ] 
>> > # Site/settings.py 
>> > # Application definition 
>> > 
>> > INSTALLED_APPS = [ 
>> > 'django.contrib.admin', 
>> > 'django.contrib.auth', 
>> > 'django.contrib.contenttypes', 
>> > 'django.contrib.sessions', 
>> > 'django.contrib.messages', 
>> > 'django.contrib.staticfiles', 
>> > 'polls.apps.PollsConfig', 
>> > 
>> > 
>> > 
>> > -- 
>> > 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>
>> -- 
>>
>> Cordialement, Coues Ludovic 
>> +336 148 743 42 
>>
>

-- 
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/ccecd63c-6f9c-4158-a9dc-d84682154197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Checked the ^ sign, but it was only missing a return - no syntax-error or 
change in the current 404 error, so I assume it is interpreted right.

The error message is only this (deliberately exchanged my actual site with 
xxx) - with the 404 header:

Using the URLconf defined in xxx.urls, Django tried these URL patterns, in 
this order:

   1. ^polls/
   2. ^admin/

The current URL, , didn't match any of these.



tirsdag 7. mars 2017 14.11.13 UTC+1 skrev ludovic coues følgende:
>
> Is there any information on the 404 page ? 
> I remember django being quite chatty as long it's in debug mode 
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck : 
>
> > Hi, 
> > I have startet the first part of the djangoproject tutorial and get 
> stuck in 
> > part 1 - getting 404 errors on /polls/ - the admin page is ok. 
> > Any one have an idea about what is wrong? 
> > 
> > Followed the instructions carefully (django 1.10 - version). Running in 
> > virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04. 
> > Did follow an advice in this group and added the polls app in 
> settings.py, 
> > but it did not help. Nothing else is changed in the autosettings from a 
> > fresh install of django 10.1.6. 
> > 
> > Is this a python problem or an OS problem? 
> > 
> > Here is my code: 
> > 
> > # Your first view: opprettet polls/urls.py 
> > 
> > from django.conf.urls import url 
> > 
> > from . import views 
> > 
> > urlpatterns = [ 
> > url(r'ˆ$', views.index, name='index'), 
> > ] 
> > 
> > # Your first view polls/views.py 
> > 
> > from django.http import HttpResponse 
> > 
> > def index(request): 
> > return HttpResponse("Hoppla, polls index her..") 
> > 
> > # Site/urls.py 
> > 
> > from django.conf.urls import include, url 
> > from django.contrib import admin 
> > 
> > urlpatterns = [ 
> > url(r'ˆpolls/', include('polls.urls')), 
> > url(r'^admin/', admin.site.urls), 
> > ] 
> > # Site/settings.py 
> > # Application definition 
> > 
> > INSTALLED_APPS = [ 
> > 'django.contrib.admin', 
> > 'django.contrib.auth', 
> > 'django.contrib.contenttypes', 
> > 'django.contrib.sessions', 
> > 'django.contrib.messages', 
> > 'django.contrib.staticfiles', 
> > 'polls.apps.PollsConfig', 
> > 
> > 
> > 
> > -- 
> > 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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/2db41c0f-284d-42e5-9f54-6b58452827b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
I think I see your problem.
Look like you can type a character looking a lot like ^ but being different.
^ is ascii character 94, which represent the start of a line in a
regular expression.

2017-03-07 14:10 GMT+01:00 ludovic coues :
> Is there any information on the 404 page ?
> I remember django being quite chatty as long it's in debug mode
>
> 2017-03-07 10:56 GMT+01:00 Vanja Falck :
>> Hi,
>> I have startet the first part of the djangoproject tutorial and get stuck in
>> part 1 - getting 404 errors on /polls/ - the admin page is ok.
>> Any one have an idea about what is wrong?
>>
>> Followed the instructions carefully (django 1.10 - version). Running in
>> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
>> Did follow an advice in this group and added the polls app in settings.py,
>> but it did not help. Nothing else is changed in the autosettings from a
>> fresh install of django 10.1.6.
>>
>> Is this a python problem or an OS problem?
>>
>> Here is my code:
>>
>> # Your first view: opprettet polls/urls.py
>>
>> from django.conf.urls import url
>>
>> from . import views
>>
>> urlpatterns = [
>> url(r'ˆ$', views.index, name='index'),
>> ]
>>
>> # Your first view polls/views.py
>>
>> from django.http import HttpResponse
>>
>> def index(request):
>> return HttpResponse("Hoppla, polls index her..")
>>
>> # Site/urls.py
>>
>> from django.conf.urls import include, url
>> from django.contrib import admin
>>
>> urlpatterns = [
>> url(r'ˆpolls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>> # Site/settings.py
>> # Application definition
>>
>> INSTALLED_APPS = [
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'polls.apps.PollsConfig',
>>
>>
>>
>> --
>> 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTaWSevQaw4ngdHJCm27S8CGp66%3DCj2LjtAO4STszACgyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread ludovic coues
Is there any information on the 404 page ?
I remember django being quite chatty as long it's in debug mode

2017-03-07 10:56 GMT+01:00 Vanja Falck :
> Hi,
> I have startet the first part of the djangoproject tutorial and get stuck in
> part 1 - getting 404 errors on /polls/ - the admin page is ok.
> Any one have an idea about what is wrong?
>
> Followed the instructions carefully (django 1.10 - version). Running in
> virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
> Did follow an advice in this group and added the polls app in settings.py,
> but it did not help. Nothing else is changed in the autosettings from a
> fresh install of django 10.1.6.
>
> Is this a python problem or an OS problem?
>
> Here is my code:
>
> # Your first view: opprettet polls/urls.py
>
> from django.conf.urls import url
>
> from . import views
>
> urlpatterns = [
> url(r'ˆ$', views.index, name='index'),
> ]
>
> # Your first view polls/views.py
>
> from django.http import HttpResponse
>
> def index(request):
> return HttpResponse("Hoppla, polls index her..")
>
> # Site/urls.py
>
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'ˆpolls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
> # Site/settings.py
> # Application definition
>
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'polls.apps.PollsConfig',
>
>
>
> --
> 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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTbHytjDdJ9Ti36oRrqWv89Cmzb_xNfP0M7%3D43sfEM%3Da_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Djangoproject tutorial part 1 - keep on getting 404 error on polls

2017-03-07 Thread Vanja Falck
Hi,
I have startet the first part of the djangoproject tutorial and get stuck 
in part 1 - getting 404 errors on /polls/ - the admin page is ok.
Any one have an idea about what is wrong?

Followed the instructions carefully (django 1.10 - version). Running in 
virtualenv with python 3.5.2 and django 1.10.6 on Ubuntu 16.04.
Did follow an advice in this group and added the polls app in settings.py, 
but it did not help. Nothing else is changed in the autosettings from a 
fresh install of django 10.1.6.

Is this a python problem or an OS problem?

Here is my code:

# Your first view: opprettet polls/urls.py

from django.conf.urls import url

from . import views

urlpatterns = [
url(r'ˆ$', views.index, name='index'),
]

# Your first view polls/views.py

from django.http import HttpResponse

def index(request):
return HttpResponse("Hoppla, polls index her..")

# Site/urls.py

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'ˆpolls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
# Site/settings.py
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls.apps.PollsConfig',
  


-- 
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/76f99629-e329-4e7a-9221-eb15244f2685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-15 Thread Dário Carvalho
Yeah, was that.

2017-02-14 17:32 GMT-02:00 Alexis Carmona :

> Hey, I checked your code on githubt and i think that you missed yo import
> your views in your urls file
>
> El lunes, 6 de febrero de 2017, 17:12:30 (UTC-4), Philip escribió:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation,
>> and I am confused as to why my url is not working. I have the most recent
>> versions of django and python (the ones that the tutorial says to use) and
>> I believe my file structure is correct, you can see it on
>> https://github.com/philipkiely/docexample to verify. However, I get a
>> 404 error when I try localhost:8000/polls/, where the documentation
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/d45I92r6cCo/unsubscribe.
> To unsubscribe from this group and all its topics, 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/31b1f171-cf30-49dd-9c06-02d5d4f691de%40googlegroups.com
> 
> .
>
> 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/CAN%3Du3d%3Dzwb62XWZ0CpJU29om05F9axvsVBstY-oyi81FD0Lbkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-14 Thread Alexis Carmona
Hey, I checked your code on githubt and i think that you missed yo import 
your views in your urls file

El lunes, 6 de febrero de 2017, 17:12:30 (UTC-4), Philip escribió:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/31b1f171-cf30-49dd-9c06-02d5d4f691de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-14 Thread Dário Carvalho
I'm seeing your post only know. Sorry. In deed I used 127.0.0.1:8000
without the /polls when I first ran the server. When I tried with the
/polls could finally see the page.

2017-02-07 11:18 GMT-02:00 Gerald Brown :

> Have you tried using "127.0.0.1" instead of "localhost"?  I had a similar
> problem when I used "localhost"
>
> On Tuesday, February 7, 2017 at 5:12:30 AM UTC+8, Philip wrote:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation,
>> and I am confused as to why my url is not working. I have the most recent
>> versions of django and python (the ones that the tutorial says to use) and
>> I believe my file structure is correct, you can see it on
>> https://github.com/philipkiely/docexample to verify. However, I get a
>> 404 error when I try localhost:8000/polls/, where the documentation
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/d45I92r6cCo/unsubscribe.
> To unsubscribe from this group and all its topics, 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/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com
> 
> .
>
> 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/CAN%3Du3dm5qEvycaehu8i5k5kEe4fYPDfeUbwvvM%3DhYA_8ahCwwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-07 Thread Gerald Brown
Have you tried using "127.0.0.1" instead of "localhost"?  I had a similar 
problem when I used "localhost" 

On Tuesday, February 7, 2017 at 5:12:30 AM UTC+8, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/19dbc28b-c01e-4398-bd44-d6dd7ce6f329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Dário Carvalho
You welcome. I'm new in django too.

Em segunda-feira, 6 de fevereiro de 2017 21:47:46 UTC-2, Philip escreveu:
>
> Solved.
>
> On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>

-- 
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/e5ea8473-f14b-4a17-b10c-e769dfa802e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip
Solved.

On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/876a526c-3346-4549-ac99-edaa94c568b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip


On Monday, February 6, 2017 at 3:12:30 PM UTC-6, Philip wrote:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/f900f03f-79fa-431b-8837-43af641ddbfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip
Thanks to the link you posted, I figured it out! I had the url in the wrong 
urls file. Thank you so much!

On Monday, February 6, 2017 at 3:58:48 PM UTC-6, Dário Carvalho wrote:
>
> The "urls.py" at docexample should look like:
>
> """mysite URL Configuration
>
> The `urlpatterns` list routes URLs to views. For more information please 
> see:
> https://docs.djangoproject.com/en/1.10/topics/http/urls/
> Examples:
> Function views
> 1. Add an import:  from my_app import views
> 2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
> Class-based views
> 1. Add an import:  from other_app.views import Home
> 2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
> Including another URLconf
> 1. Import the include() function: from django.conf.urls import url, 
> include
> 2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
> """
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
>
> I think it's going to work now.
>
> Em segunda-feira, 6 de fevereiro de 2017 19:12:30 UTC-2, Philip escreveu:
>>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>

-- 
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/0dd2a814-45dc-4784-ba43-61584e58b8c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Philip


Not Found: /polls/

[06/Feb/2017 23:34:00] "GET /polls/ HTTP/1.1" 404 1925

Not Found: /polls/

[06/Feb/2017 23:34:01] "GET /polls/ HTTP/1.1" 404 1925


Above is my console output. My run server command is python3 manage.py 
runserver. 
I need to use python3 as the command otherwise it does not work at all.

On Monday, February 6, 2017 at 3:21:59 PM UTC-6, Sergiy Khohlov wrote:
>
> I have not seen  setting.py in your project . Also could you please  send 
> your runserver command  and output 
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
> On Mon, Feb 6, 2017 at 7:49 PM, Philip  
> wrote:
>
>> Hello,
>>
>> I am working through the tutorial included with the django documentation, 
>> and I am confused as to why my url is not working. I have the most recent 
>> versions of django and python (the ones that the tutorial says to use) and 
>> I believe my file structure is correct, you can see it on  
>> https://github.com/philipkiely/docexample to verify. However, I get a 
>> 404 error when I try localhost:8000/polls/, where the documentation 
>> tutorials says that I should be seeing the page that I built.
>>
>> Thank you,
>>
>> Philip
>>
>> -- 
>> 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/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com
>>  
>> 
>> .
>> 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/bac33ef0-dc27-4b5b-83ca-ebcba5f76b98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Dário Carvalho
The "urls.py" at docexample should look like:

"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please 
see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import:  from my_app import views
2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
1. Add an import:  from other_app.views import Home
2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, 
include
2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]

I think it's going to work now.

Em segunda-feira, 6 de fevereiro de 2017 19:12:30 UTC-2, Philip escreveu:
>
> Hello,
>
> I am working through the tutorial included with the django documentation, 
> and I am confused as to why my url is not working. I have the most recent 
> versions of django and python (the ones that the tutorial says to use) and 
> I believe my file structure is correct, you can see it on  
> https://github.com/philipkiely/docexample to verify. However, I get a 404 
> error when I try localhost:8000/polls/, where the documentation tutorials 
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>

-- 
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/3648cd75-b76d-44d8-a0b8-8e628f7553e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django documentation tutorial part 1

2017-02-06 Thread Sergiy Khohlov
I have not seen  setting.py in your project . Also could you please  send
your runserver command  and output

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Feb 6, 2017 at 7:49 PM, Philip  wrote:

> Hello,
>
> I am working through the tutorial included with the django documentation,
> and I am confused as to why my url is not working. I have the most recent
> versions of django and python (the ones that the tutorial says to use) and
> I believe my file structure is correct, you can see it on
> https://github.com/philipkiely/docexample to verify. However, I get a 404
> error when I try localhost:8000/polls/, where the documentation tutorials
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>
> --
> 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/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com
> 
> .
> 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/CADTRxJNHMNZhdG1vdEAJowWX5GL-CPdseBd0%2BNw8F7YxN_ogcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django documentation tutorial part 1

2017-02-06 Thread Philip
Hello,

I am working through the tutorial included with the django documentation, 
and I am confused as to why my url is not working. I have the most recent 
versions of django and python (the ones that the tutorial says to use) and 
I believe my file structure is correct, you can see it on 
 https://github.com/philipkiely/docexample to verify. However, I get a 404 
error when I try localhost:8000/polls/, where the documentation tutorials 
says that I should be seeing the page that I built.

Thank you,

Philip

-- 
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/cd2c6578-2029-484e-96d6-816fe3b16163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re: help with the django tutorial part 1

2016-02-02 Thread Russell Stanfield
yes, that was it, thanks it's running now

On Tuesday, February 2, 2016 at 2:16:45 PM UTC, 林攀 wrote:
>
>  url(r'^/$, views.index, name='index'),
>
>
>
>
>
> --
> *林攀*
>
> At 2016-02-02 20:35:58,"Bipul Raj"  wrote:
>
>   >> url(r'^$, views.index, name='index'),
>
> Are you sure if you have closing single quote with *r'^$* ? I do not see 
> it in error.
>
> On 2 February 2016 at 17:00, Russell Stanfield  > wrote:
>
>> Hi,
>>
>> at this page:
>>
>> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>>
>> I have got this far in the tutorial:
>>
>>
>> In the polls/urls.py file include the following code:
>> polls/urls.py
>>
>> from django.conf.urls import url
>> from . import views
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),]
>>
>> The next step is to point the root URLconf at the polls.urls module. In 
>> mysite/urls.py, add an import for django.conf.urls.include and insert an 
>> include() 
>>  
>> in the urlpatterns list, so you have:
>> mysite/urls.py
>>
>> from django.conf.urls import include, urlfrom django.contrib import admin
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>>
>>
>> You have now wired an index view into the URLconf. Lets verify it’s
>> working, run the following command:
>>
>> $ python manage.py runserver
>>
>> When I try to start the server I get the following output:
>>
>>
>> root@russellberrypi:/home/mycode/mysite# python manage.py 
>> 
>>  
>> runserver
>> Performing system checks...
>>
>> Unhandled exception in thread started by 
>> Traceback (most recent call last):
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line 
>> 226, in wrapper
>> fn(*args, **kwargs)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>>  
>> line 116, in inner_run
>> self.check(display_num_errors=True)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>> line 426, in check
>> include_deployment_checks=include_deployment_checks,
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", 
>> line 75, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 
>> 10, in check_url_config
>> return check_resolver(resolver)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 
>> 19, in check_resolver
>> for pattern in resolver.url_patterns:
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 
>> 33, in __get__
>> res = instance.__dict__[self.name 
>> ]
>>  
>> = self.func(instance)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
>> 417, in url_patterns
>> patterns = getattr(self.urlconf_module, "urlpatterns", 
>> self.urlconf_module)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 
>> 33, in __get__
>> res = instance.__dict__[self.name 
>> ]
>>  
>> = self.func(instance)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
>> 410, in urlconf_module
>> return import_module(self.urlconf_name)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/mysite/urls.py", line 20, in 
>> url(r'^polls/', include('polls.urls')),
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 
>> 52, in include
>> urlconf_module = import_module(urlconf_module)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/polls/urls.py", line 8
>> url(r'^$, views.index, name='index'),
>>  ^
>> SyntaxError: invalid syntax
>>
>>
>>
>> I think all the files  I have created/edited look good, but can put them 
>> up here if required
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django 

Re: Re: help with the django tutorial part 1

2016-02-02 Thread Sergiy Khohlov
 SHould be

 url(r'^$', views.index , name='index')


 you have missed  '

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Feb 2, 2016 at 3:58 PM, 林攀 <18610710...@163.com> wrote:

>  url(r'^/$, views.index, name='index'),
>
>
>
>
>
> --
> *林攀*
>
> At 2016-02-02 20:35:58,"Bipul Raj"  wrote:
>
>   >> url(r'^$, views.index, name='index'),
>
> Are you sure if you have closing single quote with *r'^$* ? I do not see
> it in error.
>
> On 2 February 2016 at 17:00, Russell Stanfield <
> russell.stanfi...@gmail.com> wrote:
>
>> Hi,
>>
>> at this page:
>>
>> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>>
>> I have got this far in the tutorial:
>>
>>
>> In the polls/urls.py file include the following code:
>> polls/urls.py
>>
>> from django.conf.urls import url
>> from . import views
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),]
>>
>> The next step is to point the root URLconf at the polls.urls module. In
>> mysite/urls.py, add an import for django.conf.urls.include and insert an
>> include()
>> 
>> in the urlpatterns list, so you have:
>> mysite/urls.py
>>
>> from django.conf.urls import include, urlfrom django.contrib import admin
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>>
>>
>> You have now wired an index view into the URLconf. Lets verify it’s
>> working, run the following command:
>>
>> $ python manage.py runserver
>>
>> When I try to start the server I get the following output:
>>
>>
>> root@russellberrypi:/home/mycode/mysite# python manage.py
>> 
>> runserver
>> Performing system checks...
>>
>> Unhandled exception in thread started by 
>> Traceback (most recent call last):
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line
>> 226, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>> line 116, in inner_run
>> self.check(display_num_errors=True)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 426, in check
>> include_deployment_checks=include_deployment_checks,
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py",
>> line 75, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
>> 10, in check_url_config
>> return check_resolver(resolver)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
>> 19, in check_resolver
>> for pattern in resolver.url_patterns:
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
>> 33, in __get__
>> res = instance.__dict__[self.name
>> ]
>> = self.func(instance)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
>> 417, in url_patterns
>> patterns = getattr(self.urlconf_module, "urlpatterns",
>> self.urlconf_module)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
>> 33, in __get__
>> res = instance.__dict__[self.name
>> ]
>> = self.func(instance)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
>> 410, in urlconf_module
>> return import_module(self.urlconf_name)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/mysite/urls.py", line 20, in 
>> url(r'^polls/', include('polls.urls')),
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line
>> 52, in include
>> urlconf_module = import_module(urlconf_module)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/polls/urls.py", line 8
>> url(r'^$, views.index, name='index'),
>>  ^
>> SyntaxError: invalid syntax
>>
>>
>>
>> I think all the files  I have created/edited look good, but can put them
>> up here if required
>>
>>
>>
>> --
>> You received this message because you are 

Re:Re: help with the django tutorial part 1

2016-02-02 Thread 林攀
 url(r'^/$, views.index, name='index'),






--

林攀

At 2016-02-02 20:35:58,"Bipul Raj"  wrote:

  >> url(r'^$, views.index, name='index'),


Are you sure if you have closing single quote with r'^$ ? I do not see it in 
error.


On 2 February 2016 at 17:00, Russell Stanfield  
wrote:

Hi,

at this page:

https://docs.djangoproject.com/en/1.9/intro/tutorial01/

I have got this far in the tutorial:




In the polls/urls.py file include the following code:

polls/urls.py
fromdjango.conf.urlsimporturlfrom.importviewsurlpatterns=[url(r'^$',views.index,name='index'),]

The next step is to point the root URLconf at the polls.urls module. In 
mysite/urls.py, add an import for django.conf.urls.include and insert an 
include() in the urlpatterns list, so you have:

mysite/urls.py
fromdjango.conf.urlsimportinclude,urlfromdjango.contribimportadminurlpatterns=[url(r'^polls/',include('polls.urls')),url(r'^admin/',admin.site.urls),


You have now wired an index view into the URLconf. Lets verify it’s
working, run the following command:

$ python manage.py runserver

When I try to start the server I get the following output:



root@russellberrypi:/home/mycode/mysite# python manage.py runserver
Performing system checks...

Unhandled exception in thread started by 
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", 
line 226, in wrapper
fn(*args, **kwargs)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
 line 116, in inner_run
self.check(display_num_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 426, in check
include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", 
line 75, in run_checks
new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", 
line 10, in check_url_config
return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", 
line 19, in check_resolver
for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", 
line 33, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", 
line 417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", 
line 33, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", 
line 410, in urlconf_module
return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/home/mycode/mysite/mysite/urls.py", line 20, in 
url(r'^polls/', include('polls.urls')),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", 
line 52, in include
urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/home/mycode/mysite/polls/urls.py", line 8
url(r'^$, views.index, name='index'),
 ^
SyntaxError: invalid syntax







I think all the files  I have created/edited look good, but can put them up 
here if required







--
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/643917c9-17f7-4e0c-aed0-df8ab1e9f831%40googlegroups.com.
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/CAHHn46TrWi6v4o2-8LwQj6PgwMwVpftAzx3QkoLZoxGhtcdTAw%40mail.gmail.com.
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 

Re: help with the django tutorial part 1

2016-02-02 Thread Bipul Raj
  >> url(r'^$, views.index, name='index'),

Are you sure if you have closing single quote with *r'^$* ? I do not see it
in error.

On 2 February 2016 at 17:00, Russell Stanfield 
wrote:

> Hi,
>
> at this page:
>
> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>
> I have got this far in the tutorial:
>
>
> In the polls/urls.py file include the following code:
> polls/urls.py
>
> from django.conf.urls import url
> from . import views
> urlpatterns = [
> url(r'^$', views.index, name='index'),]
>
> The next step is to point the root URLconf at the polls.urls module. In
> mysite/urls.py, add an import for django.conf.urls.include and insert an
> include()
> 
> in the urlpatterns list, so you have:
> mysite/urls.py
>
> from django.conf.urls import include, urlfrom django.contrib import admin
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
>
>
> You have now wired an index view into the URLconf. Lets verify it’s
> working, run the following command:
>
> $ python manage.py runserver
>
> When I try to start the server I get the following output:
>
>
> root@russellberrypi:/home/mycode/mysite# python manage.py
> 
> runserver
> Performing system checks...
>
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line
> 226, in wrapper
> fn(*args, **kwargs)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
> line 116, in inner_run
> self.check(display_num_errors=True)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 426, in check
> include_deployment_checks=include_deployment_checks,
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py",
> line 75, in run_checks
> new_errors = check(app_configs=app_configs)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
> 10, in check_url_config
> return check_resolver(resolver)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
> 19, in check_resolver
> for pattern in resolver.url_patterns:
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
> 33, in __get__
> res = instance.__dict__[self.name
> ]
> = self.func(instance)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
> 417, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
> 33, in __get__
> res = instance.__dict__[self.name
> ]
> = self.func(instance)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
> 410, in urlconf_module
> return import_module(self.urlconf_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
> import_module
> __import__(name)
>   File "/home/mycode/mysite/mysite/urls.py", line 20, in 
> url(r'^polls/', include('polls.urls')),
>   File
> "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line
> 52, in include
> urlconf_module = import_module(urlconf_module)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
> import_module
> __import__(name)
>   File "/home/mycode/mysite/polls/urls.py", line 8
> url(r'^$, views.index, name='index'),
>  ^
> SyntaxError: invalid syntax
>
>
>
> I think all the files  I have created/edited look good, but can put them
> up here if required
>
>
>
> --
> 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
> 

help with the django tutorial part 1

2016-02-02 Thread Russell Stanfield
Hi,

at this page:

https://docs.djangoproject.com/en/1.9/intro/tutorial01/

I have got this far in the tutorial:


In the polls/urls.py file include the following code:
polls/urls.py

from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),]

The next step is to point the root URLconf at the polls.urls module. In 
mysite/urls.py, add an import for django.conf.urls.include and insert an 
include() 
 
in the urlpatterns list, so you have:
mysite/urls.py

from django.conf.urls import include, urlfrom django.contrib import admin
urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),


You have now wired an index view into the URLconf. Lets verify it’s
working, run the following command:

$ python manage.py runserver

When I try to start the server I get the following output:


root@russellberrypi:/home/mycode/mysite# python manage.py 

 
runserver
Performing system checks...

Unhandled exception in thread started by 
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", 
line 226, in wrapper
fn(*args, **kwargs)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
 
line 116, in inner_run
self.check(display_num_errors=True)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 426, in check
include_deployment_checks=include_deployment_checks,
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", 
line 75, in run_checks
new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", 
line 10, in check_url_config
return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", 
line 19, in check_resolver
for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", 
line 33, in __get__
res = instance.__dict__[self.name 
]
 
= self.func(instance)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", 
line 33, in __get__
res = instance.__dict__[self.name 
]
 
= self.func(instance)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
410, in urlconf_module
return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/home/mycode/mysite/mysite/urls.py", line 20, in 
url(r'^polls/', include('polls.urls')),
  File 
"/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 
52, in include
urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/home/mycode/mysite/polls/urls.py", line 8
url(r'^$, views.index, name='index'),
 ^
SyntaxError: invalid syntax



I think all the files  I have created/edited look good, but can put them up 
here if required



-- 
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/643917c9-17f7-4e0c-aed0-df8ab1e9f831%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-02-01 Thread sum abiut
Yes it could be how you have set up your directories. You could try

from django.conf.urls import include, url
from django.contrib import admin
from myproject.polls import views

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]




On Mon, Feb 1, 2016 at 11:38 PM, jfragos via Django users <
django-users@googlegroups.com> wrote:

> Is it possible that that the way the sys and user paths are set up can
> cause this problem.  When I used the command prompt of python from the
> python directory I received the error, however, when I changed the
> directory to c:\djangoprojects\mysite\polls and then imported views it
> worked fine.
>
>
> On Sunday, January 31, 2016 at 6:18:10 PM UTC-5, suabiut wrote:
>
>> What is your app name? are you sure the name is polls??. The solution i
>> mention works.
>>
>> On Mon, Feb 1, 2016 at 9:32 AM, jfragos via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> I tried your solution and had the same results
>>>
>>> from django.conf.urls import include, url
>>> from django.contrib import admin
>>> from polls import views
>>>
>>> urlpatterns = [
>>> url(r'^polls/', include('polls.urls')),
>>> url(r'^admin/', admin.site.urls),
>>> ]
>>>
>>> RESULTS
>>> Traceback (most recent call last):
>>>   File "urls.py", line 18, in 
>>> from polls import views
>>> ImportError: No module named 'polls'
>>> Press any key to continue . . .
>>>
>>>
>>>
>>> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com
>>> wrote:
>>>
>>>> Hi,
>>>> I am very new to Python and Django but not to programming. I have
>>>> been programming for 30 years. That said I am trying to work my way thru
>>>> the Django tutorial part 1 and I am confronted with the following error I
>>>> can't get past:
>>>> Traceback (most recent call last):
>>>>   File "urls.py", line 3, in 
>>>> from . import views
>>>> SystemError: Parent module '' not loaded, cannot perform relative import
>>>> Press any key to continue . . .
>>>>
>>>> I'm sure you will request additional information but at this point I'm
>>>> not sure what you will want to see.  I will post whatever you require.I
>>>> have started over 3 times with the same results.  I believe I have followed
>>>> the steps faithfully and I have setup the directory structures as you
>>>> direct.  I didn't change anything. I'm running python 3.5.1 and Django
>>>> 1.9.1.
>>>>
>>>> I would appreciate any help getting thru this as its becoming very
>>>> frustrating
>>>>
>>>> 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...@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/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com?utm_medium=email_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/0f60327d-9418-4084-8efd-c91ca1474f38%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0f60327d-9418-4084-8efd-c91ca1474f38%40googlegroups.com?utm_medium=email_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/CAPCf-y7p%3Dhr34j_xfSHJBx%2BvVYKha-LTCGH2YtaBVPgq5T%2BQeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-02-01 Thread jfragos via Django users
Is it possible that that the way the sys and user paths are set up can 
cause this problem.  When I used the command prompt of python from the 
python directory I received the error, however, when I changed the 
directory to c:\djangoprojects\mysite\polls and then imported views it 
worked fine. 


On Sunday, January 31, 2016 at 6:18:10 PM UTC-5, suabiut wrote:

> What is your app name? are you sure the name is polls??. The solution i 
> mention works.
>
> On Mon, Feb 1, 2016 at 9:32 AM, jfragos via Django users <
> django...@googlegroups.com > wrote:
>
>> I tried your solution and had the same results
>>
>> from django.conf.urls import include, url
>> from django.contrib import admin
>> from polls import views
>>
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>>
>> RESULTS
>> Traceback (most recent call last):
>>   File "urls.py", line 18, in 
>> from polls import views
>> ImportError: No module named 'polls'
>> Press any key to continue . . .
>>
>>
>>
>> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:
>>
>>> Hi,
>>> I am very new to Python and Django but not to programming. I have 
>>> been programming for 30 years. That said I am trying to work my way thru 
>>> the Django tutorial part 1 and I am confronted with the following error I 
>>> can't get past:
>>> Traceback (most recent call last):
>>>   File "urls.py", line 3, in 
>>> from . import views
>>> SystemError: Parent module '' not loaded, cannot perform relative import
>>> Press any key to continue . . .
>>>
>>> I'm sure you will request additional information but at this point I'm 
>>> not sure what you will want to see.  I will post whatever you require.I 
>>> have started over 3 times with the same results.  I believe I have followed 
>>> the steps faithfully and I have setup the directory structures as you 
>>> direct.  I didn't change anything. I'm running python 3.5.1 and Django 
>>> 1.9.1. 
>>>
>>> I would appreciate any help getting thru this as its becoming very 
>>> frustrating
>>>
>>> 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...@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/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com?utm_medium=email_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/0f60327d-9418-4084-8efd-c91ca1474f38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread sum abiut
What is your app name? are you sure the name is polls??. The solution i
mention works.

On Mon, Feb 1, 2016 at 9:32 AM, jfragos via Django users <
django-users@googlegroups.com> wrote:

> I tried your solution and had the same results
>
> from django.conf.urls import include, url
> from django.contrib import admin
> from polls import views
>
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
>
> RESULTS
> Traceback (most recent call last):
>   File "urls.py", line 18, in 
> from polls import views
> ImportError: No module named 'polls'
> Press any key to continue . . .
>
>
>
> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:
>
>> Hi,
>> I am very new to Python and Django but not to programming. I have
>> been programming for 30 years. That said I am trying to work my way thru
>> the Django tutorial part 1 and I am confronted with the following error I
>> can't get past:
>> Traceback (most recent call last):
>>   File "urls.py", line 3, in 
>> from . import views
>> SystemError: Parent module '' not loaded, cannot perform relative import
>> Press any key to continue . . .
>>
>> I'm sure you will request additional information but at this point I'm
>> not sure what you will want to see.  I will post whatever you require.I
>> have started over 3 times with the same results.  I believe I have followed
>> the steps faithfully and I have setup the directory structures as you
>> direct.  I didn't change anything. I'm running python 3.5.1 and Django
>> 1.9.1.
>>
>> I would appreciate any help getting thru this as its becoming very
>> frustrating
>>
>> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com?utm_medium=email_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/CAPCf-y5-vu-_OfyLtO0Kyzny29_1xFGhWqPDqeiWP3OAAdX_NA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread jfragos via Django users
I tried your solution and had the same results

from django.conf.urls import include, url
from django.contrib import admin
from polls import views

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]

RESULTS
Traceback (most recent call last):
  File "urls.py", line 18, in 
from polls import views
ImportError: No module named 'polls'
Press any key to continue . . .



On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:

> Hi,
> I am very new to Python and Django but not to programming. I have 
> been programming for 30 years. That said I am trying to work my way thru 
> the Django tutorial part 1 and I am confronted with the following error I 
> can't get past:
> Traceback (most recent call last):
>   File "urls.py", line 3, in 
> from . import views
> SystemError: Parent module '' not loaded, cannot perform relative import
> Press any key to continue . . .
>
> I'm sure you will request additional information but at this point I'm not 
> sure what you will want to see.  I will post whatever you require.I have 
> started over 3 times with the same results.  I believe I have followed the 
> steps faithfully and I have setup the directory structures as you direct.  
> I didn't change anything. I'm running python 3.5.1 and Django 1.9.1. 
>
> I would appreciate any help getting thru this as its becoming very 
> frustrating
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71ee26a4-3d68-46c2-97d4-16cf19976aa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread sum abiut
ighted in yellow the places where they reside.  I have
>>> also attached the outer directory structure showing c:\djangoprojects and
>>> also a shot of the mysite structure.  I set this up as per the tutorial
>>> instructions or so I think I did.
>>>
>>> mysite--->polls--->urls.py
>>>
>>> from django.conf.urls import url
>>>
>>> from . import views
>>> urlpatterns = [
>>> url(r'^$', views.index, name='index'),
>>> ]
>>>
>>>
>>> *mysite--->mysite--->urls.py*
>>>
>>> from django.conf.urls import include, url
>>> from django.contrib import admin
>>> urlpatterns = [
>>> url(r'^polls/', include('polls.urls')),
>>> url(r'^admin/', admin.site.urls),
>>> ]
>>>
>>>
>>> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com
>>> wrote:
>>>
>>>> Hi,
>>>> I am very new to Python and Django but not to programming. I have
>>>> been programming for 30 years. That said I am trying to work my way thru
>>>> the Django tutorial part 1 and I am confronted with the following error I
>>>> can't get past:
>>>> Traceback (most recent call last):
>>>>   File "urls.py", line 3, in 
>>>> from . import views
>>>> SystemError: Parent module '' not loaded, cannot perform relative import
>>>> Press any key to continue . . .
>>>>
>>>> I'm sure you will request additional information but at this point I'm
>>>> not sure what you will want to see.  I will post whatever you require.I
>>>> have started over 3 times with the same results.  I believe I have followed
>>>> the steps faithfully and I have setup the directory structures as you
>>>> direct.  I didn't change anything. I'm running python 3.5.1 and Django
>>>> 1.9.1.
>>>>
>>>> I would appreciate any help getting thru this as its becoming very
>>>> frustrating
>>>>
>>>> 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...@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/1a0609f9-b163-4af7-b331-5cb1464407ff%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/1a0609f9-b163-4af7-b331-5cb1464407ff%40googlegroups.com?utm_medium=email_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/d6939308-e56e-49c7-82df-4b802f48be25%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d6939308-e56e-49c7-82df-4b802f48be25%40googlegroups.com?utm_medium=email_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/CAPCf-y7vxQ%3DTVuwUCrNp6U-E9-Gubq%3DTEzi5A4x9w90wZjv%2B%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread jfragos via Django users
That is something I have tried. When I do it that way and run the program 
there is no error.  However, when I attempt to start the server from the 
command prompt I am presented with the following meesages which ends with 
'Import error: No module named views'

c:\djangoprojects\mysite>python manage.py runserver
Performing system checks...
Unhandled exception in thread started by .wrapper at 0x03A418A0>
Traceback (most recent call last):
  File "C:\Python35\lib\site-packages\django\utils\autoreload.py", line 
226, in wrapper
fn(*args, **kwargs)
  File 
"C:\Python35\lib\site-packages\django\core\management\commands\runserver.py", 
line 116, in inner_run
self.check(display_num_errors=True)
  File "C:\Python35\lib\site-packages\django\core\management\base.py", line 
426, in check
include_deployment_checks=include_deployment_checks,
  File "C:\Python35\lib\site-packages\django\core\checks\registry.py", line 
75, in run_checks
new_errors = check(app_configs=app_configs)
  File "C:\Python35\lib\site-packages\django\core\checks\urls.py", line 10, 
in check_url_config
return check_resolver(resolver)
  File "C:\Python35\lib\site-packages\django\core\checks\urls.py", line 19, 
in check_resolver
for pattern in resolver.url_patterns:
  File "C:\Python35\lib\site-packages\django\utils\functional.py", line 33, 
in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Python35\lib\site-packages\django\core\urlresolvers.py", line 
417, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File "C:\Python35\lib\site-packages\django\utils\functional.py", line 33, 
in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "C:\Python35\lib\site-packages\django\core\urlresolvers.py", line 
410, in urlconf_module
return import_module(self.urlconf_name)
  File "C:\Python35\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in 
_call_with_frames_removed
  File "c:\djangoprojects\mysite\mysite\urls.py", line 20, in 
url(r'^polls/', include('polls.urls')),
  File "C:\Python35\lib\site-packages\django\conf\urls\__init__.py", line 
52, in include
urlconf_module = import_module(urlconf_module)
  File "C:\Python35\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in 
_call_with_frames_removed
  File "c:\djangoprojects\mysite\polls\urls.py", line 3, in 
import views
ImportError: No module named 'views'

 

On Sunday, January 31, 2016 at 12:03:39 PM UTC-5, Avraham Serour wrote:

> please try:
> from polls import views
> or
> import views
>
> On Sun, Jan 31, 2016 at 6:59 PM, jfragos via Django users <
> django...@googlegroups.com > wrote:
>
>> Thank you for the response.  Since there are 2 of them I have posted 
>> both.  I have highlighted in yellow the places where they reside.  I have 
>> also attached the outer directory structure showing c:\djangoprojects and 
>> also a shot of the mysite structure.  I set this up as per the tutorial 
>> instructions or so I think I did.
>>
>> mysite--->polls--->urls.py
>>
>> from django.conf.urls import url
>>
>> from . import views
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),
>> ]
>>
>>
>> *mysite--->mysite--->urls.py*
>>
>> from django.conf.urls import include, url
>> from django.contrib import admin
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>> ]
>>
>>
>> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:
>>
>>> Hi,
>>> I am very new to Python and Django but not to programming. I have 
>>> been programming for 30 years. That said I am trying to work my way thru 
>>> the Django tutorial part 1 and I am confronted with the following error I 
>>> can't get past:
>>> Traceback (most recent call last):
>>>   File "urls.py", line 3, in 
>

Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread Avraham Serour
please try:
from polls import views
or
import views

On Sun, Jan 31, 2016 at 6:59 PM, jfragos via Django users <
django-users@googlegroups.com> wrote:

> Thank you for the response.  Since there are 2 of them I have posted
> both.  I have highlighted in yellow the places where they reside.  I have
> also attached the outer directory structure showing c:\djangoprojects and
> also a shot of the mysite structure.  I set this up as per the tutorial
> instructions or so I think I did.
>
> mysite--->polls--->urls.py
>
> from django.conf.urls import url
>
> from . import views
> urlpatterns = [
> url(r'^$', views.index, name='index'),
> ]
>
>
> *mysite--->mysite--->urls.py*
>
> from django.conf.urls import include, url
> from django.contrib import admin
> urlpatterns = [
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
>
>
> On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:
>
>> Hi,
>> I am very new to Python and Django but not to programming. I have
>> been programming for 30 years. That said I am trying to work my way thru
>> the Django tutorial part 1 and I am confronted with the following error I
>> can't get past:
>> Traceback (most recent call last):
>>   File "urls.py", line 3, in 
>> from . import views
>> SystemError: Parent module '' not loaded, cannot perform relative import
>> Press any key to continue . . .
>>
>> I'm sure you will request additional information but at this point I'm
>> not sure what you will want to see.  I will post whatever you require.I
>> have started over 3 times with the same results.  I believe I have followed
>> the steps faithfully and I have setup the directory structures as you
>> direct.  I didn't change anything. I'm running python 3.5.1 and Django
>> 1.9.1.
>>
>> I would appreciate any help getting thru this as its becoming very
>> frustrating
>>
>> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1a0609f9-b163-4af7-b331-5cb1464407ff%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1a0609f9-b163-4af7-b331-5cb1464407ff%40googlegroups.com?utm_medium=email_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/CAFWa6tK6VfxVnzTNmGO%2BfHKazz-wXA7_k_kgFE8P0ymWcSZxcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread jfragos via Django users
Thank you for the response.  Since there are 2 of them I have posted both.  
I have highlighted in yellow the places where they reside.  I have also 
attached the outer directory structure showing c:\djangoprojects and also a 
shot of the mysite structure.  I set this up as per the tutorial 
instructions or so I think I did.

mysite--->polls--->urls.py

from django.conf.urls import url

from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
]


*mysite--->mysite--->urls.py*

from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]


On Sunday, January 31, 2016 at 10:07:21 AM UTC-5, jfr...@yahoo.com wrote:

> Hi,
> I am very new to Python and Django but not to programming. I have 
> been programming for 30 years. That said I am trying to work my way thru 
> the Django tutorial part 1 and I am confronted with the following error I 
> can't get past:
> Traceback (most recent call last):
>   File "urls.py", line 3, in 
> from . import views
> SystemError: Parent module '' not loaded, cannot perform relative import
> Press any key to continue . . .
>
> I'm sure you will request additional information but at this point I'm not 
> sure what you will want to see.  I will post whatever you require.I have 
> started over 3 times with the same results.  I believe I have followed the 
> steps faithfully and I have setup the directory structures as you direct.  
> I didn't change anything. I'm running python 3.5.1 and Django 1.9.1. 
>
> I would appreciate any help getting thru this as its becoming very 
> frustrating
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1a0609f9-b163-4af7-b331-5cb1464407ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tutorial part 1 Parent module not loaded

2016-01-31 Thread Avraham Serour
can you post your urls.py

On Sun, Jan 31, 2016 at 5:04 PM, jfragos via Django users <
django-users@googlegroups.com> wrote:

> Hi,
> I am very new to Python and Django but not to programming. I have
> been programming for 30 years. That said I am trying to work my way thru
> the Django tutorial part 1 and I am confronted with the following error I
> can't get past:
> Traceback (most recent call last):
>   File "urls.py", line 3, in 
> from . import views
> SystemError: Parent module '' not loaded, cannot perform relative import
> Press any key to continue . . .
>
> I'm sure you will request additional information but at this point I'm not
> sure what you will want to see.  I will post whatever you require.I have
> started over 3 times with the same results.  I believe I have followed the
> steps faithfully and I have setup the directory structures as you direct.
> I didn't change anything. I'm running python 3.5.1 and Django 1.9.1.
>
> I would appreciate any help getting thru this as its becoming very
> frustrating
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/73123987-7654-41b7-b01b-a3d54194ec0b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/73123987-7654-41b7-b01b-a3d54194ec0b%40googlegroups.com?utm_medium=email_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/CAFWa6tKiOrESNhPbgVz1xcEaCKz5PWevvUNZ_G9K3n4a5jza%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tutorial part 1 Parent module not loaded

2016-01-31 Thread jfragos via Django users
Hi,
I am very new to Python and Django but not to programming. I have 
been programming for 30 years. That said I am trying to work my way thru 
the Django tutorial part 1 and I am confronted with the following error I 
can't get past:
Traceback (most recent call last):
  File "urls.py", line 3, in 
from . import views
SystemError: Parent module '' not loaded, cannot perform relative import
Press any key to continue . . .

I'm sure you will request additional information but at this point I'm not 
sure what you will want to see.  I will post whatever you require.I have 
started over 3 times with the same results.  I believe I have followed the 
steps faithfully and I have setup the directory structures as you direct.  
I didn't change anything. I'm running python 3.5.1 and Django 1.9.1. 

I would appreciate any help getting thru this as its becoming very 
frustrating

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/73123987-7654-41b7-b01b-a3d54194ec0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: FieldDoesNotExist Error in Tutorial Part 1

2014-11-19 Thread Adailton Nascimento
Use:
import datetime


class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField(auto_now=True)
 
class Meta:
   ordering = ['-pub_date']


def __str__(self):
   return self.question_text




delete all objects of your paste migrates. and run: PS:[for this option must 
delete the db]= python manage.py syncdb or use: makemigrations and then migrate 
.


Att;

Adailton do nascimento

-- 
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/85fcfbf4-e4d9-4ad0-8f40-7790a0dc9752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


FieldDoesNotExist Error in Tutorial Part 1

2014-11-18 Thread Derek Ng
Hi,

I'm am trying to follow along with the tutorial, but keep getting this 
error when I migrate the models. Here is my models.py file for the polls 
app:

from django.db import models

class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)


Then, when I use the makemigrations and migrate commands, I get this error:


Operations to perform:
  Apply all migrations: auth, admin, sessions, contenttypes, polls
Running migrations:
  Applying polls.0001_initial...Traceback (most recent call last):
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/options.py",
 line 414, in get_field_by_name
return self._name_map[name]
AttributeError: 'Options' object has no attribute '_name_map'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/options.py",
 line 417, in get_field_by_name
return cache[name]
KeyError: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/core/management/__init__.py",
 line 385, in execute_from_command_line
utility.execute()
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/core/management/__init__.py",
 line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/core/management/base.py",
 line 288, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/core/management/base.py",
 line 338, in execute
output = self.handle(*args, **options)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
 line 160, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/migrations/executor.py",
 line 63, in migrate
self.apply_migration(migration, fake=fake)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/migrations/executor.py",
 line 97, in apply_migration
migration.apply(project_state, schema_editor)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/migrations/migration.py",
 line 107, in apply
operation.database_forwards(self.app_label, schema_editor, project_state, 
new_state)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/migrations/operations/fields.py",
 line 37, in database_forwards
field,
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py",
 line 167, in add_field
self._remake_table(model, create_fields=[field])
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py",
 line 128, in _remake_table
self.create_model(temp_model)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/backends/schema.py",
 line 209, in create_model
definition, extra_params = self.column_sql(model, field)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/backends/schema.py",
 line 112, in column_sql
db_params = field.db_parameters(connection=self.connection)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/fields/related.py",
 line 1784, in db_parameters
return {"type": self.db_type(connection), "check": []}
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/fields/related.py",
 line 1775, in db_type
rel_field = self.related_field
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/fields/related.py",
 line 1681, in related_field
return self.foreign_related_fields[0]
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/fields/related.py",
 line 1439, in foreign_related_fields
return tuple(rhs_field for lhs_field, rhs_field in self.related_fields)
  File 
"/Users/derekng/Documents/projects/django-tutorial/lib/python3.4/site-packages/django/db/models/fields/related.py",

Re: Django 1.5 tutorial, part 1

2013-10-12 Thread Brian Schott
Polls not pools?

—
Sent from Mailbox for iPhone

On Sat, Oct 12, 2013 at 12:58 PM, Enrico Battiston
 wrote:

> Hi, i'm a first time user and i'm experiencing an error in the first part 
> of the django 1.5 tutorial.
> At the "Activating models" paragraph when i execute the command line "*python 
> manage.py sql polls*" it return me: "ImportError: No module named pools".
> Here the section INSTALLED_APPS of setting.py:
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> # 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'pools',
> )
> Here the content of models.py:
> from django.db import models
> # Create your models here.
> class Poll(models.Model):
> question = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
> class Choice(models.Model):
> poll = models.ForeignKey(Poll)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
> Here what i've in return if i execute "*python manage.py shell --traceback*
> ":
> Traceback (most recent call last):
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 222, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 250, in execute
> translation.activate('en-us')
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/__init__.py",
>  
> line 90, in activate
> return _trans.activate(language)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 183, in activate
> _active.value = translation(language)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 172, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 154, in _fetch
> app = import_module(appname)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/importlib.py",
>  
> line 35, in import_module
> __import__(name)
> ImportError: No module named pools
> Here  what i've in return for the command line "*django-admin.py version*": 
> "1.5"
> And for the "*python --version*": "Python 2.7.3"
> What to do?
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> 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/35db6d08-f0b1-477a-9f68-1fd32c264878%40googlegroups.com.
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1381603157716.4a343d67%40Nodemailer.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.5 tutorial, part 1

2013-10-12 Thread Enrico Battiston
Thank you, I'm lost in a glass of water.

Il giorno sabato 12 ottobre 2013 19:25:46 UTC+2, Vernon D. Cole ha scritto:
>
> You have a spelling error in INSTALLED_APPS:  "pools" vs "polls".  You 
> want a survey, not a puddle of water.
> (This could be caused by an overly aggressive spelling corrector on your 
> computer.)
> --
> Vernon
>
> On Saturday, October 12, 2013 10:41:11 AM UTC-6, Enrico Battiston wrote:
>>
>> Hi, i'm a first time user and i'm experiencing an error in the first part 
>> of the django 1.5 tutorial.
>> At the "Activating models" paragraph when i execute the command line 
>> "*python 
>> manage.py sql polls*" it return me: "ImportError: No module named pools".
>> Here the section INSTALLED_APPS of setting.py:
>>
>> INSTALLED_APPS = (
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> # Uncomment the next line to enable the admin:
>> # 'django.contrib.admin',
>> # Uncomment the next line to enable admin documentation:
>> # 'django.contrib.admindocs',
>> 'pools',
>> )
>>
>> Here the content of models.py:
>>
>> from django.db import models
>>
>> # Create your models here.
>> class Poll(models.Model):
>> question = models.CharField(max_length=200)
>> pub_date = models.DateTimeField('date published')
>>
>> class Choice(models.Model):
>> poll = models.ForeignKey(Poll)
>> choice_text = models.CharField(max_length=200)
>> votes = models.IntegerField(default=0)
>>
>> Here what i've in return if i execute "*python manage.py shell 
>> --traceback*":
>>
>> Traceback (most recent call last):
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 222, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 250, in execute
>> translation.activate('en-us')
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/__init__.py",
>>  
>> line 90, in activate
>> return _trans.activate(language)
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>>  
>> line 183, in activate
>> _active.value = translation(language)
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>>  
>> line 172, in translation
>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>>  
>> line 154, in _fetch
>> app = import_module(appname)
>>   File 
>> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/importlib.py",
>>  
>> line 35, in import_module
>> __import__(name)
>> ImportError: No module named pools
>>
>> Here  what i've in return for the command line "*django-admin.py version*": 
>> "1.5"
>> And for the "*python --version*": "Python 2.7.3"
>>
>> What to do?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
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/a6b1f2bd-2134-439e-a6a7-d1ff377836d1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django 1.5 tutorial, part 1

2013-10-12 Thread Vernon D. Cole
You have a spelling error in INSTALLED_APPS:  "pools" vs "polls".  You want 
a survey, not a puddle of water.
(This could be caused by an overly aggressive spelling corrector on your 
computer.)
--
Vernon

On Saturday, October 12, 2013 10:41:11 AM UTC-6, Enrico Battiston wrote:
>
> Hi, i'm a first time user and i'm experiencing an error in the first part 
> of the django 1.5 tutorial.
> At the "Activating models" paragraph when i execute the command line "*python 
> manage.py sql polls*" it return me: "ImportError: No module named pools".
> Here the section INSTALLED_APPS of setting.py:
>
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> # Uncomment the next line to enable the admin:
> # 'django.contrib.admin',
> # Uncomment the next line to enable admin documentation:
> # 'django.contrib.admindocs',
> 'pools',
> )
>
> Here the content of models.py:
>
> from django.db import models
>
> # Create your models here.
> class Poll(models.Model):
> question = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
> poll = models.ForeignKey(Poll)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
> Here what i've in return if i execute "*python manage.py shell --traceback
> *":
>
> Traceback (most recent call last):
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 222, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 250, in execute
> translation.activate('en-us')
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/__init__.py",
>  
> line 90, in activate
> return _trans.activate(language)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 183, in activate
> _active.value = translation(language)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 172, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
>  
> line 154, in _fetch
> app = import_module(appname)
>   File 
> "/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/importlib.py",
>  
> line 35, in import_module
> __import__(name)
> ImportError: No module named pools
>
> Here  what i've in return for the command line "*django-admin.py version*": 
> "1.5"
> And for the "*python --version*": "Python 2.7.3"
>
> What to do?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
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/608a2ef0-64ea-4c77-9048-4f67307b9688%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django 1.5 tutorial, part 1

2013-10-12 Thread Enrico Battiston
Hi, i'm a first time user and i'm experiencing an error in the first part 
of the django 1.5 tutorial.
At the "Activating models" paragraph when i execute the command line "*python 
manage.py sql polls*" it return me: "ImportError: No module named pools".
Here the section INSTALLED_APPS of setting.py:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'pools',
)

Here the content of models.py:

from django.db import models

# Create your models here.
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)

Here what i've in return if i execute "*python manage.py shell --traceback*
":

Traceback (most recent call last):
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
 
line 222, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/core/management/base.py",
 
line 250, in execute
translation.activate('en-us')
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/__init__.py",
 
line 90, in activate
return _trans.activate(language)
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 183, in activate
_active.value = translation(language)
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 172, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 154, in _fetch
app = import_module(appname)
  File 
"/Users/enricobattiston/Library/Containers/com.bitnami.django/Data/app/apps/django/lib/python2.7/site-packages/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
ImportError: No module named pools

Here  what i've in return for the command line "*django-admin.py version*": 
"1.5"
And for the "*python --version*": "Python 2.7.3"

What to do?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
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/35db6d08-f0b1-477a-9f68-1fd32c264878%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django tutorial part 1 (Using the api, p.choice_set.all() displays choices in reverse order)

2013-06-18 Thread Dandall Von
Thanks for succinctly educating me on this matter.  I thought it was a 
quirk but now I know.

On Tuesday, June 18, 2013 5:11:07 AM UTC-7, Jani Tiainen wrote:
>
> On Mon, 17 Jun 2013 21:34:00 -0700 (PDT) 
> Dandall Von <dukn...@gmail.com > wrote: 
>
> > I have successfully setup Django with postgreSQL and everything is fine 
> > except for a minor problem. 
> > 
> > One the very last section of the the tutorial part 1 where we type 
> > p.pchoice_set.all(), it displays the 
> > choices in the reverse order.   
> > 
> > For example I get: Just hacking again, The sky, Not much 
> > Instead of: Not much, The sky, Just hacking again 
> > 
> > I typed it in the order it shows and still I get a reverse order. 
> > 
> > Any ideas? 
>
> That is how databases do work. 
>
> Default ordering is "no ordering". So you get results in no particular 
> order. 
>
> To have consistent fixed ordering you need to tell it somehow to database 
> backend, in Django it's done by .order_by() [1] 
>
> And then you have to select field you sort by. In case of tutorial there 
> is not actually any good field to sort by in Choice-model. 
>
>
> [1] https://docs.djangoproject.com/en/1.5/ref/models/querysets/#order-by 
> -- 
>
> Jani Tiainen 
>
> "Impossible just takes a little longer" 
>
>

-- 
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: Django tutorial part 1 (Using the api, p.choice_set.all() displays choices in reverse order)

2013-06-18 Thread Jani Tiainen
On Mon, 17 Jun 2013 21:34:00 -0700 (PDT)
Dandall Von <duknov...@gmail.com> wrote:

> I have successfully setup Django with postgreSQL and everything is fine 
> except for a minor problem.
> 
> One the very last section of the the tutorial part 1 where we type 
> p.pchoice_set.all(), it displays the
> choices in the reverse order.  
> 
> For example I get: Just hacking again, The sky, Not much
> Instead of: Not much, The sky, Just hacking again
> 
> I typed it in the order it shows and still I get a reverse order.
> 
> Any ideas?

That is how databases do work.

Default ordering is "no ordering". So you get results in no particular order.

To have consistent fixed ordering you need to tell it somehow to database 
backend, in Django it's done by .order_by() [1]

And then you have to select field you sort by. In case of tutorial there is not 
actually any good field to sort by in Choice-model.


[1] https://docs.djangoproject.com/en/1.5/ref/models/querysets/#order-by
-- 

Jani Tiainen

"Impossible just takes a little longer"

-- 
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.




Django tutorial part 1 (Using the api, p.choice_set.all() displays choices in reverse order)

2013-06-18 Thread Dandall Von
I have successfully setup Django with postgreSQL and everything is fine 
except for a minor problem.

One the very last section of the the tutorial part 1 where we type 
p.pchoice_set.all(), it displays the
choices in the reverse order.  

For example I get: Just hacking again, The sky, Not much
Instead of: Not much, The sky, Just hacking again

I typed it in the order it shows and still I get a reverse order.

Any ideas?

-- 
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: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-17 Thread Ed
Thank you very much, Tom, for pointing that out.

I had no idea django was looking for that environment variable. Following 
your direction, I checked, and discover that they are all indeed default to 
"undefined". I'm using OpenBSD 5.3 on macppc, which explains why they were 
not set, as opposed to on Linux.

$ python -m locale
Locale aliasing:

Locale defaults as determined by getdefaultlocale():

Language:  (undefined)
Encoding:  (undefined)

Locale settings on startup:

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling resetlocale():

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling setlocale(LC_ALL, ""):

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Number formatting:

123456789 is 123456789
3.14 is 3.14
$ 




On Monday, 17 June 2013 04:02:43 UTC-7, Tom Evans wrote:
>
> On Sun, Jun 16, 2013 at 8:06 AM, Ed  
> wrote: 
> > Hello Dear Django Group. 
> > 
> > My first day with Django, I just got it installed on my computer, and am 
> > trying to follow along with the first tutorial: 
> > https://docs.djangoproject.com/en/1.4/intro/tutorial01/ 
> > 
> > I have Django's development server up, and I'm able to see the "It 
> worked!" 
> > Django welcome page. Where I ran into the dead end is at the following 
> > section: 
> > 
> > "The syncdb command looks at the INSTALLED_APPS setting and creates any 
> > necessary database tables according to the database settings in your 
> > settings.py file. You’ll see a message for each database table it 
> creates, 
> > and you’ll get a prompt asking you if you’d like to create a superuser 
> > account for the authentication system. Go ahead and do that." 
> > 
> > Up to this point, I've followed the tutorial line by line. However, 
> after I 
> > ran the command "python manage.py syncdb", I got the error message 
> below, 
> > and it seems to be an internal error to Django. Has anyone else 
> encountered 
> > this issue, and how did you resolve it? Any feedback or insight is 
> > appreciated. Thank you! 
> > 
> > 
> > $ python manage.py syncdb 
> > Creating tables ... 
> > Creating table auth_permission 
> > Creating table auth_group_permissions 
> > Creating table auth_group 
> > Creating table auth_user_user_permissions 
> > Creating table auth_user_groups 
> > Creating table auth_user 
> > Creating table django_content_type 
> > Creating table django_session 
> > Creating table django_site 
> > 
> > You just installed Django's auth system, which means you don't have any 
> > superusers defined. 
> > Would you like to create one now? (yes/no): yes 
> > Traceback (most recent call last): 
> >   File "manage.py", line 10, in  
> > execute_from_command_line(sys.argv) 
> >   File 
> > 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
>
> > line 443, in execute_from_command_line 
> > utility.execute() 
> >   File 
> > 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
>
> > line 382, in execute 
> > self.fetch_command(subcommand).run_from_argv(self.argv) 
> >   File 
> > "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> > line 196, in run_from_argv 
> > self.execute(*args, **options.__dict__) 
> >   File 
> > "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> > line 232, in execute 
> > output = self.handle(*args, **options) 
> >   File 
> > "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> > line 371, in handle 
> > return self.handle_noargs(**options) 
> >   File 
> > 
> 

Re: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-17 Thread Tom Evans
On Sun, Jun 16, 2013 at 8:06 AM, Ed  wrote:
> Hello Dear Django Group.
>
> My first day with Django, I just got it installed on my computer, and am
> trying to follow along with the first tutorial:
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/
>
> I have Django's development server up, and I'm able to see the "It worked!"
> Django welcome page. Where I ran into the dead end is at the following
> section:
>
> "The syncdb command looks at the INSTALLED_APPS setting and creates any
> necessary database tables according to the database settings in your
> settings.py file. You’ll see a message for each database table it creates,
> and you’ll get a prompt asking you if you’d like to create a superuser
> account for the authentication system. Go ahead and do that."
>
> Up to this point, I've followed the tutorial line by line. However, after I
> ran the command "python manage.py syncdb", I got the error message below,
> and it seems to be an internal error to Django. Has anyone else encountered
> this issue, and how did you resolve it? Any feedback or insight is
> appreciated. Thank you!
>
>
> $ python manage.py syncdb
> Creating tables ...
> Creating table auth_permission
> Creating table auth_group_permissions
> Creating table auth_group
> Creating table auth_user_user_permissions
> Creating table auth_user_groups
> Creating table auth_user
> Creating table django_content_type
> Creating table django_session
> Creating table django_site
>
> You just installed Django's auth system, which means you don't have any
> superusers defined.
> Would you like to create one now? (yes/no): yes
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 110, in handle_noargs
> emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", line
> 189, in emit_post_sync_signal
> interactive=interactive, db=db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line
> 172, in send
> response = receiver(signal=self, sender=sender, **named)
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 73, in create_superuser
> call_command("createsuperuser", interactive=True, database=db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> line 70, in handle
> default_username = get_default_username()
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 105, in get_default_username
> default_username = get_system_username()
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 85, in get_system_username
> return getpass.getuser().decode(locale.getdefaultlocale()[1])
> TypeError: decode() argument 1 must be string, not None
> $
>

Look at the final, breaking, line of code in the stack trace:

return getpass.getuser().decode(locale.getdefaultlocale()[1])

The error says that the argument to decode() is None. The argument to
decode() is the 2nd value returned by locale.getdefaultlocale(), which
returns a 2-tuple of (locale, charset), which is determined (on linux)
by examining the value of the environment variable LANG.

If LANG is unset or empty (or the "C" locale) then these values are
undefined. Django relies on these values being defined to understand
input that is given to it.

Set a proper LANG in your environment. Use "python -m locale" to check
what python sees it as. Common values for LANG are like "en_GB.UTF-8"
or "pt_BR.UTF-8".

Cheers

Tom

-- 
You received this message because you are subscribed to the Google 

Re: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-16 Thread gilberto dos santos alves
please see your locale environment var. what is your os (linux, windows, 
mac) please post your files. how you installed your django?

Em domingo, 16 de junho de 2013 04h06min32s UTC-3, Ed escreveu:
>
> Hello Dear Django Group.
>
> My first day with Django, I just got it installed on my computer, and am 
> trying to follow along with the first tutorial: 
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/
>
> I have Django's development server up, and I'm able to see the "It 
> worked!" Django welcome page. Where I ran into the dead end is at the 
> following section:
>
> "The 
> syncdb
>  command looks at the 
> INSTALLED_APPS
>  setting and creates any necessary database tables according to the 
> database settings in your settings.py file. You’ll see a message for each 
> database table it creates, and you’ll get a prompt asking you if you’d like 
> to create a superuser account for the authentication system. Go ahead and 
> do that."
>
> Up to this point, I've followed the tutorial line by line. However, after 
> I ran the command "python manage.py syncdb", I got the error message below, 
> and it seems to be an internal error to Django. Has anyone else encountered 
> this issue, and how did you resolve it? Any feedback or insight is 
> appreciated. Thank you!
>
>
> $ python manage.py syncdb 
>  
> Creating tables ...
> Creating table auth_permission
> Creating table auth_group_permissions
> Creating table auth_group
> Creating table auth_user_user_permissions
> Creating table auth_user_groups
> Creating table auth_user
> Creating table django_content_type
> Creating table django_session
> Creating table django_site
>
> You just installed Django's auth system, which means you don't have any 
> superusers defined.
> Would you like to create one now? (yes/no): yes
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 443, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 232, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 371, in handle
> return self.handle_noargs(**options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>  
> line 110, in handle_noargs
> emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", 
> line 189, in emit_post_sync_signal
> interactive=interactive, db=db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", 
> line 172, in send
> response = receiver(signal=self, sender=sender, **named)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>  
> line 73, in create_superuser
> call_command("createsuperuser", interactive=True, database=db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 232, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
>  
> line 70, in handle
> default_username = get_default_username()
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>  
> line 105, in get_default_username
> default_username = get_system_username()
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
>  
> line 85, in get_system_username
> return getpass.getuser().decode(locale.getdefaultlocale()[1])
> TypeError: decode() argument 1 must be string, not None
> $ 
>
>
>
>

-- 
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, 

Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-16 Thread Ed
Hello Dear Django Group.

My first day with Django, I just got it installed on my computer, and am 
trying to follow along with the first 
tutorial: https://docs.djangoproject.com/en/1.4/intro/tutorial01/

I have Django's development server up, and I'm able to see the "It worked!" 
Django welcome page. Where I ran into the dead end is at the following 
section:

"The 
syncdb
 command looks at the 
INSTALLED_APPS
 setting and creates any necessary database tables according to the 
database settings in your settings.py file. You’ll see a message for each 
database table it creates, and you’ll get a prompt asking you if you’d like 
to create a superuser account for the authentication system. Go ahead and 
do that."

Up to this point, I've followed the tutorial line by line. However, after I 
ran the command "python manage.py syncdb", I got the error message below, 
and it seems to be an internal error to Django. Has anyone else encountered 
this issue, and how did you resolve it? Any feedback or insight is 
appreciated. Thank you!


$ python manage.py syncdb   
   
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site

You just installed Django's auth system, which means you don't have any 
superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 371, in handle
return self.handle_noargs(**options)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
 
line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/sql.py", 
line 189, in emit_post_sync_signal
interactive=interactive, db=db)
  File 
"/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", 
line 172, in send
response = receiver(signal=self, sender=sender, **named)
  File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
 
line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 150, in call_command
return klass.execute(*args, **defaults)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
 
line 70, in handle
default_username = get_default_username()
  File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
 
line 105, in get_default_username
default_username = get_system_username()
  File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
 
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None
$ 



-- 
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: tutorial part 1...syncing db

2012-04-12 Thread Brandy
FINALLY! I used your modifications and adjusted the security settings of 
the directory (twice). And now it works. Thank you everyone for taking the 
time to look at my code!
 
Brandy

On Thursday, April 12, 2012 3:13:58 PM UTC-5, William Ratcliff wrote:

> Hi Brandy,
>
> I downloaded your project modified the beginning to the following:
>
> # Django settings for mysite project.
>
> import os,sys
> HOMEDIR=os.path.dirname(__file__)
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3', # Add 
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': os.path.join(HOMEDIR,'testdb'),  # Or 
> path to database file if using sqlite3.
> 'USER': '',  # Not used with sqlite3.
> 'PASSWORD': '',  # Not used with sqlite3.
> 'HOST': '',  # Set to empty string for 
> localhost. Not used with sqlite3.
> 'PORT': '',  # Set to empty string for 
> default. Not used with sqlite3.
> }
> }
>
> It works under the django 1.4 that I just pulled onto a "virgin" windows 7 
> box. My suspicion is that in your engine file, you wanted to use:
> r'c:/program files/bitnami djangostack/mysite/sqlite3.db'
> instead of:
> 'c:/program files/bitnami djangostack/mysite/sqlite3.db', 
>
> This is assuming that you have read/write permissions to that directory, 
> etc.I prefer the pattern that I used of putting the sqllite database 
> relative to __file__ because it is easier to move it between machines.   
> So, for example, if I develop on a mac (or windows), when I deploy to linux 
> (not so much for the database) for production, I don't have to manipulate 
> the path throughout the code...Later, if I need to find something relative 
> to the project root, I can then do a:
>
> from django.conf import settings
> and grab settings.HOME as the base directory
>
> Best,
> William
> (btw. I placed the directory in c:\mysite for my test
>
> so you have:
> -- denotes a mysite directory
>
>
> c:\mysite
> manage.py
> --mysite
>   __init__.py
>   settings.py
>   testdb
>   urls.py
>   wsgi.py
>
>
> )
>
>
>
> 2012/4/12 Brandy <brandy.norri...@yahoo.com>
>
>> This is the whole directory.
>>  
>>
>> On Thursday, April 12, 2012 2:00:24 PM UTC-5, William Ratcliff wrote:
>>
>>> Can you post your full code somewhere as a zip?
>>>
>>>
>>>
>>> On Thu, Apr 12, 2012 at 2:33 PM, Leonid Toshchev <ltoshc...@gmail.com>wrote:
>>>
>>>> Hello.
>>>> Try to escape spaces. I don`t check how django work when path have
>>>> spaces inside, but i meet same problems in my practice.
>>>>
>>>> p.s. sorry for my bad english.
>>>>
>>>> 12 апреля 2012 г. 21:32 пользователь victoria <ka...@bitnami.org> 
>>>> написал:
>>>> > On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com> 
>>>> wrote:
>>>> >> I am working (again) through the tutorial part 1. I have made 
>>>> changes to
>>>> >> Engine and Name as specified in the instructions. However, running 
>>>> "python
>>>> >> manage.py syncdb" continues to return "Please supply the ENGINE 
>>>> value." I
>>>> >> did not encounter this problem the first time I worked through this
>>>> >> tutorial.
>>>> >>
>>>> >> # Django settings for mysite project.
>>>> >>
>>>> >> DEBUG = True
>>>> >> TEMPLATE_DEBUG = DEBUG
>>>> >>
>>>> >> ADMINS = (
>>>> >> # ('Your Name', 'your_em...@example.com'),
>>>> >> )
>>>> >>
>>>> >> MANAGERS = ADMINS
>>>> >>
>>>> >> DATABASES = {
>>>> >> 'default': {
>>>> >> 'ENGINE': 'django.db.backends.sqlite3', # Add 
>>>> 'postgresql_psycopg2',
>>>> >> 'mysql', 'sqlite3' or 'oracle'.
>>>> >> 'NAME': 'c:/program files/bitnami
>>>> >> djangostack/mysite/sqlite3.db'**,  # Or path to 
>>>> database
>>>> >> file if using sqlite3.
>>>> 

Re: tutorial part 1...syncing db

2012-04-12 Thread william ratcliff
Hi Brandy,

I downloaded your project modified the beginning to the following:

# Django settings for mysite project.

import os,sys
HOMEDIR=os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(HOMEDIR,'testdb'),  # Or
path to database file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default.
Not used with sqlite3.
}
}

It works under the django 1.4 that I just pulled onto a "virgin" windows 7
box. My suspicion is that in your engine file, you wanted to use:
r'c:/program files/bitnami djangostack/mysite/sqlite3.db'
instead of:
'c:/program files/bitnami djangostack/mysite/sqlite3.db',

This is assuming that you have read/write permissions to that directory,
etc.I prefer the pattern that I used of putting the sqllite database
relative to __file__ because it is easier to move it between machines.
So, for example, if I develop on a mac (or windows), when I deploy to linux
(not so much for the database) for production, I don't have to manipulate
the path throughout the code...Later, if I need to find something relative
to the project root, I can then do a:

from django.conf import settings
and grab settings.HOME as the base directory

Best,
William
(btw. I placed the directory in c:\mysite for my test

so you have:
-- denotes a mysite directory


c:\mysite
manage.py
--mysite
  __init__.py
  settings.py
  testdb
  urls.py
  wsgi.py


)



2012/4/12 Brandy <brandy.norri...@yahoo.com>

> This is the whole directory.
>
>
> On Thursday, April 12, 2012 2:00:24 PM UTC-5, William Ratcliff wrote:
>
>> Can you post your full code somewhere as a zip?
>>
>>
>>
>> On Thu, Apr 12, 2012 at 2:33 PM, Leonid Toshchev <ltoshc...@gmail.com>wrote:
>>
>>> Hello.
>>> Try to escape spaces. I don`t check how django work when path have
>>> spaces inside, but i meet same problems in my practice.
>>>
>>> p.s. sorry for my bad english.
>>>
>>> 12 апреля 2012 г. 21:32 пользователь victoria <ka...@bitnami.org>
>>> написал:
>>> > On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com>
>>> wrote:
>>> >> I am working (again) through the tutorial part 1. I have made changes
>>> to
>>> >> Engine and Name as specified in the instructions. However, running
>>> "python
>>> >> manage.py syncdb" continues to return "Please supply the ENGINE
>>> value." I
>>> >> did not encounter this problem the first time I worked through this
>>> >> tutorial.
>>> >>
>>> >> # Django settings for mysite project.
>>> >>
>>> >> DEBUG = True
>>> >> TEMPLATE_DEBUG = DEBUG
>>> >>
>>> >> ADMINS = (
>>> >> # ('Your Name', 'your_em...@example.com'),
>>> >> )
>>> >>
>>> >> MANAGERS = ADMINS
>>> >>
>>> >> DATABASES = {
>>> >> 'default': {
>>> >> 'ENGINE': 'django.db.backends.sqlite3', # Add
>>> 'postgresql_psycopg2',
>>> >> 'mysql', 'sqlite3' or 'oracle'.
>>> >> 'NAME': 'c:/program files/bitnami
>>> >> djangostack/mysite/sqlite3.db'**,  # Or path to
>>> database
>>> >> file if using sqlite3.
>>> >> 'USER': '',  # Not used with sqlite3.
>>> >> 'PASSWORD': '',  # Not used with sqlite3.
>>> >> 'HOST': '',  # Set to empty string for
>>> >> localhost. Not used with sqlite3.
>>> >> 'PORT': '',  # Set to empty string for
>>> default.
>>> >> Not used with sqlite3.
>>> >> }
>>> >> }
>>> >>
>>> >
>>> > Your settings seem correct. Which version of django are you using?
>>> > Have you checked that the settings.py file is in the correct location
>>> > for your django version?
>>> >
>>> > Django 1.4 expects this layout:
&

Re: tutorial part 1...syncing db

2012-04-12 Thread william ratcliff
Can you post your full code somewhere as a zip?



On Thu, Apr 12, 2012 at 2:33 PM, Leonid Toshchev <ltoshc...@gmail.com>wrote:

> Hello.
> Try to escape spaces. I don`t check how django work when path have
> spaces inside, but i meet same problems in my practice.
>
> p.s. sorry for my bad english.
>
> 12 апреля 2012 г. 21:32 пользователь victoria <ka...@bitnami.org> написал:
> > On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com>
> wrote:
> >> I am working (again) through the tutorial part 1. I have made changes to
> >> Engine and Name as specified in the instructions. However, running
> "python
> >> manage.py syncdb" continues to return "Please supply the ENGINE value."
> I
> >> did not encounter this problem the first time I worked through this
> >> tutorial.
> >>
> >> # Django settings for mysite project.
> >>
> >> DEBUG = True
> >> TEMPLATE_DEBUG = DEBUG
> >>
> >> ADMINS = (
> >> # ('Your Name', 'your_em...@example.com'),
> >> )
> >>
> >> MANAGERS = ADMINS
> >>
> >> DATABASES = {
> >> 'default': {
> >> 'ENGINE': 'django.db.backends.sqlite3', # Add
> 'postgresql_psycopg2',
> >> 'mysql', 'sqlite3' or 'oracle'.
> >> 'NAME': 'c:/program files/bitnami
> >> djangostack/mysite/sqlite3.db',  # Or path to
> database
> >> file if using sqlite3.
> >> 'USER': '',  # Not used with sqlite3.
> >> 'PASSWORD': '',  # Not used with sqlite3.
> >> 'HOST': '',  # Set to empty string for
> >> localhost. Not used with sqlite3.
> >> 'PORT': '',  # Set to empty string for
> default.
> >> Not used with sqlite3.
> >> }
> >> }
> >>
> >
> > Your settings seem correct. Which version of django are you using?
> > Have you checked that the settings.py file is in the correct location
> > for your django version?
> >
> > Django 1.4 expects this layout:
> >
> > mysite/
> >manage.py
> >mysite/
> >__init__.py
> >settings.py
> >urls.py
> >wsgi.py
> >
> > While Django 1.3 expects this:
> >
> > mysite/
> >__init__.py
> >manage.py
> >settings.py
> >urls.py
> >
> >
> > Since 1.4 was released this seems one of the most common mistakes that
> > could cause this error.
> >
> >> --
> >> 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/-/qnfmdfEObKAJ.
> >> 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.
> >
> > --
> > 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.
> >
>
> --
> 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.
>
>

-- 
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: tutorial part 1...syncing db

2012-04-12 Thread Leonid Toshchev
Hello.
Try to escape spaces. I don`t check how django work when path have
spaces inside, but i meet same problems in my practice.

p.s. sorry for my bad english.

12 апреля 2012 г. 21:32 пользователь victoria <ka...@bitnami.org> написал:
> On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com> wrote:
>> I am working (again) through the tutorial part 1. I have made changes to
>> Engine and Name as specified in the instructions. However, running "python
>> manage.py syncdb" continues to return "Please supply the ENGINE value." I
>> did not encounter this problem the first time I worked through this
>> tutorial.
>>
>> # Django settings for mysite project.
>>
>> DEBUG = True
>> TEMPLATE_DEBUG = DEBUG
>>
>> ADMINS = (
>>     # ('Your Name', 'your_em...@example.com'),
>> )
>>
>> MANAGERS = ADMINS
>>
>> DATABASES = {
>>     'default': {
>>     'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2',
>> 'mysql', 'sqlite3' or 'oracle'.
>>     'NAME': 'c:/program files/bitnami
>> djangostack/mysite/sqlite3.db',  # Or path to database
>> file if using sqlite3.
>>     'USER': '',  # Not used with sqlite3.
>>     'PASSWORD': '',  # Not used with sqlite3.
>>     'HOST': '',  # Set to empty string for
>> localhost. Not used with sqlite3.
>>     'PORT': '',  # Set to empty string for default.
>> Not used with sqlite3.
>>     }
>> }
>>
>
> Your settings seem correct. Which version of django are you using?
> Have you checked that the settings.py file is in the correct location
> for your django version?
>
> Django 1.4 expects this layout:
>
> mysite/
>    manage.py
>    mysite/
>        __init__.py
>        settings.py
>        urls.py
>        wsgi.py
>
> While Django 1.3 expects this:
>
> mysite/
>    __init__.py
>    manage.py
>    settings.py
>    urls.py
>
>
> Since 1.4 was released this seems one of the most common mistakes that
> could cause this error.
>
>> --
>> 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/-/qnfmdfEObKAJ.
>> 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.
>
> --
> 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.
>

-- 
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: tutorial part 1...syncing db

2012-04-12 Thread Brandy
I am in version 1.4. I feel like this is what is happening: I open the file 
to edit it in either Emacs or BlueFish. The file seems to save properly (I 
have verified that the files are being saved to the correct directory), but 
those changes don't seem to be reflected in the files when I access them 
through Django. It is very strange, because when I open the files in an 
editor, they appear to be correct. But django is not picking up on the 
changes for some reason.
 
 

On Thursday, April 12, 2012 12:32:21 PM UTC-5, victoria wrote:

> On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com> wrote:
> > I am working (again) through the tutorial part 1. I have made changes to
> > Engine and Name as specified in the instructions. However, running 
> "python
> > manage.py syncdb" continues to return "Please supply the ENGINE value." I
> > did not encounter this problem the first time I worked through this
> > tutorial.
> >
> > # Django settings for mysite project.
> >
> > DEBUG = True
> > TEMPLATE_DEBUG = DEBUG
> >
> > ADMINS = (
> > # ('Your Name', 'your_em...@example.com'),
> > )
> >
> > MANAGERS = ADMINS
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.sqlite3', # Add 
> 'postgresql_psycopg2',
> > 'mysql', 'sqlite3' or 'oracle'.
> > 'NAME': 'c:/program files/bitnami
> > djangostack/mysite/sqlite3.db',  # Or path to 
> database
> > file if using sqlite3.
> > 'USER': '',  # Not used with sqlite3.
> > 'PASSWORD': '',  # Not used with sqlite3.
> > 'HOST': '',  # Set to empty string for
> > localhost. Not used with sqlite3.
> > 'PORT': '',  # Set to empty string for 
> default.
> > Not used with sqlite3.
> > }
> > }
> >
>
> Your settings seem correct. Which version of django are you using?
> Have you checked that the settings.py file is in the correct location
> for your django version?
>
> Django 1.4 expects this layout:
>
> mysite/
> manage.py
> mysite/
> __init__.py
> settings.py
> urls.py
> wsgi.py
>
> While Django 1.3 expects this:
>
> mysite/
> __init__.py
> manage.py
> settings.py
> urls.py
>
>
> Since 1.4 was released this seems one of the most common mistakes that
> could cause this error.
>
> > --
> > 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/-/qnfmdfEObKAJ.
> > 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.
>
>
On Thursday, April 12, 2012 12:32:21 PM UTC-5, victoria wrote:
>
> On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com> wrote:
> > I am working (again) through the tutorial part 1. I have made changes to
> > Engine and Name as specified in the instructions. However, running 
> "python
> > manage.py syncdb" continues to return "Please supply the ENGINE value." I
> > did not encounter this problem the first time I worked through this
> > tutorial.
> >
> > # Django settings for mysite project.
> >
> > DEBUG = True
> > TEMPLATE_DEBUG = DEBUG
> >
> > ADMINS = (
> > # ('Your Name', 'your_em...@example.com'),
> > )
> >
> > MANAGERS = ADMINS
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.sqlite3', # Add 
> 'postgresql_psycopg2',
> > 'mysql', 'sqlite3' or 'oracle'.
> > 'NAME': 'c:/program files/bitnami
> > djangostack/mysite/sqlite3.db',  # Or path to 
> database
> > file if using sqlite3.
> > 'USER': '',  # Not used with sqlite3.
> > 'PASSWORD': '',  # Not used with sqlite3.
> > 'HOST': '',  # Set to empty string for
> > localhost. Not used with sqlite3.
> > 'PORT': '',  # Set to empty string for 
> default.
> > Not used with sqlite3.
> > }
> > }
> >
>
> Your settings seem correct. Which version of django are you using?
> Have you checked that the settings.py file is

Re: tutorial part 1...syncing db

2012-04-12 Thread victoria
On Thu, Apr 12, 2012 at 7:09 PM, Brandy <brandy.norri...@yahoo.com> wrote:
> I am working (again) through the tutorial part 1. I have made changes to
> Engine and Name as specified in the instructions. However, running "python
> manage.py syncdb" continues to return "Please supply the ENGINE value." I
> did not encounter this problem the first time I worked through this
> tutorial.
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
>     # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
>     'default': {
>     'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2',
> 'mysql', 'sqlite3' or 'oracle'.
>     'NAME': 'c:/program files/bitnami
> djangostack/mysite/sqlite3.db',  # Or path to database
> file if using sqlite3.
>     'USER': '',  # Not used with sqlite3.
>     'PASSWORD': '',  # Not used with sqlite3.
>     'HOST': '',  # Set to empty string for
> localhost. Not used with sqlite3.
>     'PORT': '',  # Set to empty string for default.
> Not used with sqlite3.
>     }
> }
>

Your settings seem correct. Which version of django are you using?
Have you checked that the settings.py file is in the correct location
for your django version?

Django 1.4 expects this layout:

mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py

While Django 1.3 expects this:

mysite/
__init__.py
manage.py
settings.py
urls.py


Since 1.4 was released this seems one of the most common mistakes that
could cause this error.

> --
> 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/-/qnfmdfEObKAJ.
> 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.

-- 
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.



tutorial part 1...syncing db

2012-04-12 Thread Brandy
I am working (again) through the tutorial part 1. I have made changes to 
Engine and Name as specified in the instructions. However, running "python 
manage.py syncdb" continues to return "Please supply the ENGINE value." I 
did not encounter this problem the first time I worked through this 
tutorial.
 
# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'c:/program files/bitnami 
djangostack/mysite/sqlite3.db',  # Or path to database 
file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for 
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for default. 
Not used with sqlite3.
}
}

-- 
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/-/qnfmdfEObKAJ.
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: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-27 Thread Sami Balbaky
Thanks everyone. Your inputs were a tremendous help. I'm slowly, but
surely, getting the hang of Django.

Best,

S

On Wed, Feb 22, 2012 at 9:19 AM, Bill Freeman <ke1g...@gmail.com> wrote:

> 1.  There is more information in that traceback (that you didn't
> include) that could help
> you find your indentation error.
>
> 2.  It is quite useful, presuming that you are also a python beginner,
> to do the tutorial
> at:
>
>   http://docs.python.org/tutorial/index.html
>
> Bill
>
> On Tue, Feb 21, 2012 at 6:41 PM, Django_for_SB <sami.balb...@gmail.com>
> wrote:
> > Django Gurus,
> >
> > I'm an absolute beginner using Python in Django. I'm currently going
> > through the tutorial, part 1, on the djangoproject.com main website:
> > https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
> > to complete part 1 of the tutorial, step by step, meaning, I'll go
> > through the tutorial part 1, progress up to a certain point, then
> > close my shell command and shut-down my computer. Then, when I get
> > back to opening up the project in which I initially began working on,
> > namely, "mysite" (as the tutorial instructs us to name), my shell
> > commands aren't valid anymore.
> >
> > Example:
> >
> > manage.py shell -> This
> > initially works if I start the project from scratch
> >
> > manage.py shell -> This won't
> > work if I leave my project, then go back to continue to
> >
> > work on it later
> >
> > This is the error I keep getting:
> >
> > Traceback(most recent call last):
> >
> > IndentationError: unexpected Indent
> >
> >
> >
> > I'm not quite sure what's going on. Any assistance would be more than
> > appreciated. What am I missing here? Thank you.
> >
> > Best,
> >
> > SB
> >
> > --
> > 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.
> >
>
> --
> 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.
>
>

-- 
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: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-22 Thread Bill Freeman
1.  There is more information in that traceback (that you didn't
include) that could help
you find your indentation error.

2.  It is quite useful, presuming that you are also a python beginner,
to do the tutorial
at:

   http://docs.python.org/tutorial/index.html

Bill

On Tue, Feb 21, 2012 at 6:41 PM, Django_for_SB <sami.balb...@gmail.com> wrote:
> Django Gurus,
>
> I'm an absolute beginner using Python in Django. I'm currently going
> through the tutorial, part 1, on the djangoproject.com main website:
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
> to complete part 1 of the tutorial, step by step, meaning, I'll go
> through the tutorial part 1, progress up to a certain point, then
> close my shell command and shut-down my computer. Then, when I get
> back to opening up the project in which I initially began working on,
> namely, "mysite" (as the tutorial instructs us to name), my shell
> commands aren't valid anymore.
>
> Example:
>
> manage.py shell                                     -> This
> initially works if I start the project from scratch
>
> manage.py shell                                     -> This won't
> work if I leave my project, then go back to continue to
>
> work on it later
>
> This is the error I keep getting:
>
> Traceback(most recent call last):
>
> IndentationError: unexpected Indent
>
>
>
> I'm not quite sure what's going on. Any assistance would be more than
> appreciated. What am I missing here? Thank you.
>
> Best,
>
> SB
>
> --
> 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.
>

-- 
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: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread kalyani ram
Hey I am a begginer too and i went tru the same tutorial and trust me
i had so many errors and i just struggled tru..
now indentation errors are quite common. what u need to do is, go to u
models.py, admin.py, views.py or any other .py file for which ever the
code is written, and plz try using python editor to write instead of
other text editors. they help u indent the code pretty well. and then
give python manage.py shell after syncdb n validate.
I am sure u ll get tru. indent your functions properly.
all the best.


Regards,
kalyani Ram

On Feb 22, 4:41 am, Django_for_SB <sami.balb...@gmail.com> wrote:
> Django Gurus,
>
> I'm an absolute beginner using Python in Django. I'm currently going
> through the tutorial, part 1, on the djangoproject.com main 
> website:https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
> to complete part 1 of the tutorial, step by step, meaning, I'll go
> through the tutorial part 1, progress up to a certain point, then
> close my shell command and shut-down my computer. Then, when I get
> back to opening up the project in which I initially began working on,
> namely, "mysite" (as the tutorial instructs us to name), my shell
> commands aren't valid anymore.
>
> Example:
>
> manage.py shell                                     -> This
> initially works if I start the project from scratch
>
> manage.py shell                                     -> This won't
> work if I leave my project, then go back to continue to
>
> work on it later
>
> This is the error I keep getting:
>
> Traceback(most recent call last):
>
> IndentationError: unexpected Indent
>
> I'm not quite sure what's going on. Any assistance would be more than
> appreciated. What am I missing here? Thank you.
>
> Best,
>
> SB

-- 
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: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread Furbee
Python is indentation-specific. It determines the semantics of your code by
it's levels of indentation. For instance:

# print False
if False:
print "false"
print "done"

if False:
print "false"
else:
print "true"

Note that inside the if block, all lines which are indented belong to that
if block. The block ends when the indentation ends. The error
"IndentationError:
unexpected Indent" tells you that Python got an indentation it was not
expecting. This could be as simple as a single space that shouldn't be
there. Check your models.py and settings.py files for any lines that are
indented which are not supposed to be.

Furbee

On Tue, Feb 21, 2012 at 3:41 PM, Django_for_SB <sami.balb...@gmail.com>wrote:

> Django Gurus,
>
> I'm an absolute beginner using Python in Django. I'm currently going
> through the tutorial, part 1, on the djangoproject.com main website:
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
> to complete part 1 of the tutorial, step by step, meaning, I'll go
> through the tutorial part 1, progress up to a certain point, then
> close my shell command and shut-down my computer. Then, when I get
> back to opening up the project in which I initially began working on,
> namely, "mysite" (as the tutorial instructs us to name), my shell
> commands aren't valid anymore.
>
> Example:
>
> manage.py shell -> This
> initially works if I start the project from scratch
>
> manage.py shell -> This won't
> work if I leave my project, then go back to continue to
>
> work on it later
>
> This is the error I keep getting:
>
> Traceback(most recent call last):
>
> IndentationError: unexpected Indent
>
>
>
> I'm not quite sure what's going on. Any assistance would be more than
> appreciated. What am I missing here? Thank you.
>
> Best,
>
> SB
>
> --
> 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.
>
>

-- 
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.



Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread Django_for_SB
Django Gurus,

I'm an absolute beginner using Python in Django. I'm currently going
through the tutorial, part 1, on the djangoproject.com main website:
https://docs.djangoproject.com/en/1.3/intro/tutorial01/. I keep trying
to complete part 1 of the tutorial, step by step, meaning, I'll go
through the tutorial part 1, progress up to a certain point, then
close my shell command and shut-down my computer. Then, when I get
back to opening up the project in which I initially began working on,
namely, "mysite" (as the tutorial instructs us to name), my shell
commands aren't valid anymore.

Example:

manage.py shell -> This
initially works if I start the project from scratch

manage.py shell -> This won't
work if I leave my project, then go back to continue to
 
work on it later

This is the error I keep getting:

Traceback(most recent call last):

IndentationError: unexpected Indent



I'm not quite sure what's going on. Any assistance would be more than
appreciated. What am I missing here? Thank you.

Best,

SB

-- 
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: __unicode__ in tutorial part 1

2011-04-12 Thread darekodz
It works!!

THANK YOU EVERYBODY

On 12 Kwi, 22:21, Rafael Durán Castañeda
 wrote:
> I think last line from traceback is enough:
>
> IndentationError: unexpected indent
>
> 2011/4/12 darekodz 
>
>
>
>
>
>
>
> > I'm using instant django which have: Python 2.7.1 and Django 1.2.4.
> > When I add
>
> >    def __unicode__(self):
> >        return self.question
>
> > and
>
> >    def __unicode__(self):
> >        return self.choice
>
> > to my class I have errors when I want to restart shell, like:
>
> > C:\django\mysite>python manage.py syncdb
> > Traceback (most recent call last):
> >  File "manage.py", line 11, in 
> >    execute_manager(settings)
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \__init__.py"
> > , line 438, in execute_manager
> >    utility.execute()
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \__init__.py"
> > , line 379, in execute
> >    self.fetch_command(subcommand).run_from_argv(self.argv)
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \base.py", li
> > ne 191, in run_from_argv
> >    self.execute(*args, **options.__dict__)
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \base.py", li
> > ne 219, in execute
> >    self.validate()
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \base.py", li
> > ne 249, in validate
> >    num_errors = get_validation_errors(s, app)
> >  File "C:\django\Python27\lib\site-packages\django\core\management
> > \validation.p
> > y", line 35, in get_validation_errors
> >    for (app_name, error) in get_app_errors().items():
> >  File "C:\django\Python27\lib\site-packages\django\db\models
> > \loading.py", line
> > 146, in get_app_errors
> >    self._populate()
> >  File "C:\django\Python27\lib\site-packages\django\db\models
> > \loading.py", line
> > 61, in _populate
> >    self.load_app(app_name, True)
> >  File "C:\django\Python27\lib\site-packages\django\db\models
> > \loading.py", line
> > 78, in load_app
> >    models = import_module('.models', app_name)
> >  File "C:\django\Python27\lib\site-packages\django\utils
> > \importlib.py", line 35
> > , in import_module
> >    __import__(name)
> >  File "C:\django\mysite\..\mysite\polls\models.py", line 6
> >    def __unicode__(self):
> >    ^
> > IndentationError: unexpected indent
>
> > I don't know what's wrong - Can You help me?
>
> > --
> > 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.

-- 
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: __unicode__ in tutorial part 1

2011-04-12 Thread Abhijeet Rastogi
May be you have copy-pasted the code from somewhere. May be you are using a
TAB instead of 4-spaces or the other way round. Its a python question. You
should brush-up your python skills before getting to django. Start with a
book like "dive into python".

On Wed, Apr 13, 2011 at 1:15 AM, darekodz  wrote:

> I'm using instant django which have: Python 2.7.1 and Django 1.2.4.
> When I add
>
>def __unicode__(self):
>return self.question
>
> and
>
>def __unicode__(self):
>return self.choice
>
> to my class I have errors when I want to restart shell, like:
>
> C:\django\mysite>python manage.py syncdb
> Traceback (most recent call last):
>  File "manage.py", line 11, in 
>execute_manager(settings)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \__init__.py"
> , line 438, in execute_manager
>utility.execute()
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \__init__.py"
> , line 379, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 191, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 219, in execute
>self.validate()
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 249, in validate
>num_errors = get_validation_errors(s, app)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \validation.p
> y", line 35, in get_validation_errors
>for (app_name, error) in get_app_errors().items():
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 146, in get_app_errors
>self._populate()
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 61, in _populate
>self.load_app(app_name, True)
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 78, in load_app
>models = import_module('.models', app_name)
>  File "C:\django\Python27\lib\site-packages\django\utils
> \importlib.py", line 35
> , in import_module
>__import__(name)
>  File "C:\django\mysite\..\mysite\polls\models.py", line 6
>def __unicode__(self):
>^
> IndentationError: unexpected indent
>
> I don't know what's wrong - Can You help me?
>
>
> --
> 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.
>
>


-- 
Regards,
Abhijeet Rastogi (shadyabhi)
http://www.google.com/profiles/abhijeet.1989

-- 
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: __unicode__ in tutorial part 1

2011-04-12 Thread Rafael Durán Castañeda
I think last line from traceback is enough:

IndentationError: unexpected indent

2011/4/12 darekodz 

> I'm using instant django which have: Python 2.7.1 and Django 1.2.4.
> When I add
>
>def __unicode__(self):
>return self.question
>
> and
>
>def __unicode__(self):
>return self.choice
>
> to my class I have errors when I want to restart shell, like:
>
> C:\django\mysite>python manage.py syncdb
> Traceback (most recent call last):
>  File "manage.py", line 11, in 
>execute_manager(settings)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \__init__.py"
> , line 438, in execute_manager
>utility.execute()
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \__init__.py"
> , line 379, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 191, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 219, in execute
>self.validate()
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \base.py", li
> ne 249, in validate
>num_errors = get_validation_errors(s, app)
>  File "C:\django\Python27\lib\site-packages\django\core\management
> \validation.p
> y", line 35, in get_validation_errors
>for (app_name, error) in get_app_errors().items():
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 146, in get_app_errors
>self._populate()
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 61, in _populate
>self.load_app(app_name, True)
>  File "C:\django\Python27\lib\site-packages\django\db\models
> \loading.py", line
> 78, in load_app
>models = import_module('.models', app_name)
>  File "C:\django\Python27\lib\site-packages\django\utils
> \importlib.py", line 35
> , in import_module
>__import__(name)
>  File "C:\django\mysite\..\mysite\polls\models.py", line 6
>def __unicode__(self):
>^
> IndentationError: unexpected indent
>
> I don't know what's wrong - Can You help me?
>
>
> --
> 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.
>
>

-- 
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: __unicode__ in tutorial part 1

2011-04-12 Thread Jirka Vejrazka
> IndentationError: unexpected indent
>
> I don't know what's wrong - Can You help me?


It's exactly what it says - indentation is important in Python and
number for spaces (or tabs) on that line does not match the rest of
your file. Or you mixed tabs and spaces.

  HTH

   Jirka

-- 
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.



__unicode__ in tutorial part 1

2011-04-12 Thread darekodz
I'm using instant django which have: Python 2.7.1 and Django 1.2.4.
When I add

def __unicode__(self):
return self.question

and

def __unicode__(self):
return self.choice

to my class I have errors when I want to restart shell, like:

C:\django\mysite>python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "C:\django\Python27\lib\site-packages\django\core\management
\__init__.py"
, line 438, in execute_manager
utility.execute()
  File "C:\django\Python27\lib\site-packages\django\core\management
\__init__.py"
, line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\django\Python27\lib\site-packages\django\core\management
\base.py", li
ne 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "C:\django\Python27\lib\site-packages\django\core\management
\base.py", li
ne 219, in execute
self.validate()
  File "C:\django\Python27\lib\site-packages\django\core\management
\base.py", li
ne 249, in validate
num_errors = get_validation_errors(s, app)
  File "C:\django\Python27\lib\site-packages\django\core\management
\validation.p
y", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File "C:\django\Python27\lib\site-packages\django\db\models
\loading.py", line
146, in get_app_errors
self._populate()
  File "C:\django\Python27\lib\site-packages\django\db\models
\loading.py", line
61, in _populate
self.load_app(app_name, True)
  File "C:\django\Python27\lib\site-packages\django\db\models
\loading.py", line
78, in load_app
models = import_module('.models', app_name)
  File "C:\django\Python27\lib\site-packages\django\utils
\importlib.py", line 35
, in import_module
__import__(name)
  File "C:\django\mysite\..\mysite\polls\models.py", line 6
def __unicode__(self):
^
IndentationError: unexpected indent

I don't know what's wrong - Can You help me?


-- 
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: need help following tutorial part 1

2011-01-29 Thread Andre Terra
Quick and dirty solution:
python django-admin.py startproject mysite

or

Add C:\PathToYourDjangoInstall\Scripts\ to your PATH environment variable.
This can be done in one of two ways.

#1 (EASIER)
Open 'System Properties' (hit WindowsKey + PauseBreak, or right-click on My
Computer and select 'Properties').
Switch to the 'Advanced' tab, click on 'Environment Variables' on the bottom
of the dialog.
Find PATH on the 'System Variables' list, double-click.
append C:\PathToYourDjangoInstall\Scripts\ to the 'Variable Value'. Don't
forget to add a semi-colon.


#2 (BETTER)
Download and install virtualenv (http://pypi.python.org/pypi/virtualenv)
Follow instructions to create a virtual environment in, say,
C:\django\virtual\
Create a 'mydjango.bat' batch file anywhere in your computer that sets the
PATH for you according to that virtual environment.
Create a shortcut pointing to: %windir%\system32\CMD.EXE /K
"C:\SomePath\mydjango.bat"
Run it whenever you want to work within that environment.


I personally use a variation of #2.

Sincerely,
André Terra


On Sat, Jan 29, 2011 at 16:44, Axel Bock  wrote:

> hm ... my windows times are over quite a while, BUT ...
>
> 1) try associating the .py extension with the python commandline
> interpreter.
> 2) syntax error? send a screendump maybe, or your exact command line ... it
> _should_ work without problems.
>
> can you execute other simple python scripts?
>
>
> cheers,
> axel.
>
>
>
>
> 2011/1/29 Panupat 
>
> I'm kinda stuck and would greatly appreciate any help.
>>
>> I followed these turorials and got Django to install. Was able to
>> import Django and print out the version correctly. I'm running
>> Apache2.2 on windows 7 with mod_wsgi
>>
>> http://docs.djangoproject.com/en/1.2/intro/install/
>>
>> But moving forward to part 1, It says, cd to the directory and run the
>> command
>> django-admin.py startproject mysite
>>
>> This is where I don't understand.
>> - running the command from cmd, it says django-admin.py is not
>> recognized as command.
>> - if I run python first, it says syntax error.
>>
>> Am I missing something from the tutorial? Does the project need to be
>> in a particular folder in order for the .py file to be executable? Is
>> there anything else I need to add to windows other than adding C:
>> \Python27 to PATH?
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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: need help following tutorial part 1

2011-01-29 Thread Panupat
Oh Axel, sorry about that ^_^;

The tutorial said I should cd to the directory I want to start my
project.
So no I wasn't in C:\Python27\Scripts when I typed the command

On Jan 30, 2:05 am, Axel Bock  wrote:
> you should not. are you IN c:\...\scripts when you type in
> "django-admin.py"? AFAIK windows adds the current directory always to the
> path.
>
> and it's AXEL ;)
>
> 2011/1/29 Panupat 
>
> > Hi Alex. Thank you for you suggestion.
>
> > It seems I can get the script to run if I type out the full path.
>
> > C:\Python27\Scripts\django-admin.py startprofect mysite
>
> > C:\Python27 is already added to my windows' PATH. Proably will need to
> > add C:\Python27\Scripts to it too.
>
> > On Jan 30, 1:44 am, Axel Bock  wrote:
> > > hm ... my windows times are over quite a while, BUT ...
>
> > > 1) try associating the .py extension with the python commandline
> > > interpreter.
> > > 2) syntax error? send a screendump maybe, or your exact command line ...
> > it
> > > _should_ work without problems.
>
> > > can you execute other simple python scripts?
>
> > > cheers,
> > > axel.
>
> > > 2011/1/29 Panupat 
>
> > > > I'm kinda stuck and would greatly appreciate any help.
>
> > > > I followed these turorials and got Django to install. Was able to
> > > > import Django and print out the version correctly. I'm running
> > > > Apache2.2 on windows 7 with mod_wsgi
>
> > > >http://docs.djangoproject.com/en/1.2/intro/install/
>
> > > > But moving forward to part 1, It says, cd to the directory and run the
> > > > command
> > > > django-admin.py startproject mysite
>
> > > > This is where I don't understand.
> > > > - running the command from cmd, it says django-admin.py is not
> > > > recognized as command.
> > > > - if I run python first, it says syntax error.
>
> > > > Am I missing something from the tutorial? Does the project need to be
> > > > in a particular folder in order for the .py file to be executable? Is
> > > > there anything else I need to add to windows other than adding C:
> > > > \Python27 to PATH?
>

-- 
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: need help following tutorial part 1

2011-01-29 Thread Axel Bock
you should not. are you IN c:\...\scripts when you type in
"django-admin.py"? AFAIK windows adds the current directory always to the
path.

and it's AXEL ;)



2011/1/29 Panupat 

> Hi Alex. Thank you for you suggestion.
>
> It seems I can get the script to run if I type out the full path.
>
> C:\Python27\Scripts\django-admin.py startprofect mysite
>
> C:\Python27 is already added to my windows' PATH. Proably will need to
> add C:\Python27\Scripts to it too.
>
>
> On Jan 30, 1:44 am, Axel Bock  wrote:
> > hm ... my windows times are over quite a while, BUT ...
> >
> > 1) try associating the .py extension with the python commandline
> > interpreter.
> > 2) syntax error? send a screendump maybe, or your exact command line ...
> it
> > _should_ work without problems.
> >
> > can you execute other simple python scripts?
> >
> > cheers,
> > axel.
> >
> > 2011/1/29 Panupat 
> >
> > > I'm kinda stuck and would greatly appreciate any help.
> >
> > > I followed these turorials and got Django to install. Was able to
> > > import Django and print out the version correctly. I'm running
> > > Apache2.2 on windows 7 with mod_wsgi
> >
> > >http://docs.djangoproject.com/en/1.2/intro/install/
> >
> > > But moving forward to part 1, It says, cd to the directory and run the
> > > command
> > > django-admin.py startproject mysite
> >
> > > This is where I don't understand.
> > > - running the command from cmd, it says django-admin.py is not
> > > recognized as command.
> > > - if I run python first, it says syntax error.
> >
> > > Am I missing something from the tutorial? Does the project need to be
> > > in a particular folder in order for the .py file to be executable? Is
> > > there anything else I need to add to windows other than adding C:
> > > \Python27 to PATH?
> >
>
> --
> 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.
>
>

-- 
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: need help following tutorial part 1

2011-01-29 Thread Panupat
Hi Alex. Thank you for you suggestion.

It seems I can get the script to run if I type out the full path.

C:\Python27\Scripts\django-admin.py startprofect mysite

C:\Python27 is already added to my windows' PATH. Proably will need to
add C:\Python27\Scripts to it too.


On Jan 30, 1:44 am, Axel Bock  wrote:
> hm ... my windows times are over quite a while, BUT ...
>
> 1) try associating the .py extension with the python commandline
> interpreter.
> 2) syntax error? send a screendump maybe, or your exact command line ... it
> _should_ work without problems.
>
> can you execute other simple python scripts?
>
> cheers,
> axel.
>
> 2011/1/29 Panupat 
>
> > I'm kinda stuck and would greatly appreciate any help.
>
> > I followed these turorials and got Django to install. Was able to
> > import Django and print out the version correctly. I'm running
> > Apache2.2 on windows 7 with mod_wsgi
>
> >http://docs.djangoproject.com/en/1.2/intro/install/
>
> > But moving forward to part 1, It says, cd to the directory and run the
> > command
> > django-admin.py startproject mysite
>
> > This is where I don't understand.
> > - running the command from cmd, it says django-admin.py is not
> > recognized as command.
> > - if I run python first, it says syntax error.
>
> > Am I missing something from the tutorial? Does the project need to be
> > in a particular folder in order for the .py file to be executable? Is
> > there anything else I need to add to windows other than adding C:
> > \Python27 to PATH?
>

-- 
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: need help following tutorial part 1

2011-01-29 Thread Axel Bock
hm ... my windows times are over quite a while, BUT ...

1) try associating the .py extension with the python commandline
interpreter.
2) syntax error? send a screendump maybe, or your exact command line ... it
_should_ work without problems.

can you execute other simple python scripts?


cheers,
axel.




2011/1/29 Panupat 

> I'm kinda stuck and would greatly appreciate any help.
>
> I followed these turorials and got Django to install. Was able to
> import Django and print out the version correctly. I'm running
> Apache2.2 on windows 7 with mod_wsgi
>
> http://docs.djangoproject.com/en/1.2/intro/install/
>
> But moving forward to part 1, It says, cd to the directory and run the
> command
> django-admin.py startproject mysite
>
> This is where I don't understand.
> - running the command from cmd, it says django-admin.py is not
> recognized as command.
> - if I run python first, it says syntax error.
>
> Am I missing something from the tutorial? Does the project need to be
> in a particular folder in order for the .py file to be executable? Is
> there anything else I need to add to windows other than adding C:
> \Python27 to PATH?
>
> --
> 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.
>
>

-- 
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.



need help following tutorial part 1

2011-01-29 Thread Panupat
I'm kinda stuck and would greatly appreciate any help.

I followed these turorials and got Django to install. Was able to
import Django and print out the version correctly. I'm running
Apache2.2 on windows 7 with mod_wsgi

http://docs.djangoproject.com/en/1.2/intro/install/

But moving forward to part 1, It says, cd to the directory and run the
command
django-admin.py startproject mysite

This is where I don't understand.
- running the command from cmd, it says django-admin.py is not
recognized as command.
- if I run python first, it says syntax error.

Am I missing something from the tutorial? Does the project need to be
in a particular folder in order for the .py file to be executable? Is
there anything else I need to add to windows other than adding C:
\Python27 to PATH?

-- 
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: newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-04 Thread ondrey

Hi mdsmoker,

try running the django-admin.py script like this:

   python PATH/django-admin.py startproject mysite

where PATH is the path to directory containing the django-admin.py.


-Ondrej Bohm

On Aug 2, 11:47 pm, mdsmoker  wrote:
> I'm using django 1.1, python 2.5, and windows and i'm brand-spanking
> new to this.  i installed django w/out a problem.  python is in my
> windows path and if i type import django after running python i don't
> get any errors so I'm assuming it is installed correctly.  after i run
> django-admin.py startproject mysite i don't get any errors and i also
> don't get any results :(  no new folder or project files were
> created.  any suggestions?  i can't believe i can't get through the
> very first step in the tutorial!
--~--~-~--~~~---~--~~
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: newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-03 Thread Peter Bengtsson

Look at if perhaps the project "mysite" was created somewhere else,
like for example where the django-admin.py file is located.
If so, there could be a fundamental problem with your setup or a bug
in the windows implementation for django-admin.py
At worst, search your whole hard drive for it.

On 2 Aug, 22:47, mdsmoker  wrote:
> I'm using django 1.1, python 2.5, and windows and i'm brand-spanking
> new to this.  i installed django w/out a problem.  python is in my
> windows path and if i type import django after running python i don't
> get any errors so I'm assuming it is installed correctly.  after i run
> django-admin.py startproject mysite i don't get any errors and i also
> don't get any results :(  no new folder or project files were
> created.  any suggestions?  i can't believe i can't get through the
> very first step in the tutorial!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



newbie tutorial part 1 startproject doesn't create folder and appropriate files

2009-08-02 Thread mdsmoker

I'm using django 1.1, python 2.5, and windows and i'm brand-spanking
new to this.  i installed django w/out a problem.  python is in my
windows path and if i type import django after running python i don't
get any errors so I'm assuming it is installed correctly.  after i run
django-admin.py startproject mysite i don't get any errors and i also
don't get any results :(  no new folder or project files were
created.  any suggestions?  i can't believe i can't get through the
very first step in the tutorial!

--~--~-~--~~~---~--~~
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: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread Herson

More attention, python is case sensitive.

model is different of Model.

2009/1/19, joti chand :
>
>  Thanks mate
>
>
>  On Mon, Jan 19, 2009 at 9:26 PM, Eric Abrahamsen  wrote:
>  >
>  >
>  > On Jan 19, 2009, at 4:17 PM, jazz wrote:
>  >
>  >>
>  >> c:\projects\mysite>python manage.py sql polls
>  >> Traceback (most recent call last):
>  >>  File "manage.py", line 11, in 
>  >>execute_manager(settings)
>  >>  File "C:\Python25\Lib\site-packages\django\core\management
>  >> \__init__.py", line 340, in execute_manager
>  >>utility.execute()
>  >>  File "C:\Python25\Lib\site-packages\django\core\management
>  >> \__init__.py", line 295, in execute
>  >>self.fetch_command(subcommand).run_from_argv(self.argv)
>  >>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>  >> line 195, in run_from_argv
>  >>self.execute(*args, **options.__dict__)
>  >>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>  >> line 221, in execute
>  >>self.validate()
>  >>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>  >> line 249, in validate
>  >>num_errors = get_validation_errors(s, app)
>  >>  File "C:\Python25\lib\site-packages\django\core\management
>  >> \validation.py", line 28, in get_validation_errors
>  >>for (app_name, error) in get_app_errors().items():
>  >>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>  >> line 128, in get_app_errors
>  >>self._populate()
>  >>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>  >> line 57, in _populate
>  >>self.load_app(app_name, True)
>  >>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>  >> line 72, in load_app
>  >>mod = __import__(app_name, {}, {}, ['models'])
>  >>  File "c:\projects\mysite\..\mysite\polls\models.py", line 4, in
>  >> 
>  >>class Poll(models.model):
>  >> AttributeError: 'module' object has no attribute 'model'
>  >>
>  >
>  > Capitalization is important, you want to subclass models.Model, not
>  > models.model.
>  >
>  > That should do the trick,
>  >
>  > Eric
>  >
>  >
>  >> This is wat i did:
>  >>
>  >> from django.db import models
>  >>
>  >> # Create your models here.
>  >> class Poll(models.model):
>  >>question = models.CharField(max_length=200)
>  >>pub_date = models.DateTimeField('date published')
>  >>
>  >> class Choice(models.Model):
>  >>poll = models.ForeignKey(Poll)
>  >>choice = models.CharField(max_length=200)
>  >>votes = models.IntegerField()
>  >> >
>  >
>  >
>  > >
>  >
>
>  >
>


-- 
Herson Leite




--~--~-~--~~~---~--~~
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: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread joti chand

Thanks mate

On Mon, Jan 19, 2009 at 9:26 PM, Eric Abrahamsen  wrote:
>
>
> On Jan 19, 2009, at 4:17 PM, jazz wrote:
>
>>
>> c:\projects\mysite>python manage.py sql polls
>> Traceback (most recent call last):
>>  File "manage.py", line 11, in 
>>execute_manager(settings)
>>  File "C:\Python25\Lib\site-packages\django\core\management
>> \__init__.py", line 340, in execute_manager
>>utility.execute()
>>  File "C:\Python25\Lib\site-packages\django\core\management
>> \__init__.py", line 295, in execute
>>self.fetch_command(subcommand).run_from_argv(self.argv)
>>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>> line 195, in run_from_argv
>>self.execute(*args, **options.__dict__)
>>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>> line 221, in execute
>>self.validate()
>>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
>> line 249, in validate
>>num_errors = get_validation_errors(s, app)
>>  File "C:\Python25\lib\site-packages\django\core\management
>> \validation.py", line 28, in get_validation_errors
>>for (app_name, error) in get_app_errors().items():
>>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>> line 128, in get_app_errors
>>self._populate()
>>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>> line 57, in _populate
>>self.load_app(app_name, True)
>>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
>> line 72, in load_app
>>mod = __import__(app_name, {}, {}, ['models'])
>>  File "c:\projects\mysite\..\mysite\polls\models.py", line 4, in
>> 
>>class Poll(models.model):
>> AttributeError: 'module' object has no attribute 'model'
>>
>
> Capitalization is important, you want to subclass models.Model, not
> models.model.
>
> That should do the trick,
>
> Eric
>
>
>> This is wat i did:
>>
>> from django.db import models
>>
>> # Create your models here.
>> class Poll(models.model):
>>question = models.CharField(max_length=200)
>>pub_date = models.DateTimeField('date published')
>>
>> class Choice(models.Model):
>>poll = models.ForeignKey(Poll)
>>choice = models.CharField(max_length=200)
>>votes = models.IntegerField()
>> >
>
>
> >
>

--~--~-~--~~~---~--~~
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: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread Eric Abrahamsen


On Jan 19, 2009, at 4:17 PM, jazz wrote:

>
> c:\projects\mysite>python manage.py sql polls
> Traceback (most recent call last):
>  File "manage.py", line 11, in 
>execute_manager(settings)
>  File "C:\Python25\Lib\site-packages\django\core\management
> \__init__.py", line 340, in execute_manager
>utility.execute()
>  File "C:\Python25\Lib\site-packages\django\core\management
> \__init__.py", line 295, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
> line 195, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
> line 221, in execute
>self.validate()
>  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
> line 249, in validate
>num_errors = get_validation_errors(s, app)
>  File "C:\Python25\lib\site-packages\django\core\management
> \validation.py", line 28, in get_validation_errors
>for (app_name, error) in get_app_errors().items():
>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
> line 128, in get_app_errors
>self._populate()
>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
> line 57, in _populate
>self.load_app(app_name, True)
>  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
> line 72, in load_app
>mod = __import__(app_name, {}, {}, ['models'])
>  File "c:\projects\mysite\..\mysite\polls\models.py", line 4, in
> 
>class Poll(models.model):
> AttributeError: 'module' object has no attribute 'model'
>

Capitalization is important, you want to subclass models.Model, not  
models.model.

That should do the trick,

Eric


> This is wat i did:
>
> from django.db import models
>
> # Create your models here.
> class Poll(models.model):
>question = models.CharField(max_length=200)
>pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
>poll = models.ForeignKey(Poll)
>choice = models.CharField(max_length=200)
>votes = models.IntegerField()
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



I am doing the tutorial part 1 and i got this error

2009-01-19 Thread jazz

c:\projects\mysite>python manage.py sql polls
Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "C:\Python25\Lib\site-packages\django\core\management
\__init__.py", line 340, in execute_manager
utility.execute()
  File "C:\Python25\Lib\site-packages\django\core\management
\__init__.py", line 295, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
line 195, in run_from_argv
self.execute(*args, **options.__dict__)
  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
line 221, in execute
self.validate()
  File "C:\Python25\Lib\site-packages\django\core\management\base.py",
line 249, in validate
num_errors = get_validation_errors(s, app)
  File "C:\Python25\lib\site-packages\django\core\management
\validation.py", line 28, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
line 128, in get_app_errors
self._populate()
  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
line 57, in _populate
self.load_app(app_name, True)
  File "C:\Python25\lib\site-packages\django\db\models\loading.py",
line 72, in load_app
mod = __import__(app_name, {}, {}, ['models'])
  File "c:\projects\mysite\..\mysite\polls\models.py", line 4, in

class Poll(models.model):
AttributeError: 'module' object has no attribute 'model'

This is wat i did:

from django.db import models

# Create your models here.
class Poll(models.model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
--~--~-~--~~~---~--~~
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: max_length / Upgrade error in tutorial part 1 (polls)

2007-11-13 Thread matimba

Thanks for clarifying that Matt - I thought I was going crazy.


On Nov 13, 11:01 am, Matt McClanahan <[EMAIL PROTECTED]>
wrote:
> On Nov 13, 12:38 am, [EMAIL PROTECTED] wrote:
>
> > I am stepping through Dajngo Tutorial (Part 1, to create polls
> > application) and get this error.
>
> > Unexpected keyword argument 'max length' when running "manage syncdb"
>
> > If I change it to "maxlength" it works:
>
> This is the proper solution when using the latest Django release.  A
> version of Django has not yet been released which uses max_length.
>
> > Without using the documentation from previous version - what can I do
> > to fix this?
>
> The documentation found athttp://www.djangoproject.com/documentation/0.96/
> is the right version to refer to when using the latest release 0.96.1.
>
> Matt


--~--~-~--~~~---~--~~
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: max_length / Upgrade error in tutorial part 1 (polls)

2007-11-13 Thread Matt McClanahan

On Nov 13, 12:38 am, [EMAIL PROTECTED] wrote:
> I am stepping through Dajngo Tutorial (Part 1, to create polls
> application) and get this error.
>
> Unexpected keyword argument 'max length' when running "manage syncdb"
>
> If I change it to "maxlength" it works:

This is the proper solution when using the latest Django release.  A
version of Django has not yet been released which uses max_length.

> Without using the documentation from previous version - what can I do
> to fix this?

The documentation found at http://www.djangoproject.com/documentation/0.96/
is the right version to refer to when using the latest release 0.96.1.

Matt


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



max_length / Upgrade error in tutorial part 1 (polls)

2007-11-13 Thread matimba

I am stepping through Dajngo Tutorial (Part 1, to create polls
application) and get this error.

Unexpected keyword argument 'max length' when running "manage syncdb"

If I change it to "maxlength" it works:

I did see note in tutorial regarding old version and I was using an
earlier version (0.96) - I then loaded the latest version by:
- delete django directory from "site package"
- download 0.96.1 files (tar.gz)
- run python setup.py install

Still get the same error...

Without using the documentation from previous version - what can I do
to fix this?

I believe I am running latest version.

Import django
Django.VERSION

I see latest version (0.96.1)

Any other ideas, short of going back to previous version documents?
(which doesn't *really* solve the problem)

Many Thanks
Liam


--~--~-~--~~~---~--~~
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: def __str__(self) error in tutorial part 1

2007-10-03 Thread Will McCutchen

Hi,

On Oct 2, 1:18 pm, rhett <[EMAIL PROTECTED]> wrote:
> 1) I am working in TextMate and copied/pasted below code. In TextMate
> the "def __str__(self)" is not indented from the pub_date line - it's
> the same indent.

I too use TextMate to do a lot of my Python development.  It
consistently over-indents my code when I copy and paste.  It's trying
to be helpful and "intelligently" indent the pasted code, but the
smart indentation doesn't seem to work very well with Python.

> I know indents are important - is there a way to set
> up TextMate to show correct indentation?

If you highlight the code that you want unindented, you can use
Command-[ to decrease the indentation by one level.

Hope this helps,


Will.


--~--~-~--~~~---~--~~
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: def __str__(self) error in tutorial part 1

2007-10-02 Thread Jeremy Dunck

On 10/2/07, rhett <[EMAIL PROTECTED]> wrote:
>
> Total newbie here to Django and Python. Thanks for any insight.
>
> 1) I am working in TextMate and copied/pasted below code. In TextMate
> the "def __str__(self)" is not indented from the pub_date line - it's
> the same indent. I know indents are important - is there a way to set
> up TextMate to show correct indentation? Or should I use a different
> (Mac) editor? (I have to un-indent to not have a syntax error, but it
> seems like it should be indented and the code doesn't execute
> correctly).

In TextMate, View -> Show Invisibles.
Then, at the bottom of your document window, ensure "soft tabs" is
checked, and use 4 spaces.  In your document, replace any tabs with 4
spaces.

Whitespace is significant in Python.  Mixing tabs and spaces is a
cardinal sin.  I think TextMate is a fine editor for Python; you've
just gotten unlucky with your cut-and-paste.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



def __str__(self) error in tutorial part 1

2007-10-02 Thread rhett

Total newbie here to Django and Python. Thanks for any insight.

1) I am working in TextMate and copied/pasted below code. In TextMate
the "def __str__(self)" is not indented from the pub_date line - it's
the same indent. I know indents are important - is there a way to set
up TextMate to show correct indentation? Or should I use a different
(Mac) editor? (I have to un-indent to not have a syntax error, but it
seems like it should be indented and the code doesn't execute
correctly).

2) Working through Part 1 of the 0.96 tutorial, I don't get expected
results when trying to add def __str__(self) to models.py.

class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(maxlength=200)
votes = models.IntegerField()
def __str__(self):
return self.choice

I get this returned in the shell:
>>> Poll.objects.all()
[]

When I would expect:
>>> Poll.objects.all()
[]

Any help greatly appreciated.
Rhett


--~--~-~--~~~---~--~~
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: Problem creating choices in Tutorial Part 1

2007-07-25 Thread Dynomite2910

Doh! As I stated and figured it would be... a total noob mistake.

Thanks Nathan - I will look even harder before posting next time.

D.


On Jul 25, 12:37 pm, Nathan Ostgard <[EMAIL PROTECTED]> wrote:
> As the error says, you're using self.question in the Choice model --
> it should be self.choice.
>
> e.g., change this:
>
> class Choice(models.Model):
>   # ...
>   def __unicode__(self):
> return self.question
>
> to this:
>
> class Choice(models.Model):
>   # ...
>   def __unicode__(self):
> return self.choice
>
> On Jul 25, 8:19 am, Dynomite2910 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > Apologies for a noob question/problem. I have searched the forum and
> > can't find anyone having the same issue. I am working through the
> > tutorial following everything exactly as written. 
> > (http://www.djangoproject.com/documentation/tutorial01/)
>
> > Everything works as expected until I get to the point where I try to
> > add choices to the first poll I created. Here is the shell output I
> > receive.
>
> > D:\django\mysite>manage.py shell
> > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> > (Intel)] on
> > win32
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)>>> from mysite.polls.models import Poll, Choice
> > >>> p = Poll.objects.get(pk=1)
> > >>> p.choice_set.create(choice='Not much',votes=0)
>
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "D:\Python25\lib\site-packages\django\db\models\base.py", line
> > 87, in __r
> > epr__
> > return smart_str(u'<%s: %s>' % (self.__class__.__name__,
> > unicode(self)))
> >   File "D:\django\mysite\..\mysite\polls\models.py", line 16, in
> > __unicode__
> > return self.question
> > AttributeError: 'Choice' object has no attribute 'question'
>
> > Here is my models.py file:
>
> > from django.db import models
> > import datetime
>
> > class Poll(models.Model):
> > question = models.CharField(maxlength=200)
> > pub_date = models.DateTimeField('date published')
>
> > def __unicode__(self):
> > return self.question
>
> > def was_published_today(self):
> > return self.pub_date.date() == datetime.date.today()
>
> > class Choice(models.Model):
> > poll = models.ForeignKey(Poll)
> > choice = models.CharField(maxlength=200)
> > votes = models.IntegerField()
>
> > def __unicode__(self):
> > return self.question
>
> > It appears to be a problem with the foreign - here is the resuts of
> > "manage.py sql polls"
>
> > D:\django\mysite>manage.py sql polls
> > BEGIN;
> > CREATE TABLE "polls_poll" (
> > "id" serial NOT NULL PRIMARY KEY,
> > "question" varchar(200) NOT NULL,
> > "pub_date" timestamp with time zone NOT NULL
> > )
> > ;
> > CREATE TABLE "polls_choice" (
> > "id" serial NOT NULL PRIMARY KEY,
> > "poll_id" integer NOT NULL REFERENCES "polls_poll" ("id")
> > DEFERRABLE INITIAL
> > LY DEFERRED,
> > "choice" varchar(200) NOT NULL,
> > "votes" integer NOT NULL
> > )
> > ;
> > COMMIT;
>
> > I'm not sure where to go from here or how to figure out what the issue
> > is here. Hoping someone here can provide some guidance.
>
> > Thx,
> > D.- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem creating choices in Tutorial Part 1

2007-07-25 Thread Nathan Ostgard

As the error says, you're using self.question in the Choice model --
it should be self.choice.

e.g., change this:

class Choice(models.Model):
  # ...
  def __unicode__(self):
return self.question

to this:

class Choice(models.Model):
  # ...
  def __unicode__(self):
return self.choice

On Jul 25, 8:19 am, Dynomite2910 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Apologies for a noob question/problem. I have searched the forum and
> can't find anyone having the same issue. I am working through the
> tutorial following everything exactly as written. 
> (http://www.djangoproject.com/documentation/tutorial01/)
>
> Everything works as expected until I get to the point where I try to
> add choices to the first poll I created. Here is the shell output I
> receive.
>
> D:\django\mysite>manage.py shell
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
> (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)>>> from mysite.polls.models import Poll, Choice
> >>> p = Poll.objects.get(pk=1)
> >>> p.choice_set.create(choice='Not much',votes=0)
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "D:\Python25\lib\site-packages\django\db\models\base.py", line
> 87, in __r
> epr__
> return smart_str(u'<%s: %s>' % (self.__class__.__name__,
> unicode(self)))
>   File "D:\django\mysite\..\mysite\polls\models.py", line 16, in
> __unicode__
> return self.question
> AttributeError: 'Choice' object has no attribute 'question'
>
>
>
> Here is my models.py file:
>
> from django.db import models
> import datetime
>
> class Poll(models.Model):
> question = models.CharField(maxlength=200)
> pub_date = models.DateTimeField('date published')
>
> def __unicode__(self):
> return self.question
>
> def was_published_today(self):
> return self.pub_date.date() == datetime.date.today()
>
> class Choice(models.Model):
> poll = models.ForeignKey(Poll)
> choice = models.CharField(maxlength=200)
> votes = models.IntegerField()
>
> def __unicode__(self):
> return self.question
>
> It appears to be a problem with the foreign - here is the resuts of
> "manage.py sql polls"
>
> D:\django\mysite>manage.py sql polls
> BEGIN;
> CREATE TABLE "polls_poll" (
> "id" serial NOT NULL PRIMARY KEY,
> "question" varchar(200) NOT NULL,
> "pub_date" timestamp with time zone NOT NULL
> )
> ;
> CREATE TABLE "polls_choice" (
> "id" serial NOT NULL PRIMARY KEY,
> "poll_id" integer NOT NULL REFERENCES "polls_poll" ("id")
> DEFERRABLE INITIAL
> LY DEFERRED,
> "choice" varchar(200) NOT NULL,
> "votes" integer NOT NULL
> )
> ;
> COMMIT;
>
> I'm not sure where to go from here or how to figure out what the issue
> is here. Hoping someone here can provide some guidance.
>
> Thx,
> D.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem creating choices in Tutorial Part 1

2007-07-25 Thread Dynomite2910

Hello,

Apologies for a noob question/problem. I have searched the forum and
can't find anyone having the same issue. I am working through the
tutorial following everything exactly as written. (http://
www.djangoproject.com/documentation/tutorial01/)

Everything works as expected until I get to the point where I try to
add choices to the first poll I created. Here is the shell output I
receive.

D:\django\mysite>manage.py shell
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from mysite.polls.models import Poll, Choice
>>> p = Poll.objects.get(pk=1)
>>> p.choice_set.create(choice='Not much',votes=0)
Traceback (most recent call last):
  File "", line 1, in 
  File "D:\Python25\lib\site-packages\django\db\models\base.py", line
87, in __r
epr__
return smart_str(u'<%s: %s>' % (self.__class__.__name__,
unicode(self)))
  File "D:\django\mysite\..\mysite\polls\models.py", line 16, in
__unicode__
return self.question
AttributeError: 'Choice' object has no attribute 'question'
>>>

Here is my models.py file:

from django.db import models
import datetime

class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')

def __unicode__(self):
return self.question

def was_published_today(self):
return self.pub_date.date() == datetime.date.today()

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(maxlength=200)
votes = models.IntegerField()

def __unicode__(self):
return self.question


It appears to be a problem with the foreign - here is the resuts of
"manage.py sql polls"

D:\django\mysite>manage.py sql polls
BEGIN;
CREATE TABLE "polls_poll" (
"id" serial NOT NULL PRIMARY KEY,
"question" varchar(200) NOT NULL,
"pub_date" timestamp with time zone NOT NULL
)
;
CREATE TABLE "polls_choice" (
"id" serial NOT NULL PRIMARY KEY,
"poll_id" integer NOT NULL REFERENCES "polls_poll" ("id")
DEFERRABLE INITIAL
LY DEFERRED,
"choice" varchar(200) NOT NULL,
"votes" integer NOT NULL
)
;
COMMIT;


I'm not sure where to go from here or how to figure out what the issue
is here. Hoping someone here can provide some guidance.

Thx,
D.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---