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: 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 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:
>>&

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-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&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f60327d-9418-4084-8efd-c91ca1474f38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.