Re: ImportError:

2022-12-23 Thread Raeesh Rayeen
ImportError: cannot import name 'views' from 'it_training_platform'

for the above error please write like that:

import app_name from views

note:
 we have two things project name and app_name when we are creating
Django project
  That app_name import.

Thanks




On Fri, 23 Dec 2022 at 20:58, 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 23/12/2022 12.36, JOSEPH OCHELEBE O. wrote:
> > Am getting this errors bellow when i tried to run my Django project
> >
> >  from . import views
> > ImportError: cannot import name 'views' from 'it_training_platform'
> > (C:\Users\Dreams
> >
> Reality\Desktop\Django-project\it_training_platform\it_training_platform\__init__.py)
> >
>
> This will guide you in the right direction:
>
> https://www.propublica.org/nerds/how-to-ask-programming-questions
>
> Kind regards,
> Kasper Laudrup
>
> --
> 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/fb21bd74-5eb8-d331-ad97-b1ca1e1d94c1%40stacktrace.dk
> .
>

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


Re: ImportError:

2022-12-23 Thread 'Kasper Laudrup' via Django users

On 23/12/2022 12.36, JOSEPH OCHELEBE O. wrote:

Am getting this errors bellow when i tried to run my Django project

     from . import views
ImportError: cannot import name 'views' from 'it_training_platform' 
(C:\Users\Dreams 
Reality\Desktop\Django-project\it_training_platform\it_training_platform\__init__.py)




This will guide you in the right direction:

https://www.propublica.org/nerds/how-to-ask-programming-questions

Kind regards,
Kasper Laudrup

--
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/fb21bd74-5eb8-d331-ad97-b1ca1e1d94c1%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Luqman Lawal
Okay

On Thu, Sep 1, 2022, 4:21 PM Ashish Rawat 
wrote:

> There is error in line number 3 you are importing the module from restapi
> but you should take that from model
>
> On Thu, Sep 1, 2022, 7:30 PM Pooja Kumari  wrote:
>
>> Can anyone explain this error?
>>
>> --
>> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CAJf3Dr%2Bipj0t3zXoA3C1D-FF%3DCe0BvJH-Xd1OWneYF9e%2B1Pu%2Bg%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/CAHj0e%2BT2H2KOiPFv%3DN2w%2BrJrvmfCoSvErqbwD6%3DK%3Dcm3jUXWZQ%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread M Adnan
>From webapp.models import employee

On Thu, 1 Sep 2022, 7:02 pm Pooja Kumari,  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CABNyTSqR989ABXXJj3T0iZaH595Vk31hmUR2NiJOSyyOZeBrZw%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Shams Ulhaq
>From . models import employees
Then use in serializer

On Thu, 1 Sep 2022, 19:02 Pooja Kumari,  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CACbcXAVj1R83-VmWJ6m%3DT2VL8Lu8R%3D8T0kpx03NrCbnxexAL2g%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Pooja Kumari
Understood.
Thank you very much

On Thu, Sep 1, 2022, 7:45 PM MAHESH KUMAR 
wrote:

> You can write  your serializers in 3rd line
>
> From .models import employees
>
> Thanks,
> Mahesh
>
> On Thu, Sep 1, 2022, 19:30 Pooja Kumari  wrote:
>
>> Can anyone explain this error?
>>
>> --
>> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CAPvC_H847-a5M3fdmTmWRT%2BU3ZESG-RqHDA3h6JBQXnGFe0a_w%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/CAHYvwbVQ4Rywj-N0E4H%2Bnk9c8C1pNYkwWESBx2aAvo%2B29sRpAQ%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread subin
Thanks again for the info.

On Thu, Sep 1, 2022 at 4:21 PM Ashish Rawat 
wrote:

> There is error in line number 3 you are importing the module from restapi
> but you should take that from model
>
> On Thu, Sep 1, 2022, 7:30 PM Pooja Kumari  wrote:
>
>> Can anyone explain this error?
>>
>> --
>> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CAJf3Dr%2Bipj0t3zXoA3C1D-FF%3DCe0BvJH-Xd1OWneYF9e%2B1Pu%2Bg%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/CAJnMy6ePf1VWGFTJgXr4mEHbm78AJMC6PoWVB98zbQL_KpDoaQ%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Ashish Rawat
There is error in line number 3 you are importing the module from restapi
but you should take that from model

On Thu, Sep 1, 2022, 7:30 PM Pooja Kumari  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CAJf3Dr%2Bipj0t3zXoA3C1D-FF%3DCe0BvJH-Xd1OWneYF9e%2B1Pu%2Bg%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread Akash Kundoo
>From where you're importing employees? Check that?

On Thu, 1 Sep, 2022, 7:31 pm Pooja Kumari,  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CACTgikHJx6PUikfv6apyxe0suW%3D9tZNZCNy-0A%3D%3DXBv6%3DR2FyA%40mail.gmail.com.


Re: ImportError: cannot import name 'employees' from 'rest_framework'

2022-09-01 Thread MAHESH KUMAR
You can write  your serializers in 3rd line

>From .models import employees

Thanks,
Mahesh

On Thu, Sep 1, 2022, 19:30 Pooja Kumari  wrote:

> Can anyone explain this error?
>
> --
> 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/2920648e-f12c-4e26-a089-59a196fd653an%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/CAPvC_H847-a5M3fdmTmWRT%2BU3ZESG-RqHDA3h6JBQXnGFe0a_w%40mail.gmail.com.


Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Thank you for your reply

I did that again I am getting this error
___
TestViews.test_product_detail_authenticated


klass = , args = (), kwargs =
{'pk': 22}, queryset = ]>

def get_object_or_404(klass, *args, **kwargs):
"""
Use get() to return an object, or raise a Http404 exception if the
object
does not exist.

klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword arguments are used in the get() query.

Like with QuerySet.get(), MultipleObjectsReturned is raised if more
than
one object is found.
"""
queryset = _get_queryset(klass)
if not hasattr(queryset, 'get'):
klass__name = klass.__name__ if isinstance(klass, type) else
klass.__class__.__name__
raise ValueError(
"First argument to get_object_or_404() must be a Model,
Manager, "
"or QuerySet, not '%s'." % klass__name
)
try:
>   return queryset.get(*args, **kwargs)

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\django\shortcuts.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _

self = ]>, args =
(), kwargs = {'pk': 22}, clone = , limit = 21, num = 0

def get(self, *args, **kwargs):
"""
Perform the query and return a single object matching the given
keyword arguments.
"""
clone = self._chain() if self.query.combinator else
self.filter(*args, **kwargs)
if self.query.can_filter() and not self.query.distinct_fields:
clone = clone.order_by()
limit = None
if not clone.query.select_for_update or
connections[clone.db].features.supports_select_for_update_with_limit:
limit = MAX_GET_RESULTS
clone.query.set_limits(high=limit)
num = len(clone)
if num == 1:
return clone._result_cache[0]
if not num:
>   raise self.model.DoesNotExist(
"%s matching query does not exist." %
self.model._meta.object_name
)
E   pages.models.vk_ls_product_search.DoesNotExist:
vk_ls_product_search matching query does not exist.

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\django\db\models\query.py:415:
DoesNotExist

During handling of the above exception, another exception occurred:

self = 

def test_product_detail_authenticated(self):
mixer.blend('pages.vk_ls_product_search')
path = reverse('ProductDetails_ls', kwargs={'pk': 22})
request = RequestFactory().get(path)
request.user = mixer.blend(vk_customer)

>   response = onClickSearch.ProductDetails_ls(request, pk=22)

pages\tests\test_views.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
pages\views.py:2795: in ProductDetails_ls
product_ls = get_object_or_404(vk_ls_product_search, pk=pk)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _

klass = , args = (), kwargs =
{'pk': 22}, queryset = ]>

def get_object_or_404(klass, *args, **kwargs):
"""
Use get() to return an object, or raise a Http404 exception if the
object
does not exist.

klass may be a Model, Manager, or QuerySet object. All other passed
arguments and keyword arguments are used in the get() query.

Like with QuerySet.get(), MultipleObjectsReturned is raised if more
than
one object is found.
"""
queryset = _get_queryset(klass)
if not hasattr(queryset, 'get'):
klass__name = klass.__name__ if isinstance(klass, type) else
klass.__class__.__name__
raise ValueError(
"First argument to get_object_or_404() must be a Model,
Manager, "
"or QuerySet, not '%s'." % klass__name
)
try:
return queryset.get(*args, **kwargs)
except queryset.model.DoesNotExist:
>   raise Http404('No %s matches the given query.' %
queryset.model._meta.object_name)
E   django.http.response.Http404: No vk_ls_product_search matches
the given query.

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\django\shortcuts.py:78:
Http404


Please can you help me to solve this error too , Thank you


On Fri, Oct 16, 2020 at 4:11 PM Shahprogrammer  wrote:

> You have created a class named  onClickSearch  with method
> ProductDetails . So you can't import a method of a class. To use the method
> you need to import class.
> So in place of importing  from 

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Shahprogrammer
You have created a class named  onClickSearch  with method  
ProductDetails . So you can't import a method of a class. To use the method 
you need to import class.
So in place of importing  from pages.views import ProductDetails  in 
test_views.py do from pages.views import onClickSearch  & then use it's 
method as onClickSearch. ProductDetails   as per your need in your code 

On Friday, 16 October, 2020 at 3:33:11 pm UTC+5:30 
sali...@rohteksolutions.com wrote:

> Inside pages folder I already have views.py 
>
> Thanks
> ~salima
>
> On Fri, Oct 16, 2020 at 1:28 PM Akinfolarin Stephen <
> akinfolar...@gmail.com> wrote:
>
>> The problem is you are trying to import views from where you have not 
>> created it I guess the page is  a folder then create the views.py inside of 
>> it
>>
>> On Fri, Oct 16, 2020, 08:10 Salima Begum  
>> wrote:
>>
>>> urls.py
>>>
>>>  path('ProductDetails/', views.onClickSearch.ProductDetails, 
>>> name='ProductDetails'),
>>>
>>> views.py
>>>
>>>
>>> class onClickSearch():
>>>
>>> def ProductDetails(request, id):
>>> try:
>>> email = request.session.get('email')
>>> proddtls = vk_master_table.objects.filter(id=id).first()
>>> if proddtls:
>>> banners = Extras().bestDeals_cat(proddtls.category_desc)
>>>
>>> # print(banners.product_name)
>>> except Exception as e:
>>> logging.error(e)
>>> return render(request, "ProductDetails.html", {'error': 
>>> error, 'form': HomeForm(),
>>>'time': 
>>> settings.SESSION_IDLE_TIMEOUT,
>>>'name': 
>>> first_last_initial(email),
>>>'msg_count': 
>>> msg_count_cl(email),
>>>'fullname': 
>>> fullname(email), 'ProductDetails': proddtls,
>>>'signinForm': 
>>> SigninForm(), 'signupForm': CustomerForm()})
>>> return render(request, "ProductDetails.html", {'ProductDetails': 
>>> proddtls, 'fbanners': banners,
>>>'form': 
>>> HomeForm(), 'signinForm': SigninForm(),
>>>'name': 
>>> first_last_initial(email),
>>>'msg_count': 
>>> msg_count_cl(email),
>>>'fullname': 
>>> fullname(email),
>>>'time': 
>>> settings.SESSION_IDLE_TIMEOUT,
>>>'signupForm': 
>>> CustomerForm()})
>>>
>>>
>>>
>>>
>>> On Fri, Oct 16, 2020 at 12:32 PM Dhwanil Shah  wrote:
>>>
 Can you post your views.py code

 On Fri, 16 Oct 2020 at 12:26, Salima Begum  
 wrote:

> Hi all,
> vikreya
> mysite
> .cache
> .idea
>.pytest_cache
> logs
> media
> mysite
> __init__.py
>manage.py
>settings.py
>urls.py
>wsgi.py
>  pages
> .cache
> migrations
> static
> templates
> tests
> test_views.py
>__init__.py 
> admin.py
> apps.py
> cron.py
> Forms.py
>functions.py
>models.py
>   urls.py
>   views.py
>
> On Fri, Oct 16, 2020 at 12:09 PM Salima Begum <
> sali...@rohteksolutions.com> wrote:
>
>> Hi  @Akinfolarin Stephen,
>>
>>
>>
>> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
>> akinfolar...@gmail.com> wrote:
>>
>>> First I will like you to tell me the folder where test.py is and 
>>> views.py
>>>
>>> On Fri, Oct 16, 2020, 06:27 Salima Begum <
>>> sali...@rohteksolutions.com> wrote:
>>>
 Hi all,

 I have written test case for views for details page. Here is below 
 code I have written 

 ```
 from django.test import RequestFactory
 from django.urls import reverse
 from django.contrib.auth.models import User
 from pages.models import vk_customer
 from mixer.backend.django import mixer
 import pytest

 from pages.views import ProductDetails


 @pytest.mark.django_db
 class TestViews:

 def test_product_detail_authenticated(self):
 mixer.blend('pages.vk_master_table')
 path = reverse('detail', kwargs={'pk': 1516})
 request = RequestFactory().get(path)
 

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Inside pages folder I already have views.py

Thanks
~salima

On Fri, Oct 16, 2020 at 1:28 PM Akinfolarin Stephen <
akinfolarinsteph...@gmail.com> wrote:

> The problem is you are trying to import views from where you have not
> created it I guess the page is  a folder then create the views.py inside of
> it
>
> On Fri, Oct 16, 2020, 08:10 Salima Begum 
> wrote:
>
>> urls.py
>>
>>  path('ProductDetails/', views.onClickSearch.ProductDetails,
>> name='ProductDetails'),
>>
>> views.py
>>
>>
>> class onClickSearch():
>>
>> def ProductDetails(request, id):
>> try:
>> email = request.session.get('email')
>> proddtls = vk_master_table.objects.filter(id=id).first()
>> if proddtls:
>> banners = Extras().bestDeals_cat(proddtls.category_desc)
>>
>> # print(banners.product_name)
>> except Exception as e:
>> logging.error(e)
>> return render(request, "ProductDetails.html", {'error':
>> error, 'form': HomeForm(),
>>'time':
>> settings.SESSION_IDLE_TIMEOUT,
>>'name':
>> first_last_initial(email),
>>'msg_count':
>> msg_count_cl(email),
>>'fullname':
>> fullname(email), 'ProductDetails': proddtls,
>>'signinForm':
>> SigninForm(), 'signupForm': CustomerForm()})
>> return render(request, "ProductDetails.html", {'ProductDetails':
>> proddtls, 'fbanners': banners,
>>'form':
>> HomeForm(), 'signinForm': SigninForm(),
>>'name':
>> first_last_initial(email),
>>'msg_count':
>> msg_count_cl(email),
>>'fullname':
>> fullname(email),
>>'time':
>> settings.SESSION_IDLE_TIMEOUT,
>>'signupForm':
>> CustomerForm()})
>>
>>
>>
>>
>> On Fri, Oct 16, 2020 at 12:32 PM Dhwanil Shah 
>> wrote:
>>
>>> Can you post your views.py code
>>>
>>> On Fri, 16 Oct 2020 at 12:26, Salima Begum 
>>> wrote:
>>>
 Hi all,
 vikreya
 mysite
 .cache
 .idea
.pytest_cache
 logs
 media
 mysite
 __init__.py
manage.py
settings.py
urls.py
wsgi.py
  pages
 .cache
 migrations
 static
 templates
 tests
 test_views.py
__init__.py
 admin.py
 apps.py
 cron.py
 Forms.py
functions.py
models.py
   urls.py
   views.py

 On Fri, Oct 16, 2020 at 12:09 PM Salima Begum <
 salim...@rohteksolutions.com> wrote:

> Hi  @Akinfolarin Stephen,
>
>
>
> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
> akinfolarinsteph...@gmail.com> wrote:
>
>> First I will like you to tell me the folder where test.py is and
>> views.py
>>
>> On Fri, Oct 16, 2020, 06:27 Salima Begum <
>> salim...@rohteksolutions.com> wrote:
>>
>>> Hi all,
>>>
>>> I have written test case for views for details page. Here is below
>>> code I have written
>>>
>>> ```
>>> from django.test import RequestFactory
>>> from django.urls import reverse
>>> from django.contrib.auth.models import User
>>> from pages.models import vk_customer
>>> from mixer.backend.django import mixer
>>> import pytest
>>>
>>> from pages.views import ProductDetails
>>>
>>>
>>> @pytest.mark.django_db
>>> class TestViews:
>>>
>>> def test_product_detail_authenticated(self):
>>> mixer.blend('pages.vk_master_table')
>>> path = reverse('detail', kwargs={'pk': 1516})
>>> request = RequestFactory().get(path)
>>> request.user = mixer.blend(vk_customer)
>>>
>>> response = ProductDetails(request, pk=1516)
>>> print(response)
>>> assert response.status_code == 200
>>> ```
>>> *This the error i am getting.*
>>>  ERROR
>>> collecting pages/tests/test_views.py
>>> 
>>> ImportError while importing test module
>>> 'H:\vikreya\mysite\pages\tests\test_views.py'.
>>> Hint: make sure your test modules/packages have valid Python names.
>>> 

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Akinfolarin Stephen
The problem is you are trying to import views from where you have not
created it I guess the page is  a folder then create the views.py inside of
it

On Fri, Oct 16, 2020, 08:10 Salima Begum 
wrote:

> urls.py
>
>  path('ProductDetails/', views.onClickSearch.ProductDetails,
> name='ProductDetails'),
>
> views.py
>
>
> class onClickSearch():
>
> def ProductDetails(request, id):
> try:
> email = request.session.get('email')
> proddtls = vk_master_table.objects.filter(id=id).first()
> if proddtls:
> banners = Extras().bestDeals_cat(proddtls.category_desc)
>
> # print(banners.product_name)
> except Exception as e:
> logging.error(e)
> return render(request, "ProductDetails.html", {'error': error,
> 'form': HomeForm(),
>'time':
> settings.SESSION_IDLE_TIMEOUT,
>'name':
> first_last_initial(email),
>'msg_count':
> msg_count_cl(email),
>'fullname':
> fullname(email), 'ProductDetails': proddtls,
>'signinForm':
> SigninForm(), 'signupForm': CustomerForm()})
> return render(request, "ProductDetails.html", {'ProductDetails':
> proddtls, 'fbanners': banners,
>'form': HomeForm(),
> 'signinForm': SigninForm(),
>'name':
> first_last_initial(email),
>'msg_count':
> msg_count_cl(email),
>'fullname':
> fullname(email),
>'time':
> settings.SESSION_IDLE_TIMEOUT,
>'signupForm':
> CustomerForm()})
>
>
>
>
> On Fri, Oct 16, 2020 at 12:32 PM Dhwanil Shah  wrote:
>
>> Can you post your views.py code
>>
>> On Fri, 16 Oct 2020 at 12:26, Salima Begum 
>> wrote:
>>
>>> Hi all,
>>> vikreya
>>> mysite
>>> .cache
>>> .idea
>>>.pytest_cache
>>> logs
>>> media
>>> mysite
>>> __init__.py
>>>manage.py
>>>settings.py
>>>urls.py
>>>wsgi.py
>>>  pages
>>> .cache
>>> migrations
>>> static
>>> templates
>>> tests
>>> test_views.py
>>>__init__.py
>>> admin.py
>>> apps.py
>>> cron.py
>>> Forms.py
>>>functions.py
>>>models.py
>>>   urls.py
>>>   views.py
>>>
>>> On Fri, Oct 16, 2020 at 12:09 PM Salima Begum <
>>> salim...@rohteksolutions.com> wrote:
>>>
 Hi  @Akinfolarin Stephen,



 On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
 akinfolarinsteph...@gmail.com> wrote:

> First I will like you to tell me the folder where test.py is and
> views.py
>
> On Fri, Oct 16, 2020, 06:27 Salima Begum 
> wrote:
>
>> Hi all,
>>
>> I have written test case for views for details page. Here is below
>> code I have written
>>
>> ```
>> from django.test import RequestFactory
>> from django.urls import reverse
>> from django.contrib.auth.models import User
>> from pages.models import vk_customer
>> from mixer.backend.django import mixer
>> import pytest
>>
>> from pages.views import ProductDetails
>>
>>
>> @pytest.mark.django_db
>> class TestViews:
>>
>> def test_product_detail_authenticated(self):
>> mixer.blend('pages.vk_master_table')
>> path = reverse('detail', kwargs={'pk': 1516})
>> request = RequestFactory().get(path)
>> request.user = mixer.blend(vk_customer)
>>
>> response = ProductDetails(request, pk=1516)
>> print(response)
>> assert response.status_code == 200
>> ```
>> *This the error i am getting.*
>>  ERROR
>> collecting pages/tests/test_views.py
>> 
>> ImportError while importing test module
>> 'H:\vikreya\mysite\pages\tests\test_views.py'.
>> Hint: make sure your test modules/packages have valid Python names.
>> Traceback:
>> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
>> in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>> pages\tests\test_views.py:8: in 
>> from pages.views import ProductDetails
>> E   ImportError: cannot import name 

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
urls.py

 path('ProductDetails/', views.onClickSearch.ProductDetails,
name='ProductDetails'),

views.py


class onClickSearch():

def ProductDetails(request, id):
try:
email = request.session.get('email')
proddtls = vk_master_table.objects.filter(id=id).first()
if proddtls:
banners = Extras().bestDeals_cat(proddtls.category_desc)

# print(banners.product_name)
except Exception as e:
logging.error(e)
return render(request, "ProductDetails.html", {'error': error,
'form': HomeForm(),
   'time':
settings.SESSION_IDLE_TIMEOUT,
   'name':
first_last_initial(email),
   'msg_count':
msg_count_cl(email),
   'fullname':
fullname(email), 'ProductDetails': proddtls,
   'signinForm':
SigninForm(), 'signupForm': CustomerForm()})
return render(request, "ProductDetails.html", {'ProductDetails':
proddtls, 'fbanners': banners,
   'form': HomeForm(),
'signinForm': SigninForm(),
   'name':
first_last_initial(email),
   'msg_count':
msg_count_cl(email),
   'fullname':
fullname(email),
   'time':
settings.SESSION_IDLE_TIMEOUT,
   'signupForm':
CustomerForm()})




On Fri, Oct 16, 2020 at 12:32 PM Dhwanil Shah  wrote:

> Can you post your views.py code
>
> On Fri, 16 Oct 2020 at 12:26, Salima Begum 
> wrote:
>
>> Hi all,
>> vikreya
>> mysite
>> .cache
>> .idea
>>.pytest_cache
>> logs
>> media
>> mysite
>> __init__.py
>>manage.py
>>settings.py
>>urls.py
>>wsgi.py
>>  pages
>> .cache
>> migrations
>> static
>> templates
>> tests
>> test_views.py
>>__init__.py
>> admin.py
>> apps.py
>> cron.py
>> Forms.py
>>functions.py
>>models.py
>>   urls.py
>>   views.py
>>
>> On Fri, Oct 16, 2020 at 12:09 PM Salima Begum <
>> salim...@rohteksolutions.com> wrote:
>>
>>> Hi  @Akinfolarin Stephen,
>>>
>>>
>>>
>>> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
>>> akinfolarinsteph...@gmail.com> wrote:
>>>
 First I will like you to tell me the folder where test.py is and
 views.py

 On Fri, Oct 16, 2020, 06:27 Salima Begum 
 wrote:

> Hi all,
>
> I have written test case for views for details page. Here is below
> code I have written
>
> ```
> from django.test import RequestFactory
> from django.urls import reverse
> from django.contrib.auth.models import User
> from pages.models import vk_customer
> from mixer.backend.django import mixer
> import pytest
>
> from pages.views import ProductDetails
>
>
> @pytest.mark.django_db
> class TestViews:
>
> def test_product_detail_authenticated(self):
> mixer.blend('pages.vk_master_table')
> path = reverse('detail', kwargs={'pk': 1516})
> request = RequestFactory().get(path)
> request.user = mixer.blend(vk_customer)
>
> response = ProductDetails(request, pk=1516)
> print(response)
> assert response.status_code == 200
> ```
> *This the error i am getting.*
>  ERROR
> collecting pages/tests/test_views.py
> 
> ImportError while importing test module
> 'H:\vikreya\mysite\pages\tests\test_views.py'.
> Hint: make sure your test modules/packages have valid Python names.
> Traceback:
> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
> in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> pages\tests\test_views.py:8: in 
> from pages.views import ProductDetails
> E   ImportError: cannot import name 'ProductDetails' from
> 'pages.views' (H:\vikreya\mysite\pages\views.py)
>
> Please help me out to solve this error,
>
> Thank you,
> ~Salima
>
> --
> 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: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Shahprogrammer
Can you post your code of views.py

On Friday, 16 October, 2020 at 12:27:19 pm UTC+5:30 
sali...@rohteksolutions.com wrote:

> Hi all,
> vikreya
> mysite
> .cache
> .idea
>.pytest_cache
> logs
> media
> mysite
>
> __init__.py
>manage.py
>settings.py
>urls.py
>wsgi.py
>  pages
> .cache
> migrations
> static
> templates
> tests
> test_views.py
>__init__.py 
> admin.py
> apps.py
> cron.py
> Forms.py
>functions.py
>models.py
>   urls.py
>   views.py
>
> On Fri, Oct 16, 2020 at 12:09 PM Salima Begum  
> wrote:
>
>> Hi  @Akinfolarin Stephen,
>>
>>
>>
>> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
>> akinfolar...@gmail.com> wrote:
>>
>>> First I will like you to tell me the folder where test.py is and views.py
>>>
>>> On Fri, Oct 16, 2020, 06:27 Salima Begum  
>>> wrote:
>>>
 Hi all,

 I have written test case for views for details page. Here is below code 
 I have written 

 ```
 from django.test import RequestFactory
 from django.urls import reverse
 from django.contrib.auth.models import User
 from pages.models import vk_customer
 from mixer.backend.django import mixer
 import pytest

 from pages.views import ProductDetails


 @pytest.mark.django_db
 class TestViews:

 def test_product_detail_authenticated(self):
 mixer.blend('pages.vk_master_table')
 path = reverse('detail', kwargs={'pk': 1516})
 request = RequestFactory().get(path)
 request.user = mixer.blend(vk_customer)

 response = ProductDetails(request, pk=1516)
 print(response)
 assert response.status_code == 200
 ```
 *This the error i am getting.*
  ERROR 
 collecting pages/tests/test_views.py 
 
 ImportError while importing test module 
 'H:\vikreya\mysite\pages\tests\test_views.py'.
 Hint: make sure your test modules/packages have valid Python names.
 Traceback:
 c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
  
 in import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 pages\tests\test_views.py:8: in 
 from pages.views import ProductDetails
 E   ImportError: cannot import name 'ProductDetails' from 'pages.views' 
 (H:\vikreya\mysite\pages\views.py)

 Please help me out to solve this error,

 Thank you,
 ~Salima

 -- 
 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 view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%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/6ccb7a89-f757-4522-946e-dcc6ee0321e7n%40googlegroups.com.


Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Dhwanil Shah
Can you post your views.py code

On Fri, 16 Oct 2020 at 12:26, Salima Begum 
wrote:

> Hi all,
> vikreya
> mysite
> .cache
> .idea
>.pytest_cache
> logs
> media
> mysite
> __init__.py
>manage.py
>settings.py
>urls.py
>wsgi.py
>  pages
> .cache
> migrations
> static
> templates
> tests
> test_views.py
>__init__.py
> admin.py
> apps.py
> cron.py
> Forms.py
>functions.py
>models.py
>   urls.py
>   views.py
>
> On Fri, Oct 16, 2020 at 12:09 PM Salima Begum <
> salim...@rohteksolutions.com> wrote:
>
>> Hi  @Akinfolarin Stephen,
>>
>>
>>
>> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
>> akinfolarinsteph...@gmail.com> wrote:
>>
>>> First I will like you to tell me the folder where test.py is and views.py
>>>
>>> On Fri, Oct 16, 2020, 06:27 Salima Begum 
>>> wrote:
>>>
 Hi all,

 I have written test case for views for details page. Here is below code
 I have written

 ```
 from django.test import RequestFactory
 from django.urls import reverse
 from django.contrib.auth.models import User
 from pages.models import vk_customer
 from mixer.backend.django import mixer
 import pytest

 from pages.views import ProductDetails


 @pytest.mark.django_db
 class TestViews:

 def test_product_detail_authenticated(self):
 mixer.blend('pages.vk_master_table')
 path = reverse('detail', kwargs={'pk': 1516})
 request = RequestFactory().get(path)
 request.user = mixer.blend(vk_customer)

 response = ProductDetails(request, pk=1516)
 print(response)
 assert response.status_code == 200
 ```
 *This the error i am getting.*
  ERROR
 collecting pages/tests/test_views.py
 
 ImportError while importing test module
 'H:\vikreya\mysite\pages\tests\test_views.py'.
 Hint: make sure your test modules/packages have valid Python names.
 Traceback:
 c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
 in import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 pages\tests\test_views.py:8: in 
 from pages.views import ProductDetails
 E   ImportError: cannot import name 'ProductDetails' from 'pages.views'
 (H:\vikreya\mysite\pages\views.py)

 Please help me out to solve this error,

 Thank you,
 ~Salima

 --
 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/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%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/CAMSz6bm1WKP8qjSzSz5Ouhf%2Bc2K9-pLM4Wc%3DfgSsyUek3KKmqA%40mail.gmail.com
> 
> .
>


-- 

*Dhwanil J Shah*
*Near Ashok agency, *
*Madanwad ,*

*Valsad 396001*
*email:dhwani...@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 

Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Hi all,
vikreya
mysite
.cache
.idea
   .pytest_cache
logs
media
mysite
__init__.py
   manage.py
   settings.py
   urls.py
   wsgi.py
 pages
.cache
migrations
static
templates
tests
test_views.py
   __init__.py
admin.py
apps.py
cron.py
Forms.py
   functions.py
   models.py
  urls.py
  views.py

On Fri, Oct 16, 2020 at 12:09 PM Salima Begum 
wrote:

> Hi  @Akinfolarin Stephen,
>
>
>
> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
> akinfolarinsteph...@gmail.com> wrote:
>
>> First I will like you to tell me the folder where test.py is and views.py
>>
>> On Fri, Oct 16, 2020, 06:27 Salima Begum 
>> wrote:
>>
>>> Hi all,
>>>
>>> I have written test case for views for details page. Here is below code
>>> I have written
>>>
>>> ```
>>> from django.test import RequestFactory
>>> from django.urls import reverse
>>> from django.contrib.auth.models import User
>>> from pages.models import vk_customer
>>> from mixer.backend.django import mixer
>>> import pytest
>>>
>>> from pages.views import ProductDetails
>>>
>>>
>>> @pytest.mark.django_db
>>> class TestViews:
>>>
>>> def test_product_detail_authenticated(self):
>>> mixer.blend('pages.vk_master_table')
>>> path = reverse('detail', kwargs={'pk': 1516})
>>> request = RequestFactory().get(path)
>>> request.user = mixer.blend(vk_customer)
>>>
>>> response = ProductDetails(request, pk=1516)
>>> print(response)
>>> assert response.status_code == 200
>>> ```
>>> *This the error i am getting.*
>>>  ERROR
>>> collecting pages/tests/test_views.py
>>> 
>>> ImportError while importing test module
>>> 'H:\vikreya\mysite\pages\tests\test_views.py'.
>>> Hint: make sure your test modules/packages have valid Python names.
>>> Traceback:
>>> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
>>> in import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>> pages\tests\test_views.py:8: in 
>>> from pages.views import ProductDetails
>>> E   ImportError: cannot import name 'ProductDetails' from 'pages.views'
>>> (H:\vikreya\mysite\pages\views.py)
>>>
>>> Please help me out to solve this error,
>>>
>>> Thank you,
>>> ~Salima
>>>
>>> --
>>> 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/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%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/CAMSz6bm1WKP8qjSzSz5Ouhf%2Bc2K9-pLM4Wc%3DfgSsyUek3KKmqA%40mail.gmail.com.


Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Hi all,

my project structure
vikreya
mysite
.cache
.idea
.pytest_cache
logs
media
mysute
__init__.py
manage.py
settings.py
urls.py
wsgi.py
pages
.cache
migrations
static
templates
tests
test_views.py
__init__.py
admin.py
apps.py
cron.py
Forms.py
functions.py
models.py
urls.py
views.py

On Fri, Oct 16, 2020 at 12:09 PM Salima Begum 
wrote:

> Hi  @Akinfolarin Stephen,
>
>
>
> On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
> akinfolarinsteph...@gmail.com> wrote:
>
>> First I will like you to tell me the folder where test.py is and views.py
>>
>> On Fri, Oct 16, 2020, 06:27 Salima Begum 
>> wrote:
>>
>>> Hi all,
>>>
>>> I have written test case for views for details page. Here is below code
>>> I have written
>>>
>>> ```
>>> from django.test import RequestFactory
>>> from django.urls import reverse
>>> from django.contrib.auth.models import User
>>> from pages.models import vk_customer
>>> from mixer.backend.django import mixer
>>> import pytest
>>>
>>> from pages.views import ProductDetails
>>>
>>>
>>> @pytest.mark.django_db
>>> class TestViews:
>>>
>>> def test_product_detail_authenticated(self):
>>> mixer.blend('pages.vk_master_table')
>>> path = reverse('detail', kwargs={'pk': 1516})
>>> request = RequestFactory().get(path)
>>> request.user = mixer.blend(vk_customer)
>>>
>>> response = ProductDetails(request, pk=1516)
>>> print(response)
>>> assert response.status_code == 200
>>> ```
>>> *This the error i am getting.*
>>>  ERROR
>>> collecting pages/tests/test_views.py
>>> 
>>> ImportError while importing test module
>>> 'H:\vikreya\mysite\pages\tests\test_views.py'.
>>> Hint: make sure your test modules/packages have valid Python names.
>>> Traceback:
>>> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
>>> in import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>> pages\tests\test_views.py:8: in 
>>> from pages.views import ProductDetails
>>> E   ImportError: cannot import name 'ProductDetails' from 'pages.views'
>>> (H:\vikreya\mysite\pages\views.py)
>>>
>>> Please help me out to solve this error,
>>>
>>> Thank you,
>>> ~Salima
>>>
>>> --
>>> 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/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%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/CAMSz6b%3DbFwx8O05g0xh6Nj35iVxZu72Us6CT5aTLiTAkeUGB-A%40mail.gmail.com.


Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-16 Thread Salima Begum
Hi  @Akinfolarin Stephen,



On Fri, Oct 16, 2020 at 11:10 AM Akinfolarin Stephen <
akinfolarinsteph...@gmail.com> wrote:

> First I will like you to tell me the folder where test.py is and views.py
>
> On Fri, Oct 16, 2020, 06:27 Salima Begum 
> wrote:
>
>> Hi all,
>>
>> I have written test case for views for details page. Here is below code I
>> have written
>>
>> ```
>> from django.test import RequestFactory
>> from django.urls import reverse
>> from django.contrib.auth.models import User
>> from pages.models import vk_customer
>> from mixer.backend.django import mixer
>> import pytest
>>
>> from pages.views import ProductDetails
>>
>>
>> @pytest.mark.django_db
>> class TestViews:
>>
>> def test_product_detail_authenticated(self):
>> mixer.blend('pages.vk_master_table')
>> path = reverse('detail', kwargs={'pk': 1516})
>> request = RequestFactory().get(path)
>> request.user = mixer.blend(vk_customer)
>>
>> response = ProductDetails(request, pk=1516)
>> print(response)
>> assert response.status_code == 200
>> ```
>> *This the error i am getting.*
>>  ERROR
>> collecting pages/tests/test_views.py
>> 
>> ImportError while importing test module
>> 'H:\vikreya\mysite\pages\tests\test_views.py'.
>> Hint: make sure your test modules/packages have valid Python names.
>> Traceback:
>> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
>> in import_module
>> return _bootstrap._gcd_import(name[level:], package, level)
>> pages\tests\test_views.py:8: in 
>> from pages.views import ProductDetails
>> E   ImportError: cannot import name 'ProductDetails' from 'pages.views'
>> (H:\vikreya\mysite\pages\views.py)
>>
>> Please help me out to solve this error,
>>
>> Thank you,
>> ~Salima
>>
>> --
>> 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/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%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/CAMSz6bkTxp%3DabagmH%2BzwTzhYcusXzubYOLVOkh-6wujxb5L%2B3Q%40mail.gmail.com.


Re: ImportError: cannot import name 'ProductDetails' from 'pages.views'

2020-10-15 Thread Akinfolarin Stephen
First I will like you to tell me the folder where test.py is and views.py

On Fri, Oct 16, 2020, 06:27 Salima Begum 
wrote:

> Hi all,
>
> I have written test case for views for details page. Here is below code I
> have written
>
> ```
> from django.test import RequestFactory
> from django.urls import reverse
> from django.contrib.auth.models import User
> from pages.models import vk_customer
> from mixer.backend.django import mixer
> import pytest
>
> from pages.views import ProductDetails
>
>
> @pytest.mark.django_db
> class TestViews:
>
> def test_product_detail_authenticated(self):
> mixer.blend('pages.vk_master_table')
> path = reverse('detail', kwargs={'pk': 1516})
> request = RequestFactory().get(path)
> request.user = mixer.blend(vk_customer)
>
> response = ProductDetails(request, pk=1516)
> print(response)
> assert response.status_code == 200
> ```
> *This the error i am getting.*
>  ERROR
> collecting pages/tests/test_views.py
> 
> ImportError while importing test module
> 'H:\vikreya\mysite\pages\tests\test_views.py'.
> Hint: make sure your test modules/packages have valid Python names.
> Traceback:
> c:\users\user\appdata\local\programs\python\python38\lib\importlib\__init__.py:127:
> in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> pages\tests\test_views.py:8: in 
> from pages.views import ProductDetails
> E   ImportError: cannot import name 'ProductDetails' from 'pages.views'
> (H:\vikreya\mysite\pages\views.py)
>
> Please help me out to solve this error,
>
> Thank you,
> ~Salima
>
> --
> 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/CAMSz6bk187G0NSr%2Bza9RKAFnk475Z8nhxVRF%2BFk4iKtzwLXGxg%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/CAFujGLw%3DTZhX-moO6pdp3Ng%3D4LJZ2UQLfE9Y2GmOGsCpxTyVBQ%40mail.gmail.com.


Re: ImportError: cannot import name 'RemovedInDjango40Warning'

2019-07-04 Thread Andréas Kühne
Hi Dave,

This is the django users mailing list - not the django dev. I think you
would get better help in the django dev mailing list.

Also - are you sure you want to work on developing django, and not just use
django?

Regards,

Andréas


Den ons 3 juli 2019 kl 16:20 skrev Dave Ladeji :

> Please, I need help, I don't understand what this error means and I need a
> way to resolve it. Does anyone have a solution?
>
> For context see pic
>
> --
> 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/1e8c67ec-b153-484d-a30b-17151b0ed5a5%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/CAK4qSCdU5oxkwAstJwjVTgX-%2BYCL5SBbjSTv8pcQ2Cq%2BHNe-WQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-18 Thread James Farris
If you are not using a virtual env, did you install pip3? If so, since you
are using puthon3 -V to get that python version, try running
$ pip3 install django
And see if you get a different result

I think what is happening is when you run pip install it’s referencing
another python version, not python 3.

At least that is what I experienced back before I used virtual envs

On Fri, May 18, 2018 at 9:01 AM Journal-Immo 
wrote:

> Thank you for all your answers
>
> I know my problem with version
>
> So for me it's very strange...
>
> python3 -V
>
> Python 3.5.3
>
> pip install Django==2.0.5
>
> Collecting Django==2.0.5...
>
> Could nt find a version... 1.2.1, 1.2.2 etc and the last one 1.11.13
>
> No matching distribution found fot Django==2.0.5
>
> Do you think Virtual Envirenment will solve my problem ?
>
> Many thank again
>
> Le 18/05/2018 à 16:38, Daniel Hepper a écrit :
>
> Your problem is right here:
>
> > django-admin --version 1.11.13
> You are using Django 1.11. The documentation you are using refers to a
> newer version of Django, version 2.0.
>
> Use the right documentation for your version of Django:
>
> https://docs.djangoproject.com/en/1.11/
>
> You are seeing this specific error because in Django 2.0, you can write
> "from django.urls import include", while in Django 1.11, you have to write
> "from django.conf.urls import include".
>
> Note that using Debian packages, you won't get the latest version of
> Django (or any other Python packages). You might want to consider
> installing the latest version with pip.
>
>
> https://docs.djangoproject.com/en/2.0/topics/install/#installing-official-release
>
> Hope that helps,
> Daniel
>
> On Fri, May 18, 2018 at 4:20 PM, Journal-Immo 
> wrote:
>
>> Thank
>>
>> But (I use debian 9)
>>
>> Apt-get update
>>
>> Apt-get install python python3 python-django
>>
>> django-admin --version 1.11.13
>>
>> Where is the problem ?
>>
>> Le 17/05/2018 à 21:01, Fidel Leon a écrit :
>>
>> You are using the wrong combination of Django and tutorial: “include” is
>> available in Django 2 and up, but you’re using Django 1.11.
>>
>> Fidel Leon
>> fi...@flm.cat
>> Phone: +34 622 26 44 92 
>> GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7
>>
>> El 17 de mayo de 2018 a las 20:56:56, Tristan Demot (
>> cont...@journal-immo.com) escribió:
>>
>> Hello,
>>
>>  I use docs.djangoproject.co/en/2.0
>>  Python 2 7 13
>> Gjango 1.11.13
>>
>> Creating the Polls app OK
>> Write your first view OK
>> But python manage runserver don't work
>> With : python -Wall manage.py test
>> ImportError : cannot import name include
>> If you want to see something, ask me
>> Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%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 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/7e9e643b-6e7e-681c-eed2-dc9ab9be94e6%40journal-immo.com
>> .
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message 

Re: ImportError : cannot import name include

2018-05-18 Thread Journal-Immo

Thank you for all your answers

I know my problem with version

So for me it's very strange...

python3 -V

Python 3.5.3

pip install Django==2.0.5

Collecting Django==2.0.5...

Could nt find a version... 1.2.1, 1.2.2 etc and the last one 1.11.13

No matching distribution found fot Django==2.0.5

Do you think Virtual Envirenment will solve my problem ?

Many thank again


Le 18/05/2018 à 16:38, Daniel Hepper a écrit :


Your problem is right here:

> django-admin --version 1.11.13

You are using Django 1.11. The documentation you are using refers to a 
newer version of Django, version 2.0.


Use the right documentation for your version of Django:

https://docs.djangoproject.com/en/1.11/

You are seeing this specific error because in Django 2.0, you can 
write "from django.urls import include", while in Django 1.11, you 
have to write "from django.conf.urls import include".


Note that using Debian packages, you won't get the latest version of 
Django (or any other Python packages). You might want to consider 
installing the latest version with pip.


https://docs.djangoproject.com/en/2.0/topics/install/#installing-official-release

Hope that helps,
Daniel

On Fri, May 18, 2018 at 4:20 PM, Journal-Immo 
> wrote:


Thank

But (I use debian 9)

Apt-get update

Apt-get install python python3 python-django

django-admin --version 1.11.13

Where is the problem ?


Le 17/05/2018 à 21:01, Fidel Leon a écrit :

You are using the wrong combination of Django and tutorial:
“include” is available in Django 2 and up, but you’re using
Django 1.11.

Fidel Leon
fi...@flm.cat 
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot
(cont...@journal-immo.com )
escribió:


Hello,

 I use docs.djangoproject.co/en/2.0

 Python 2 7 13
Gjango 1.11.13


Creating the Polls app OK


Write your first view OK

But python manage runserver don't work
With : python -Wall manage.py test
ImportError : cannot import name include
If you want to see something, ask me
Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%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 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/7e9e643b-6e7e-681c-eed2-dc9ab9be94e6%40journal-immo.com


Re: ImportError : cannot import name include

2018-05-18 Thread Gerald Brown
Another option to get the current version of Django is to create a file 
called requirements.txt.  In this file enter django on a line, and other 
requirements on other lines.  You can also specify a specific version 
with django==1.11 or any other version by changing the number after the 
==. If this is left off then the latest version will be installed.  Then 
in your virtual environment enter the command 'pip install -r 
requirements.txt'. This will download and install everything that is in 
the requirements.txt.  This file will grow as you enter more requirements.



On 05/18/2018 10:38 PM, Daniel Hepper wrote:


Your problem is right here:

> django-admin --version 1.11.13

You are using Django 1.11. The documentation you are using refers to a 
newer version of Django, version 2.0.


Use the right documentation for your version of Django:

https://docs.djangoproject.com/en/1.11/

You are seeing this specific error because in Django 2.0, you can 
write "from django.urls import include", while in Django 1.11, you 
have to write "from django.conf.urls import include".


Note that using Debian packages, you won't get the latest version of 
Django (or any other Python packages). You might want to consider 
installing the latest version with pip.


https://docs.djangoproject.com/en/2.0/topics/install/#installing-official-release

Hope that helps,
Daniel

On Fri, May 18, 2018 at 4:20 PM, Journal-Immo 
> wrote:


Thank

But (I use debian 9)

Apt-get update

Apt-get install python python3 python-django

django-admin --version 1.11.13

Where is the problem ?


Le 17/05/2018 à 21:01, Fidel Leon a écrit :

You are using the wrong combination of Django and tutorial:
“include” is available in Django 2 and up, but you’re using
Django 1.11.

Fidel Leon
fi...@flm.cat 
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot
(cont...@journal-immo.com )
escribió:


Hello,

 I use docs.djangoproject.co/en/2.0

 Python 2 7 13
Gjango 1.11.13


Creating the Polls app OK


Write your first view OK

But python manage runserver don't work
With : python -Wall manage.py test
ImportError : cannot import name include
If you want to see something, ask me
Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%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 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 

Re: ImportError : cannot import name include

2018-05-18 Thread Fidel Leon
You need to follow the CORRECT tutorial:

https://docs.djangoproject.com/en/1.11/

In the urls.py file, instead of:

from django.contrib import adminfrom django.urls import include, path
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),]

you need this:

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

Please note the django.conf.urls INSTEAD of django.contrib


El vie., 18 may. 2018 a las 16:20, Journal-Immo ()
escribió:

> Thank
>
> But (I use debian 9)
>
> Apt-get update
>
> Apt-get install python python3 python-django
>
> django-admin --version 1.11.13
>
> Where is the problem ?
>
> Le 17/05/2018 à 21:01, Fidel Leon a écrit :
>
> You are using the wrong combination of Django and tutorial: “include” is
> available in Django 2 and up, but you’re using Django 1.11.
>
> Fidel Leon
> fi...@flm.cat
> Phone: +34 622 26 44 92 
> GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7
>
> El 17 de mayo de 2018 a las 20:56:56, Tristan Demot (
> cont...@journal-immo.com) escribió:
>
> Hello,
>
>  I use docs.djangoproject.co/en/2.0
>  Python 2 7 13
> Gjango 1.11.13
>
> Creating the Polls app OK
> Write your first view OK
> But python manage runserver don't work
> With : python -Wall manage.py test
> ImportError : cannot import name include
> If you want to see something, ask me
> Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>


-- 
Fidel Leon
fi...@flm.cat
Phone: +34 622 26 44 92

-- 
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/CAHXg%3DN3nMbGtHLjQO2WoJgr8rjFwO7L5Sm-MRduf4yEPpfH7EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-18 Thread Daniel Hepper
Your problem is right here:

> django-admin --version 1.11.13
You are using Django 1.11. The documentation you are using refers to a
newer version of Django, version 2.0.

Use the right documentation for your version of Django:

https://docs.djangoproject.com/en/1.11/

You are seeing this specific error because in Django 2.0, you can write
"from django.urls import include", while in Django 1.11, you have to write
"from django.conf.urls import include".

Note that using Debian packages, you won't get the latest version of Django
(or any other Python packages). You might want to consider installing the
latest version with pip.

https://docs.djangoproject.com/en/2.0/topics/install/#installing-official-release

Hope that helps,
Daniel

On Fri, May 18, 2018 at 4:20 PM, Journal-Immo 
wrote:

> Thank
>
> But (I use debian 9)
>
> Apt-get update
>
> Apt-get install python python3 python-django
>
> django-admin --version 1.11.13
>
> Where is the problem ?
>
> Le 17/05/2018 à 21:01, Fidel Leon a écrit :
>
> You are using the wrong combination of Django and tutorial: “include” is
> available in Django 2 and up, but you’re using Django 1.11.
>
> Fidel Leon
> fi...@flm.cat
> Phone: +34 622 26 44 92 
> GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7
>
> El 17 de mayo de 2018 a las 20:56:56, Tristan Demot (
> cont...@journal-immo.com) escribió:
>
> Hello,
>
>  I use docs.djangoproject.co/en/2.0
>  Python 2 7 13
> Gjango 1.11.13
>
> Creating the Polls app OK
> Write your first view OK
> But python manage runserver don't work
> With : python -Wall manage.py test
> ImportError : cannot import name include
> If you want to see something, ask me
> Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH
> 6z2RfCzj3384epQKQ%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 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/7e9e643b-6e7e-681c-eed2-dc9ab9be94e6%40journal-immo.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/CAHEnUVWWkRsOVD6AfvDoGS05z33R7qu9SuA2Q1o2se%2BPf0M-xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-18 Thread Journal-Immo

Thank

But (I use debian 9)

Apt-get update

Apt-get install python python3 python-django

django-admin --version 1.11.13

Where is the problem ?


Le 17/05/2018 à 21:01, Fidel Leon a écrit :
You are using the wrong combination of Django and tutorial: “include” 
is available in Django 2 and up, but you’re using Django 1.11.


Fidel Leon
fi...@flm.cat 
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot 
(cont...@journal-immo.com ) escribió:



Hello,

 I use docs.djangoproject.co/en/2.0 
 Python 2 7 13
Gjango 1.11.13


Creating the Polls app OK


Write your first view OK

But python manage runserver don't work
With : python -Wall manage.py test
ImportError : cannot import name include
If you want to see something, ask me
Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%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 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/7e9e643b-6e7e-681c-eed2-dc9ab9be94e6%40journal-immo.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-18 Thread Pranay reddy
  From which package you have imported "include "Sent from my BlackBerry 10 smartphone.From: Tristan DemotSent: Friday 18 May 2018 00:27To: Django usersReply To: django-users@googlegroups.comSubject: ImportError : cannot import name includeHello, I use docs.djangoproject.co/en/2.0 Python 2 7 13Gjango 1.11.13Creating the Polls app OKWrite your first view OKBut python manage runserver don't workWith : python -Wall manage.py testImportError : cannot import name includeIf you want to see something, ask meMany 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/20180518063204.6168661.55095.9943%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-17 Thread Daniel Hepper
You are using Django 1.11 with the tutorial written for Django 2.0. Therr 
should be a version picker on the bottom right of the tutorial.

You are seeing this error because the way to import ‚include’ has changed from 
1.11 to 2.0

Hope that helps,
Daniel

> Am 17.05.2018 um 19:34 schrieb Tristan Demot :
> 
> Hello,
> 
>  I use docs.djangoproject.co/en/2.0
>  Python 2 7 13
> Gjango 1.11.13
> 
> Creating the Polls app OK
> 
> Write your first view OK
> 
> But python manage runserver don't work
> With : python -Wall manage.py test
> 
> ImportError : cannot import name include
> 
> If you want to see something, ask me
> 
> Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/16D40353-23AC-4172-99D7-FD9F7879800C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError : cannot import name include

2018-05-17 Thread Fidel Leon
You are using the wrong combination of Django and tutorial: “include” is
available in Django 2 and up, but you’re using Django 1.11.

Fidel Leon
fi...@flm.cat
Phone: +34 622 26 44 92 
GPG: 2585 30C2 E3C7 7151 0864  946B 7423 F94B 5753 5FC7

El 17 de mayo de 2018 a las 20:56:56, Tristan Demot (
cont...@journal-immo.com) escribió:

Hello,

 I use docs.djangoproject.co/en/2.0
 Python 2 7 13
Gjango 1.11.13

Creating the Polls app OK
Write your first view OK
But python manage runserver don't work
With : python -Wall manage.py test

ImportError : cannot import name include

If you want to see something, ask me

Many 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/1fe7df04-dc85-4a3d-940e-4dde7de31477%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/CAHXg%3DN090U8JCFfdvZJWH1qSoWQgp2mQH6z2RfCzj3384epQKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: importError

2018-05-04 Thread Fidel Leon
>From the look of things, it seems:
-You're following the Django v2.0 tutorial.
-You have installed a Django v1 version.

This is an example with Django v2:

>>> import django
>>> django.get_version()
*'2.0.5' *
>>> from django.urls import include, path
>>>
*[No error]*

And this is an example with Django v1.11

>>> from django import get_version
>>> get_version()
*'1.11.13' *
>>> from django.urls import include, urls
Traceback (most recent call last):
 File "", line 1, in 
*ImportError: cannot import name 'include'*
>>>

So either you upgrade your Django package, or you follow your Django
version's tutorial :)


El vie., 4 may. 2018 a las 15:12,  escribió:

> I run 'python manage.py runserver'.
> but this message appear.
>
> Traceback (most recent call last):
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\autoreload.py",
> l
> ine 228, in wrapper
> fn(*args, **kwargs)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\command
> s\runserver.py", line 124, in inner_run
> self.check(display_num_errors=True)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\base.py
> ", line 359, in check
> include_deployment_checks=include_deployment_checks,
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\base.py
> ", line 346, in _run_checks
> return checks.run_checks(**kwargs)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\registry.py
> ", line 81, in run_checks
> new_errors = check(app_configs=app_configs)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\urls.py",
> l
> ine 16, in check_url_config
> return check_resolver(resolver)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\urls.py",
> l
> ine 26, in check_resolver
> return check_method()
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py",
> lin
> e 254, in check
> for pattern in self.url_patterns:
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\functional.py",
> l
> ine 35, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py",
> lin
> e 405, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\functional.py",
> l
> ine 35, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File
> "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py",
> lin
> e 398, in urlconf_module
> return import_module(self.urlconf_name)
>   File "c:\Python27\Lib\importlib\__init__.py", line 37, in import_module
> __import__(name)
>   File "C:\Users\gkfka\PycharmProjects\django\cafe\mysite\mysite\urls.py",
> line 17, in 
> from django.urls import include, path
> ImportError: cannot import name include
>
> --
> 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/e9634a2e-8970-4f14-bb2b-1275ce305fad%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Fidel Leon
fi...@flm.cat
Phone: +34 622 26 44 92

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


Re: ImportError: No module named 'main'

2018-04-14 Thread shubham jhandei
Hi,

I agree with Samuel Muiruri, your app definition in settings.py is 
incorrect.

try this:

INSTALLED_APPS = [ ... #'DjangoRestfulServer', #remove there is no need 
toimport the main project 'main', #no need for substantiating an app ]

On Friday, April 13, 2018 at 8:04:51 PM UTC+5:30, Артём Орлов wrote:
>
> Hello!
>
>
> Django does not see application created with *django-admin startapp main*
> . 
>
> ./DjangoRestfulServer/
> ├── __init__.py
> ├── main
> │   ├── admin.py
> │   ├── apps.py
> │   ├── __init__.py
> │   ├── models.py
> │   ├── __pycache__
> │   │   ├── admin.cpython-35.pyc
> │   │   ├── __init__.cpython-35.pyc
> │   │   ├── models.cpython-35.pyc
> │   │   └── views.cpython-35.pyc
> │   ├── tests.py
> │   ├── urls.py
> │   └── views.py
> ├── __pycache__
> │   ├── __init__.cpython-35.pyc
> │   ├── models.cpython-35.pyc
> │   ├── settings.cpython-35.pyc
> │   ├── urls.cpython-35.pyc
> │   └── wsgi.cpython-35.pyc
> ├── settings.py
> ├── urls.py
> └── wsgi.py
>
>
>
> *settings.py*
>
> ...
> INSTALLED_APPS = [
> ...
> 'DjangoRestfulServer',
> 'DjangoRestfulServer.main',
> ]
> ...
>
> *main/urls.py*
>
> from django.conf.urls import url, includefrom django.urls import include, 
> path, re_pathfrom . import views
>
> urlpatterns = [
> re_path(r'^facebook/$', views.FacebookLogin.as_view(), name='fb_login'),
> ]
>
> *urls.py*
>
> from django.contrib import adminfrom django.urls import include, path, re_path
>
> urlpatterns = [
> path('api/v1/admin/', admin.site.urls),
> path('api/v1/accounts/', include('allauth.urls')),
> path('api/v1/', include('main.urls')),  # <- path('api/v1/', 
> include('DjangoRestfulServer.main.urls')) acts the same!!!
> ]
>
> Traceback is the following:
>
> (env3) artem@artem-inspirion:~/Projects/GoTogether/Server$ python3 manage.py 
> checkTraceback (most recent call last):
>   File "manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/__init__.py",
>  line 371, in execute_from_command_line
> utility.execute()
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/__init__.py",
>  line 365, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/base.py",
>  line 288, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/base.py",
>  line 335, in execute
> output = self.handle(*args, **options)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/commands/check.py",
>  line 65, in handle
> fail_level=getattr(checks, options['fail_level']),
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/base.py",
>  line 364, in check
> include_deployment_checks=include_deployment_checks,
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/management/base.py",
>  line 351, in _run_checks
> return checks.run_checks(**kwargs)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/checks/registry.py",
>  line 73, in run_checks
> new_errors = check(app_configs=app_configs)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/checks/urls.py",
>  line 40, in check_url_namespaces_unique
> all_namespaces = _load_all_namespaces(resolver)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/core/checks/urls.py",
>  line 57, in _load_all_namespaces
> url_patterns = getattr(resolver, 'url_patterns', [])
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/utils/functional.py",
>  line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/urls/resolvers.py",
>  line 536, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/utils/functional.py",
>  line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/site-packages/django/urls/resolvers.py",
>  line 529, in urlconf_module
> return import_module(self.urlconf_name)
>   File 
> "/home/artem/Projects/GoTogether/Server/env3/lib/python3.5/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 

Re: ImportError: No module named 'main'

2018-04-14 Thread Samuel Muiruri
try this

INSTALLED_APPS = [
...
#'DjangoRestfulServer', #remove you don't import the main project
'main', #no need for substanciating an app
]

-- 
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/c48d60aa-e4af-43c8-a3ba-026376c1fb98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: importError: Count Not import Django inside Virtualenv

2018-02-14 Thread PASCUAL Eric
Hi Etienne,

I prefer messing with standard distutils/setuptools commands to avoid 
situations like this... ;-)

Messing and restoring system libs is a matter of personnal taste 


Eric


From: Etienne Robillard <tkad...@yandex.com>
Sent: Wednesday, February 14, 2018 11:07:07 AM
To: PASCUAL Eric
Cc: django-users@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv


Hi Eric,

Le 2018-02-14 à 03:44, PASCUAL Eric a écrit :

Hi,


Hard to say without knowing the exact context, but my gut feeling is that 
you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when 
installing packages with sudo , which may happen form time to  time when 
working with virtualenv (or pyenv) since not very long, and being caught up by 
old habits (they tend to survive longer that wanted ).


I prefer messing with standard distutils/setuptools commands to avoid 
situations like this... ;-)

Cheers,
Etienne



From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> 
<django-users@googlegroups.com><mailto:django-users@googlegroups.com> on behalf 
of tango ward <tangowar...@gmail.com><mailto:tangowar...@gmail.com>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing 
pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward 
<tangowar...@gmail.com<mailto:tangowar...@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
  File "manage.py", line 8, in 
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

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

Traceback (most recent call last):
  File "manage.py", line 14, in 
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available 
on your PYTHONPATH environment variable? Did you forget to activate a virtual 
environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without 
any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can 
see django there. It seems that even though virtualenv is activated, the 
packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric 
<eric.pasc...@cstb.fr<mailto:eric.pasc...@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding 
what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv 
inside which you'll install Django and the additional packages you've added (if 
any). Then restore a copy of your project in this context (if by chance you 
work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in 
sudo mode. The situation could be a little more complicated then.


Best.


Eric

From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> 
<django-users@googlegroups.com<mailto:django-users@googlegroups.com>> on behalf 
of tango ward <tangowar...@gmail.com<mailto:tangowar...@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my 
desktop are getting the same error even though virtualenv is activated. I can 
confirm that when I started playing around with the projects, I have installed 
Django inside virtualenv without using "sudo". Now, I can't run python 
manage.py runserver and the packages that I am getting whenever I run pip 
freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.go

Re: importError: Count Not import Django inside Virtualenv

2018-02-14 Thread PASCUAL Eric
Hi,


The copy/paste of the project tree will work of course. Chances are that 
unwanted files can be brought too, but this should not be a problem in a first 
stage.


I have used rsync or tar archives to deploy Django projects in some cases, and 
it worked fine.


Eric


From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf 
of tango ward <tangowar...@gmail.com>
Sent: Wednesday, February 14, 2018 10:09:51 AM
To: django-users@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv

that's odd. Whenever I test a pacakge, it's always installed first in 
virtualenv. Maybe when I updated my system? Btw, I have some projects which are 
not yet in github, can I just copy and paste them in a new folder with new 
virtualenv?

On Wed, Feb 14, 2018 at 4:44 PM, PASCUAL Eric 
<eric.pasc...@cstb.fr<mailto:eric.pasc...@cstb.fr>> wrote:

Hi,


Hard to say without knowing the exact context, but my gut feeling is that 
you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when 
installing packages with sudo , which may happen form time to  time when 
working with virtualenv (or pyenv) since not very long, and being caught up by 
old habits (they tend to survive longer that wanted ).


Even if far less harmful, then --user option is to avoid for projects related 
libs, for the same reasons.


Eric

From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> 
<django-users@googlegroups.com<mailto:django-users@googlegroups.com>> on behalf 
of tango ward <tangowar...@gmail.com<mailto:tangowar...@gmail.com>>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing 
pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward 
<tangowar...@gmail.com<mailto:tangowar...@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
  File "manage.py", line 8, in 
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

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

Traceback (most recent call last):
  File "manage.py", line 14, in 
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available 
on your PYTHONPATH environment variable? Did you forget to activate a virtual 
environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without 
any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can 
see django there. It seems that even though virtualenv is activated, the 
packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric 
<eric.pasc...@cstb.fr<mailto:eric.pasc...@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding 
what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv 
inside which you'll install Django and the additional packages you've added (if 
any). Then restore a copy of your project in this context (if by chance you 
work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in 
sudo mode. The situation could be a little more complicated then.


Best.


Eric

From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> 
<django-users@googlegroups.com<mailto:django-users@googlegroups.com>> on behalf 
of tango ward <tangowar...@gmail.com<mailto:tangowar...@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my 
desktop are getting the same error even though virtualenv is activated. I can 
confirm that when I started playing around with the projects, I have installed 
Django inside virtualenv without using "sudo". Now, I can't run python 
manage.py runserver and the packages that I am getting whenever I run pip 
freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
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+u

Re: importError: Count Not import Django inside Virtualenv

2018-02-14 Thread Etienne Robillard

Hi Eric,


Le 2018-02-14 à 03:44, PASCUAL Eric a écrit :


Hi,


Hard to say without knowing the exact context, but my gut feeling is 
that you've modified a system wide library at a moment (maybe 
inadvertently).



My own experience is that it's easy to mess with Python libraries when 
installing packages with sudo , which may happen form time to  time 
when working with virtualenv (or pyenv) since not very long, and being 
caught up by old habits (they tend to survive longer that wanted ).



I prefer messing with standard distutils/setuptools commands to avoid 
situations like this... ;-)


Cheers,
Etienne




*From:* django-users@googlegroups.com <django-users@googlegroups.com> 
on behalf of tango ward <tangowar...@gmail.com>

*Sent:* Wednesday, February 14, 2018 3:40:04 AM
*To:* django-users@googlegroups.com
*Subject:* Re: importError: Count Not import Django inside Virtualenv
Hi Eric,


I tried what you suggested and it works! I was just wondering why my 
existing pet projects have the same problem?


On Wed, Feb 14, 2018 at 10:13 AM, tango ward <tangowar...@gmail.com 
<mailto:tangowar...@gmail.com>> wrote:


Hi,

The error message that I am getting is:

Traceback (most recent call last):
  File "manage.py", line 8, in 
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

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

Traceback (most recent call last):
  File "manage.py", line 14, in 
    ) from exc
ImportError: Couldn't import Django. Are you sure it's installed
and available on your PYTHONPATH environment variable? Did you
forget to activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet
projects without any error. If I go to venv folder
virtual/lib/python3.6/site-packages, I can see django there. It
seems that even though virtualenv is activated, the packages I
installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric
<eric.pasc...@cstb.fr <mailto:eric.pasc...@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help
understanding what's happening.


If you haven't already done this, try to restart from a fresh
new virtualenv inside which you'll install Django and the
additional packages you've added (if any). Then restore a copy
of your project in this context (if by chance you work with
git, a simple git clone will do the trick) and test your app
again.


Hoping you haven't already messed your system Python by
installing stuff in sudo mode. The situation could be a little
more complicated then.


Best.


Eric

*From:* django-users@googlegroups.com
<mailto:django-users@googlegroups.com>
<django-users@googlegroups.com
<mailto:django-users@googlegroups.com>> on behalf of tango
ward <tangowar...@gmail.com <mailto:tangowar...@gmail.com>>
*Sent:* Tuesday, February 13, 2018 9:43:45 PM
*To:* django-users@googlegroups.com
<mailto:django-users@googlegroups.com>
*Subject:* importError: Count Not import Django inside Virtualenv
Hi,

I want to seek some advice about the error. All of my pet
projects in my desktop are getting the same error even though
virtualenv is activated. I can confirm that when I started
playing around with the projects, I have installed Django
inside virtualenv without using "sudo". Now, I can't run
python manage.py runserver and the packages that I am getting
whenever I run pip freeze are different from before which
doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis
-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to
django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at
https://groups.google.com/group/django-users
<https://groups.google.com/group/django-users>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.c

Re: importError: Count Not import Django inside Virtualenv

2018-02-14 Thread tango ward
that's odd. Whenever I test a pacakge, it's always installed first in
virtualenv. Maybe when I updated my system? Btw, I have some projects which
are not yet in github, can I just copy and paste them in a new folder with
new virtualenv?

On Wed, Feb 14, 2018 at 4:44 PM, PASCUAL Eric <eric.pasc...@cstb.fr> wrote:

> Hi,
>
>
> Hard to say without knowing the exact context, but my gut feeling is that
> you've modified a system wide library at a moment (maybe inadvertently).
>
>
> My own experience is that it's easy to mess with Python libraries when
> installing packages with sudo , which may happen form time to  time
> when working with virtualenv (or pyenv) since not very long, and being
> caught up by old habits (they tend to survive longer that wanted ).
>
>
> Even if far less harmful, then --user option is to avoid for projects
> related libs, for the same reasons.
>
>
> Eric
> --
> *From:* django-users@googlegroups.com <django-users@googlegroups.com> on
> behalf of tango ward <tangowar...@gmail.com>
> *Sent:* Wednesday, February 14, 2018 3:40:04 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: importError: Count Not import Django inside Virtualenv
>
> Hi Eric,
>
>
> I tried what you suggested and it works! I was just wondering why my
> existing pet projects have the same problem?
>
> On Wed, Feb 14, 2018 at 10:13 AM, tango ward <tangowar...@gmail.com>
> wrote:
>
> Hi,
>
> The error message that I am getting is:
>
> Traceback (most recent call last):
>   File "manage.py", line 8, in 
> from django.core.management import execute_from_command_line
> ModuleNotFoundError: No module named 'django'
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> ) from exc
> ImportError: Couldn't import Django. Are you sure it's installed and
> available on your PYTHONPATH environment variable? Did you forget to
> activate a virtual environment?
>
>
> @Jason,
>
> It's weird because couple of days, I can still run these pet projects
> without any error. If I go to venv folder virtual/lib/python3.6/site-packages,
> I can see django there. It seems that even though virtualenv is activated,
> the packages I installed inside it are not recognized by the system.
>
>
> On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric <eric.pasc...@cstb.fr>
> wrote:
>
> Hi Jarvis,
>
>
> Can you provide the error messages trace ? It can greatly help
> understanding what's happening.
>
>
> If you haven't already done this, try to restart from a fresh new
> virtualenv inside which you'll install Django and the additional packages
> you've added (if any). Then restore a copy of your project in this context
> (if by chance you work with git, a simple git clone will do the trick) and
> test your app again.
>
>
> Hoping you haven't already messed your system Python by installing stuff
> in sudo mode. The situation could be a little more complicated then.
>
>
> Best.
>
>
> Eric
> --
> *From:* django-users@googlegroups.com <django-users@googlegroups.com> on
> behalf of tango ward <tangowar...@gmail.com>
> *Sent:* Tuesday, February 13, 2018 9:43:45 PM
> *To:* django-users@googlegroups.com
> *Subject:* importError: Count Not import Django inside Virtualenv
>
> Hi,
>
> I want to seek some advice about the error. All of my pet projects in my
> desktop are getting the same error even though virtualenv is activated. I
> can confirm that when I started playing around with the projects, I have
> installed Django inside virtualenv without using "sudo". Now, I can't run
> python manage.py runserver and the packages that I am getting whenever I
> run pip freeze are different from before which doesn't include Django in
> the list.
>
>
> Any advice pls?
>
>
> Thanks,
> Jarvis
>
> --
> 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/ms
> gid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWb
> e1JNx2YhFA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com?utm_medium=email_source=footer>

Re: importError: Count Not import Django inside Virtualenv

2018-02-14 Thread PASCUAL Eric
Hi,


Hard to say without knowing the exact context, but my gut feeling is that 
you've modified a system wide library at a moment (maybe inadvertently).


My own experience is that it's easy to mess with Python libraries when 
installing packages with sudo , which may happen form time to  time when 
working with virtualenv (or pyenv) since not very long, and being caught up by 
old habits (they tend to survive longer that wanted ).


Even if far less harmful, then --user option is to avoid for projects related 
libs, for the same reasons.


Eric

From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf 
of tango ward <tangowar...@gmail.com>
Sent: Wednesday, February 14, 2018 3:40:04 AM
To: django-users@googlegroups.com
Subject: Re: importError: Count Not import Django inside Virtualenv

Hi Eric,


I tried what you suggested and it works! I was just wondering why my existing 
pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward 
<tangowar...@gmail.com<mailto:tangowar...@gmail.com>> wrote:
Hi,

The error message that I am getting is:

Traceback (most recent call last):
  File "manage.py", line 8, in 
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

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

Traceback (most recent call last):
  File "manage.py", line 14, in 
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available 
on your PYTHONPATH environment variable? Did you forget to activate a virtual 
environment?


@Jason,

It's weird because couple of days, I can still run these pet projects without 
any error. If I go to venv folder virtual/lib/python3.6/site-packages, I can 
see django there. It seems that even though virtualenv is activated, the 
packages I installed inside it are not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric 
<eric.pasc...@cstb.fr<mailto:eric.pasc...@cstb.fr>> wrote:

Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding 
what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv 
inside which you'll install Django and the additional packages you've added (if 
any). Then restore a copy of your project in this context (if by chance you 
work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in 
sudo mode. The situation could be a little more complicated then.


Best.


Eric

From: django-users@googlegroups.com<mailto:django-users@googlegroups.com> 
<django-users@googlegroups.com<mailto:django-users@googlegroups.com>> on behalf 
of tango ward <tangowar...@gmail.com<mailto:tangowar...@gmail.com>>
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-users@googlegroups.com<mailto:django-users@googlegroups.com>
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my 
desktop are getting the same error even though virtualenv is activated. I can 
confirm that when I started playing around with the projects, I have installed 
Django inside virtualenv without using "sudo". Now, I can't run python 
manage.py runserver and the packages that I am getting whenever I run pip 
freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%40mail.gmail.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<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.

Re: importError: Count Not import Django inside Virtualenv

2018-02-13 Thread tango ward
Hi Eric,


I tried what you suggested and it works! I was just wondering why my
existing pet projects have the same problem?

On Wed, Feb 14, 2018 at 10:13 AM, tango ward  wrote:

> Hi,
>
> The error message that I am getting is:
>
> Traceback (most recent call last):
>   File "manage.py", line 8, in 
> from django.core.management import execute_from_command_line
> ModuleNotFoundError: No module named 'django'
>
> The above exception was the direct cause of the following exception:
>
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> ) from exc
> ImportError: Couldn't import Django. Are you sure it's installed and
> available on your PYTHONPATH environment variable? Did you forget to
> activate a virtual environment?
>
>
> @Jason,
>
> It's weird because couple of days, I can still run these pet projects
> without any error. If I go to venv folder virtual/lib/python3.6/site-packages,
> I can see django there. It seems that even though virtualenv is activated,
> the packages I installed inside it are not recognized by the system.
>
>
> On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric 
> wrote:
>
>> Hi Jarvis,
>>
>>
>> Can you provide the error messages trace ? It can greatly help
>> understanding what's happening.
>>
>>
>> If you haven't already done this, try to restart from a fresh new
>> virtualenv inside which you'll install Django and the additional packages
>> you've added (if any). Then restore a copy of your project in this context
>> (if by chance you work with git, a simple git clone will do the trick) and
>> test your app again.
>>
>>
>> Hoping you haven't already messed your system Python by installing stuff
>> in sudo mode. The situation could be a little more complicated then.
>>
>>
>> Best.
>>
>>
>> Eric
>> --
>> *From:* django-users@googlegroups.com  on
>> behalf of tango ward 
>> *Sent:* Tuesday, February 13, 2018 9:43:45 PM
>> *To:* django-users@googlegroups.com
>> *Subject:* importError: Count Not import Django inside Virtualenv
>>
>> Hi,
>>
>> I want to seek some advice about the error. All of my pet projects in my
>> desktop are getting the same error even though virtualenv is activated. I
>> can confirm that when I started playing around with the projects, I have
>> installed Django inside virtualenv without using "sudo". Now, I can't run
>> python manage.py runserver and the packages that I am getting whenever I
>> run pip freeze are different from before which doesn't include Django in
>> the list.
>>
>>
>> Any advice pls?
>>
>>
>> Thanks,
>> Jarvis
>>
>> --
>> 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/ms
>> gid/django-users/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWb
>> e1JNx2YhFA%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 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/ms
>> gid/django-users/AM5P193MB0083C66FCD689270720750708CF60%
>> 40AM5P193MB0083.EURP193.PROD.OUTLOOK.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/CAA6wQLJCkd0B-0ep8jrUFk1QUp%3D_jQ_AuundhzBMwOSYf7h4fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: importError: Count Not import Django inside Virtualenv

2018-02-13 Thread tango ward
Hi,

The error message that I am getting is:

Traceback (most recent call last):
  File "manage.py", line 8, in 
from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

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

Traceback (most recent call last):
  File "manage.py", line 14, in 
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and
available on your PYTHONPATH environment variable? Did you forget to
activate a virtual environment?


@Jason,

It's weird because couple of days, I can still run these pet projects
without any error. If I go to venv folder
virtual/lib/python3.6/site-packages, I can see django there. It seems that
even though virtualenv is activated, the packages I installed inside it are
not recognized by the system.


On Wed, Feb 14, 2018 at 5:38 AM, PASCUAL Eric  wrote:

> Hi Jarvis,
>
>
> Can you provide the error messages trace ? It can greatly help
> understanding what's happening.
>
>
> If you haven't already done this, try to restart from a fresh new
> virtualenv inside which you'll install Django and the additional packages
> you've added (if any). Then restore a copy of your project in this context
> (if by chance you work with git, a simple git clone will do the trick) and
> test your app again.
>
>
> Hoping you haven't already messed your system Python by installing stuff
> in sudo mode. The situation could be a little more complicated then.
>
>
> Best.
>
>
> Eric
> --
> *From:* django-users@googlegroups.com  on
> behalf of tango ward 
> *Sent:* Tuesday, February 13, 2018 9:43:45 PM
> *To:* django-users@googlegroups.com
> *Subject:* importError: Count Not import Django inside Virtualenv
>
> Hi,
>
> I want to seek some advice about the error. All of my pet projects in my
> desktop are getting the same error even though virtualenv is activated. I
> can confirm that when I started playing around with the projects, I have
> installed Django inside virtualenv without using "sudo". Now, I can't run
> python manage.py runserver and the packages that I am getting whenever I
> run pip freeze are different from before which doesn't include Django in
> the list.
>
>
> Any advice pls?
>
>
> Thanks,
> Jarvis
>
> --
> 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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2Y
> hFA%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 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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.
> EURP193.PROD.OUTLOOK.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/CAA6wQLLZyeuQiFL6fe4HvC4a6ogZnTh7kGrc62ni95aPggChyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: importError: Count Not import Django inside Virtualenv

2018-02-13 Thread PASCUAL Eric
Hi Jarvis,


Can you provide the error messages trace ? It can greatly help understanding 
what's happening.


If you haven't already done this, try to restart from a fresh new virtualenv 
inside which you'll install Django and the additional packages you've added (if 
any). Then restore a copy of your project in this context (if by chance you 
work with git, a simple git clone will do the trick) and test your app again.


Hoping you haven't already messed your system Python by installing stuff in 
sudo mode. The situation could be a little more complicated then.


Best.


Eric

From: django-users@googlegroups.com  on behalf 
of tango ward 
Sent: Tuesday, February 13, 2018 9:43:45 PM
To: django-users@googlegroups.com
Subject: importError: Count Not import Django inside Virtualenv

Hi,

I want to seek some advice about the error. All of my pet projects in my 
desktop are getting the same error even though virtualenv is activated. I can 
confirm that when I started playing around with the projects, I have installed 
Django inside virtualenv without using "sudo". Now, I can't run python 
manage.py runserver and the packages that I am getting whenever I run pip 
freeze are different from before which doesn't include Django in the list.


Any advice pls?


Thanks,
Jarvis

--
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/CAA6wQLKp3oz-6FfDzQ%3Dip4XRsuLPSeOCuwkbUuWbe1JNx2YhFA%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 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/AM5P193MB0083C66FCD689270720750708CF60%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: importError: Count Not import Django inside Virtualenv

2018-02-13 Thread Jason
if pip freeze doesn't include django in the output, then the django package 
is not installed in the virtualenv.  are you sure the virtualenv was active 
when you installed django?

also, remember that if you installed latest django, eg *pip install django*, 
it won't install for python2 venvs.

On Tuesday, February 13, 2018 at 3:44:42 PM UTC-5, tangoward15 wrote:
>
> Hi,
>
> I want to seek some advice about the error. All of my pet projects in my 
> desktop are getting the same error even though virtualenv is activated. I 
> can confirm that when I started playing around with the projects, I have 
> installed Django inside virtualenv without using "sudo". Now, I can't run 
> python manage.py runserver and the packages that I am getting whenever I 
> run pip freeze are different from before which doesn't include Django in 
> the list.
>
>
> Any advice pls?
>
>
> Thanks,
> Jarvis
>

-- 
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/9ddf691d-6d16-4fa1-aab0-f534fef445ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError while starting django server

2017-02-02 Thread Tim Graham
It seems like your Python install might be broken. Does this import work in 
a Python shell:

>>> from logging.config import dictConfig

On Thursday, February 2, 2017 at 7:12:38 AM UTC-5, Parth Shah wrote:
>
> *Folks,*
>
> *I was following the tutorial here 
>  and was 
> successfully able to install django.*
>
> *I am using python 2.7.13 on OS X.*
>
> *I can verify the version number as below:*
>
>
> *Macitosh:project user$ python*
>
> *Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39) *
>
> *[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin*
>
> *Type "help", "copyright", "credits" or "license" for more information.*
>
> *>>> import django*
>
> *>>> print(django.get_version())*
>
> *1.10.5*
>
> *>>>*
>
>
> *But when I try to run the version check using a different command I get 
> the below error, and the same error while subsequently starting the server*
>
>
> *Parths-Macitosh:project parth$ python -m django --version*
>
> *Traceback (most recent call last):*
>
> *  File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", 
> line 174, in _run_module_as_main*
>
> *"__main__", fname, loader, pkg_name)*
>
> *  File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", 
> line 72, in _run_code*
>
> *exec code in run_globals*
>
> *  File "/Library/Python/2.7/site-packages/django/__main__.py", line 9, in 
> *
>
> *management.execute_from_command_line()*
>
> *  File 
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
> line 367, in execute_from_command_line*
>
> *utility.execute()*
>
> *  File 
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
> line 341, in execute*
>
> *django.setup()*
>
> *  File "/Library/Python/2.7/site-packages/django/__init__.py", line 22, 
> in setup*
>
> *configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)*
>
> *  File "/Library/Python/2.7/site-packages/django/utils/log.py", line 69, 
> in configure_logging*
>
> *logging_config_func = import_string(logging_config)*
>
> *  File 
> "/Library/Python/2.7/site-packages/django/utils/module_loading.py", line 
> 27, in import_string*
>
> *six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])*
>
> *  File 
> "/Library/Python/2.7/site-packages/django/utils/module_loading.py", line 
> 23, in import_string*
>
> *return getattr(module, class_name)*
>
> *ImportError: Module "logging.config" does not define a "dictConfig" 
> attribute/class*
>
>
> Any thoughts?
>
>
> Thanks,
>
> PS
>

-- 
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/6792993e-f4e7-425c-b9f8-d269651ec821%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError while starting django server

2017-02-02 Thread Antonis Christofides
Hi,

the --version option of the "python" command shows you the version of Python,
not of Django. The -m option doesn't merely import the module you specify, it
imports it and executes it, and Django isn't designed to do this. So the way to
check its version the one you showed first. If you want to run it with a
one-liner, it's this:

python -c 'import django; print(django.get_version())'

Antonis Christofides
http://djangodeployment.com


On 02/02/2017 07:16 AM, Parth Shah wrote:
> /Folks,/
> /
> /
> /I was following the tutorial here
>  and was
> successfully able to install django./
> /
> /
> /I am using python 2.7.13 on OS X./
> /
> /
> /I can verify the version number as below:/
>
>
> *Macitosh:project user$ python*
>
> *Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39) *
>
> *[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin*
>
> *Type "help", "copyright", "credits" or "license" for more information.*
>
> *>>> import django*
>
> *>>> print(django.get_version())*
>
> *1.10.5*
>
> *>>>*
>
> */
> /*
>
> /But when I try to run the version check using a different command I get the
> below error, and the same error while subsequently starting the server/
>
>
> *Parths-Macitosh:project parth$ python -m django --version*
>
> *Traceback (most recent call last):*
>
> *  File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
> line 174, in _run_module_as_main*
>
> *"__main__", fname, loader, pkg_name)*
>
> *  File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
> line 72, in _run_code*
>
> *exec code in run_globals*
>
> *  File "/Library/Python/2.7/site-packages/django/__main__.py", line 9, in
> *
>
> *management.execute_from_command_line()*
>
> *  File
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line
> 367, in execute_from_command_line*
>
> *utility.execute()*
>
> *  File
> "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line
> 341, in execute*
>
> *django.setup()*
>
> *  File "/Library/Python/2.7/site-packages/django/__init__.py", line 22, in 
> setup*
>
> *configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)*
>
> *  File "/Library/Python/2.7/site-packages/django/utils/log.py", line 69, in
> configure_logging*
>
> *logging_config_func = import_string(logging_config)*
>
> *  File "/Library/Python/2.7/site-packages/django/utils/module_loading.py",
> line 27, in import_string*
>
> *six.reraise(ImportError, ImportError(msg), sys.exc_info()[2])*
>
> *  File "/Library/Python/2.7/site-packages/django/utils/module_loading.py",
> line 23, in import_string*
>
> *return getattr(module, class_name)*
>
> **
>
> *ImportError: Module "logging.config" does not define a "dictConfig"
> attribute/class*
>
> *
> *
>
> Any thoughts?
>
>
> Thanks,
>
> PS
>
> -- 
> 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/ff5c496c-7be7-4ca7-a5b4-88b2744ee3c2%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/dc2cb83b-db26-0a27-4d94-61b8d80f6bd3%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError at/ No module name

2016-10-01 Thread Aravind S

Check this post 



On Thursday, December 20, 2012 at 6:57:42 PM UTC+5:30, djangobie wrote:
>
> Hi, I have just started practicing a tutorial for buidling a  basic blog ( 
> http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
>  )
>
> Did exactly the same (except, using 'djangopractice' as project name 
> instead of 'djangorocks')
> Actually It also did run twice, but than started showing ImportError.
>
> My files:
> 
> ***settings.py***
> 
> # Django settings for djangopractice project.
> #import os, django
> #DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
> #SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_...@example.com '),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'djangopractice',  # Or path to 
> database file if using sqlite3.
> 'USER': 'root',  # Not used with sqlite3.
> 'PASSWORD': '1290',  # 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.
> }
> }
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'Asia/Karachi'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded 
> files.
> # Example: "/home/media/media.lawrence.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://media.lawrence.com/media/;, "http://example.com/media/
> "
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/home/media/media.lawrence.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://media.lawrence.com/static/;
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'djangopractice.urls'
>
> # Python dotted path to the WSGI application used by Django's runserver.
> WSGI_APPLICATION = 'djangopractice.wsgi.application'
>
> TEMPLATE_DIRS = (
> "/home/username/djangosites/djangopractice/Templates"
> # Put strings here, like "/home/html/django_templates" or 
> "C:/www/django/templates".
> # Always use forward slashes, even on Windows.
> 

Re: ImportError: No module named south

2016-05-20 Thread Frank Wiles
>From the looks of it, you need to install the requirements for
RatticDB.  There are 2 setups for MySQL or PostgreSQL listed here
https://github.com/tildaslash/RatticWeb

For the PG option you'd just run:

  pip intall -r requirements-pgsql.txt

And it will install all of the necessary PIP dependencies for you.
Hope that helps!

Frank Wiles
Revolution Systems | http://www.revsys.com/
fr...@revsys.com   | (800) 647-6298



On Fri, May 20, 2016 at 5:07 AM, Priyadharshini S
 wrote:
> When i trying to install RatticDB on ubuntu 12.04
> I got this error please help me to solve
>
> ./manage.py syncdb --noinput
> Traceback (most recent call last):
>   File "./manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 353, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 327, in execute
> django.setup()
>   File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18,
> in setup
> apps.populate(settings.INSTALLED_APPS)
>   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
> line 85, in populate
> app_config = AppConfig.create(entry)
>   File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line
> 90, in create
> module = import_module(entry)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
> __import__(name)
> ImportError: No module named south
>
> --
> 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/d054978e-edf3-48a9-a2e9-1526fa641c1f%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/CANgO38n9oaqhnoNku3cHM6b%2BpXSo-6h7t602qTxBRvDEZL%2B_NA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: no module named polls

2016-01-25 Thread James Schneider
On Jan 25, 2016 1:05 PM, "moon jo"  wrote:
>
> Using django 1.6.10
> I finished the polls tutorial and tried to create my own project.
> I tried to runserver and it gives me the import error. But it's a blank
project, haven't added anything in the settings.
> When I do import settings form django.conf and print
settings.INSTALLED_APPS, it prints this:
>
> ('django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django.contrib.messages', 'django.contrib.staticfiles',
'django.contrib.admin', 'polls')
>
> Where is that 'polls' coming from? Every project I create, I get the same
error, they're looking for the 'polls' app.

Firstly, 1.6 is EoL, please upgrade your Django installation to a supported
version (>=1.8).

Django will not add this app to your settings.py on its own. Either you are
not using the official Django distribution, or something else is going on.
You are creating a new project with 'django-admin startproject
' right?

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To 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/CA%2Be%2BciUjxBKM-nm-CsWMxGiO9q%2BeBdoLqY1TtomLj984-4Hpqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: no module named polls

2016-01-25 Thread Rafael E. Ferrero
if its a blank project you don't have a polls app yet,so... why you put
your polls app there?


Rafael E. Ferrero

2016-01-25 16:14 GMT-03:00 moon jo :

> Using django 1.6.10
> I finished the polls tutorial and tried to create my own project.
> I tried to runserver and it gives me the import error. But it's a blank
> project, haven't added anything in the settings.
> When I do import settings form django.conf and print
> settings.INSTALLED_APPS, it prints this:
>
> ('django.contrib.auth', 'django.contrib.contenttypes',
> 'django.contrib.sessions', 'django.contrib.sites',
> 'django.contrib.messages', 'django.contrib.staticfiles',
> 'django.contrib.admin', 'polls')
>
> Where is that 'polls' coming from? Every project I create, I get the same
> error, they're looking for the 'polls' app.
>
> --
> 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/df91e3ff-aa9e-424a-9db2-f8d7091003a3%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/CAJJc_8W8nvOFKogPWfWOwVrZ0HRP7WDOqdGug4gp5EMaBxMcxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: No module named security(SOLVED)

2016-01-04 Thread Gary Roach
Dead On knbk. I commented out the security line and the problem when 
poof. Thank you.


Gary R.

On 01/04/2016 06:29 PM, knbk wrote:
Seems like you have SecurityMiddleware in your middleware settings, 
which wasn't added until 1.8. If you started your project on 1.8+. 
your default settings file would include the new middleware and cause 
this error on 1.7.


On Tuesday, January 5, 2016 at 2:56:51 AM UTC+1, Gary Roach wrote:

I've been trying different things with django and different
tutorials. I
was using Ninja as my IDE but had to give it up because of lack of
support. I just switched to Eclipse with the PyDev plugin. (No I cant
get Pycharm). The IDE is complicated but seems to do everything I
wish
it to do if I work at it long enough.

The problem:
I am working on Tango With Django tutorial and have a virtual
environment setup with Python 2.7 and Django 1.7 . Debian Linux is
still
stuck with Eclipse 3.8 so I installed Eclipse Mars (4.5) from source.
The project properties show that python 2.7 is sourced from the
virtual
environment's local/bin/ directory. Both Python 2.7 and Django 1.7
were
installed in the virtual environment using pip with the no site
packages
switch. So everything should be walled off from the rest of the
system.
Further, the project was working OK until I tried to access the
/admin/
app. It hasn't worked since.

When I run debug on the project no errors show and the internal web
server starts fine. When I try to access either the rango/ app, the
admin/ app or just the 127.0.0.1:8000 
basic url the browser shows "A
server error occurred.  Please contact the administrator." The
Eclipse
console shows the following:

Traceback (most recent call last):
   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
 self.result = application(self.environ, self.start_response)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py",

line 64, in __call__
 return self.application(environ, start_response)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py",

line 168, in __call__
 self.load_middleware()
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/base.py",

line 44, in load_middleware
 mw_class = import_string(middleware_path)
   File

"/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/utils/module_loading.py",

line 26, in import_string
 module = import_module(module_path)
   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
import_module
 __import__(name)
ImportError: No module named security
[05/Jan/2016 00:21:51] "GET / HTTP/1.1" 500 59

I notice that the first and last items on the traceback list are
pulling
data from the global (system) python package. I've searched the
net for
information. This problem shows up several times but It is obvious
that
no one really understands what is causing it. I rebooted the
system but
the problem persisted. Any help will be sincerely appreciated.

Gary R.





--
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/568B3244.8070704%40verizon.net.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: No module named security

2016-01-04 Thread knbk
Seems like you have SecurityMiddleware in your middleware settings, which 
wasn't added until 1.8. If you started your project on 1.8+. your default 
settings file would include the new middleware and cause this error on 1.7. 

On Tuesday, January 5, 2016 at 2:56:51 AM UTC+1, Gary Roach wrote:
>
> I've been trying different things with django and different tutorials. I 
> was using Ninja as my IDE but had to give it up because of lack of 
> support. I just switched to Eclipse with the PyDev plugin. (No I cant 
> get Pycharm). The IDE is complicated but seems to do everything I wish 
> it to do if I work at it long enough. 
>
> The problem: 
> I am working on Tango With Django tutorial and have a virtual 
> environment setup with Python 2.7 and Django 1.7 . Debian Linux is still 
> stuck with Eclipse 3.8 so I installed Eclipse Mars (4.5) from source. 
> The project properties show that python 2.7 is sourced from the virtual 
> environment's local/bin/ directory. Both Python 2.7 and Django 1.7 were 
> installed in the virtual environment using pip with the no site packages 
> switch. So everything should be walled off from the rest of the system. 
> Further, the project was working OK until I tried to access the /admin/ 
> app. It hasn't worked since. 
>
> When I run debug on the project no errors show and the internal web 
> server starts fine. When I try to access either the rango/ app, the 
> admin/ app or just the 127.0.0.1:8000 basic url the browser shows "A 
> server error occurred.  Please contact the administrator." The Eclipse 
> console shows the following: 
>
> Traceback (most recent call last): 
>File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run 
>  self.result = application(self.environ, self.start_response) 
>File 
> "/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py",
>  
>
> line 64, in __call__ 
>  return self.application(environ, start_response) 
>File 
> "/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py",
>  
>
> line 168, in __call__ 
>  self.load_middleware() 
>File 
> "/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/core/handlers/base.py",
>  
>
> line 44, in load_middleware 
>  mw_class = import_string(middleware_path) 
>File 
> "/home/gary/workspace/TangoWithDjango/local/lib/python2.7/site-packages/django/utils/module_loading.py",
>  
>
> line 26, in import_string 
>  module = import_module(module_path) 
>File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module 
>  __import__(name) 
> ImportError: No module named security 
> [05/Jan/2016 00:21:51] "GET / HTTP/1.1" 500 59 
>
> I notice that the first and last items on the traceback list are pulling 
> data from the global (system) python package. I've searched the net for 
> information. This problem shows up several times but It is obvious that 
> no one really understands what is causing it. I rebooted the system but 
> the problem persisted. Any help will be sincerely appreciated. 
>
> Gary R. 
>
>
>
>

-- 
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/aa6f7641-a431-4ede-8805-07254713a78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError at/ No module name

2015-11-07 Thread Scott Anderson
We just tripped across something similar here as well. The person doing the 
tutorial had flipped the 'startup' and 'put "blog" in the INSTALLED_APPS' 
steps of the tutorial. She commented out 'blog' from INSTALLED_APPS and 
startapp worked as intended.

-scott

On Sunday, August 11, 2013 at 8:11:11 PM UTC-4, Pranay Shah wrote:
>
> I just want to thank everyone. I had an error "no module name image" since 
> yesterday nite. I googled and found out that I need to install python image 
> library. I did that. I still continued getting error. Just then I came 
> across this post where someone was getting "no module... blog". I read it 
> and found out the prob. Initially I had an "image" view which I deleted 
> last nite as I was no longer gonna use it. But I didnt remove its mapping 
> form the urls.py. I commented the lines for image - views and it worked.
>
> Thank you all. Now I shall start working on the actual stuff which I was 
> supposed to work from last nite. Its actually my internship homework.
>
> Thank you once again. 
>
> On Thursday, 20 December 2012 05:27:42 UTC-8, djangobie wrote:
>>
>> Hi, I have just started practicing a tutorial for buidling a  basic blog 
>> ( 
>> http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
>>  )
>>
>> Did exactly the same (except, using 'djangopractice' as project name 
>> instead of 'djangorocks')
>> Actually It also did run twice, but than started showing ImportError.
>>
>> My files:
>> 
>> ***settings.py***
>> 
>> # Django settings for djangopractice project.
>> #import os, django
>> #DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
>> #SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))
>>
>> DEBUG = True
>> TEMPLATE_DEBUG = DEBUG
>>
>> ADMINS = (
>> # ('Your Name', 'your_...@example.com'),
>> )
>>
>> MANAGERS = ADMINS
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.mysql', # Add 
>> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
>> 'NAME': 'djangopractice',  # Or path to 
>> database file if using sqlite3.
>> 'USER': 'root',  # Not used with sqlite3.
>> 'PASSWORD': '1290',  # 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.
>> }
>> }
>>
>> # Local time zone for this installation. Choices can be found here:
>> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
>> # although not all choices may be available on all operating systems.
>> # In a Windows environment this must be set to your system time zone.
>> TIME_ZONE = 'Asia/Karachi'
>>
>> # Language code for this installation. All choices can be found here:
>> # http://www.i18nguy.com/unicode/language-identifiers.html
>> LANGUAGE_CODE = 'en-us'
>>
>> SITE_ID = 1
>>
>> # If you set this to False, Django will make some optimizations so as not
>> # to load the internationalization machinery.
>> USE_I18N = True
>>
>> # If you set this to False, Django will not format dates, numbers and
>> # calendars according to the current locale.
>> USE_L10N = True
>>
>> # If you set this to False, Django will not use timezone-aware datetimes.
>> USE_TZ = True
>>
>> # Absolute filesystem path to the directory that will hold user-uploaded 
>> files.
>> # Example: "/home/media/media.lawrence.com/media/"
>> MEDIA_ROOT = ''
>>
>> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
>> # trailing slash.
>> # Examples: "http://media.lawrence.com/media/;, "
>> http://example.com/media/;
>> MEDIA_URL = ''
>>
>> # Absolute path to the directory static files should be collected to.
>> # Don't put anything in this directory yourself; store your static files
>> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
>> # Example: "/home/media/media.lawrence.com/static/"
>> STATIC_ROOT = ''
>>
>> # URL prefix for static files.
>> # Example: "http://media.lawrence.com/static/;
>> STATIC_URL = '/static/'
>>
>> # Additional locations of static files
>> STATICFILES_DIRS = (
>> # Put strings here, like "/home/html/static" or 
>> "C:/www/django/static".
>> # Always use forward slashes, even on Windows.
>> # Don't forget to use absolute paths, not relative paths.
>> )
>>
>> # List of finder classes that know how to find static files in
>> # various locations.
>> STATICFILES_FINDERS = (
>> 'django.contrib.staticfiles.finders.FileSystemFinder',
>> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
>> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
>> )
>>
>> # Make this unique, and don't share it with anybody.
>> SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'
>>
>> # List of callables that know how to import templates from various 
>> 

Re: ImportError

2015-02-18 Thread Petar Pilipovic
Ok, I will work on it as soon as posible, tnx for your help.

On Wednesday, February 18, 2015, aRkadeFR  wrote:
>
> On 02/18/2015 07:17 AM, Petar Pilipovic wrote:
>
> aRkadeFR I have one other question regarding urls.py. I got this error
when I am trying to go from contact or about to home page.
>
> Using the URLconf defined in tryDjango.urls, Django tried these URL
patterns, in this order:
>
> ^$ [name='home']
> ^about/$ [name='about']
> ^contact/$ [name='contact']
> ^admin/
> ^static\/(?P.*)$
> ^media\/(?P.*)$
>
> The current URL, contact/{% url 'home' %}, didn't match any of these.
>
> the first part of your list are regexes. The "$" means the end of the
line.
> So there's nothing after "contact/" ; you can't do "contact/".
>
> A link in a template is as simple as:
> Link
> For your home page:
> Link
>
> Now mine root/urls.py, and this is mine navbar.html, every other thing is
connected properly, and I can go from home page to contact, about, but I
can not go reverse.
> Can you explain to me where is the error?
> Tank you.
>
> On Wednesday, 18 February 2015 06:02:54 UTC+1, Petar Pilipovic wrote:
>>
>> Hello aRkadeFR.
>> I have solved mine problem, I was working whit Python 2.X here, and like
you recommended I have done some  absolute import.
>> from forms import contactForm ,  and that solved it.
>> There was one other error, mine base.html did not render mine block
content, because I did not defined it, I did that and now mine form is
working.
>> Tank you.
>> Best.
>> Petar...;-)
>>
>>
>> On Tuesday, 17 February 2015 14:57:46 UTC+1, aRkadeFR wrote:
>>>
>>> Two different problems here.
>>>
>>> For your import of contactForm, please try the relative import like:
>>> from contact.forms import contactForm
>>> > contact is your app name
>>>
>>> try the (absolute_import)[1] too if you're python2.
>>>
>>> [1] https://docs.python.org/2/library/__future__.html
>>>
>>> Let us know if this works
>>>
>>> On 02/17/2015 01:30 PM, Petar Pilipovic wrote:
>>>
>>> Maybea this can help you, a bref info :
>>> I made a contact app, I have defined app url in mine url root project,
then i made a forms.py file, i have defined form in it, then i have made
contact.html where I have defined contact.html form which mine app will
render, I have then go to views.py an imported contactForm class.
>>> Afther that I have defined connection between  contact.html page and
navbar.html, collected static, run server and bam error occur.
>>> I just can not explain to mine self how come he can not import
contactForm, and how com he can not render havbar.html, error pop's out
line 15.
>>> On Tuesday, February 17, 2015, Petar Pilipovic  wrote:
>>> > Hello, I can not do it wright now I am not at home.
>>> > As for mine forms.py, it is in mine contact app. I have two apps in
mine root project, one off them is contact.
>>> > I will send you more info as soon as posible.
>>> > Tank you.
>>> >
>>> >
>>> > On Tuesday, February 17, 2015, aRkadeFR  wrote:
>>> >> Hello :)
>>> >>
>>> >> Can you dump us the layout of your files?
>>> >> Where is your forms.py?
>>> >>
>>> >> Thanks
>>> >>
>>> >> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>>> >>
>>> >> Hello all, I am trying to build and e_commerc django app, but I have
encounter an confusing error.
>>> >> Mine Error is:
>>> >> Environment:
>>> >>
>>> >> Request Method: GET
>>> >> Request URL: http://127.0.0.1:8000/
>>> >> Django Version: 1.7.4
>>> >> Python Version: 2.7.6
>>> >> Installed Applications:
>>> >> ('django.contrib.admin',
>>> >>  'django.contrib.auth',
>>> >>  'django.contrib.contenttypes',
>>> >>  'django.contrib.sessions',
>>> >>  'django.contrib.messages',
>>> >>  'django.contrib.staticfiles',
>>> >>  'profiles')
>>> >> Installed Middleware:
>>> >> ('django.contrib.sessions.middleware.SessionMiddleware',
>>> >>  'django.middleware.common.CommonMiddleware',
>>> >>  'django.middleware.csrf.CsrfViewMiddleware',
>>> >>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>> >>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>> >>  'django.contrib.messages.middleware.MessageMiddleware',
>>> >>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>> >>
>>> >> Template error:
>>> >> In template
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html,
error at line 15
>>> >>cannot import name contactForm
>>> >>5 :   
>>> >>
>>> >>6 : Toggle navigation
>>> >>
>>> >>7 : 
>>> >>
>>> >>8 : 
>>> >>
>>> >>9 : 
>>> >>
>>> >>10 :   
>>> >>
>>> >>11 :   Bootstrap
theme
>>> >>
>>> >>12 : 
>>> >>
>>> >>13 : 
>>> >>
>>> >>14 :   
>>> >>
>>> >>15 : {% url 'home' as home %}
>>> >>
>>> >>16 :{% url 'about' as about %}
>>> >>
>>> >>17 :{% url 'contact' as contact %}
>>> >>
>>> >>18 : Home
>>> >>
>>> 

Re: ImportError

2015-02-18 Thread aRkadeFR


On 02/18/2015 07:17 AM, Petar Pilipovic wrote:
aRkadeFR I have one other question regarding urls.py. I got this error 
when I am trying to go from contact or about to home page.



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


 1. ^$ [name='home']
 2. ^about/$ [name='about']
 3. ^contact/$ [name='contact']
 4. ^admin/
 5. ^static\/(?P.*)$
 6. ^media\/(?P.*)$

The current URL, |contact/{% url 'home' %}|, didn't match any of these.



the first part of your list are regexes. The "$" means the end of the line.
So there's nothing after "contact/" ; you can't do "contact/".

A link in a template is as simple as:
Link
For your home page:
Link

Now mine root/urls.py , and this is mine 
navbar.html , every other thing is connected 
properly, and I can go from home page to contact, about, but I can not 
go reverse.

Can you explain to me where is the error?
Tank you.

On Wednesday, 18 February 2015 06:02:54 UTC+1, Petar Pilipovic wrote:

Hello aRkadeFR.
I have solved mine problem, I was working whit Python 2.X here,
and like you recommended I have done some  absolute import.
from forms import contactForm ,  and that solved it.
There was one other error, mine base.html did not render mine
block content, because I did not defined it, I did that and now
mine form is working.
Tank you.
Best.
Petar...;-)



On Tuesday, 17 February 2015 14:57:46 UTC+1, aRkadeFR wrote:

Two different problems here.

For your import of contactForm, please try the relative import
like:
from contact.forms import contactForm
> contact is your app name

try the (absolute_import)[1] too if you're python2.

[1] https://docs.python.org/2/library/__future__.html


Let us know if this works

On 02/17/2015 01:30 PM, Petar Pilipovic wrote:

Maybea this can help you, a bref info :
I made a contact app, I have defined app url in mine url root
project, then i made a forms.py file, i have defined form in
it, then i have made contact.html where I have defined
contact.html form which mine app will render, I have then go
to views.py an imported contactForm class.
Afther that I have defined connection between  contact.html
page and navbar.html, collected static, run server and bam
error occur.
I just can not explain to mine self how come he can not
import contactForm, and how com he can not render
havbar.html, error pop's out line 15.
On Tuesday, February 17, 2015, Petar Pilipovic
 wrote:
> Hello, I can not do it wright now I am not at home.
> As for mine forms.py, it is in mine contact app. I have two
apps in mine root project, one off them is contact.
> I will send you more info as soon as posible.
> Tank you.
>
>
> On Tuesday, February 17, 2015, aRkadeFR
 wrote:
>> Hello :)
>>
>> Can you dump us the layout of your files?
>> Where is your forms.py?
>>
>> Thanks
>>
>> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>>
>> Hello all, I am trying to build and e_commerc django app,
but I have encounter an confusing error.
>> Mine Error is:
>> Environment:
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>> Django Version: 1.7.4
>> Python Version: 2.7.6
>> Installed Applications:
>> ('django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'profiles')
>> Installed Middleware:
>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>
>> Template error:
>> In template
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html,
error at line 15
>>cannot import name contactForm
>>5 :   
>>
>>6 : Toggle
navigation
>>
>>7 : 
>>
>>8 : 
>>
>>9 : 
>>
>>10 :   
>>
  

Re: ImportError

2015-02-17 Thread Petar Pilipovic
aRkadeFR I have one other question regarding urls.py. I got this error when 
I am trying to go from contact or about to home page.


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

   1. ^$ [name='home']
   2. ^about/$ [name='about']
   3. ^contact/$ [name='contact']
   4. ^admin/
   5. ^static\/(?P.*)$
   6. ^media\/(?P.*)$

The current URL, contact/{% url 'home' %}, didn't match any of these.

Now mine root/urls.py , and this is mine navbar.html 
, every other thing is connected properly, and I can 
go from home page to contact, about, but I can not go reverse.
Can you explain to me where is the error?
Tank you.

On Wednesday, 18 February 2015 06:02:54 UTC+1, Petar Pilipovic wrote:
>
> Hello aRkadeFR.
> I have solved mine problem, I was working whit Python 2.X here, and like 
> you recommended I have done some  absolute import.
> from forms import contactForm ,  and that solved it.
> There was one other error, mine base.html did not render mine block 
> content, because I did not defined it, I did that and now mine form is 
> working.
> Tank you.
> Best.
> Petar...;-)
>
>
>
> On Tuesday, 17 February 2015 14:57:46 UTC+1, aRkadeFR wrote:
>>
>>  Two different problems here.
>>
>> For your import of contactForm, please try the relative import like:
>> from contact.forms import contactForm
>> > contact is your app name
>>
>> try the (absolute_import)[1] too if you're python2.
>>
>> [1] https://docs.python.org/2/library/__future__.html
>>
>> Let us know if this works
>>
>> On 02/17/2015 01:30 PM, Petar Pilipovic wrote:
>>  
>> Maybea this can help you, a bref info : 
>> I made a contact app, I have defined app url in mine url root project, 
>> then i made a forms.py file, i have defined form in it, then i have made 
>> contact.html where I have defined contact.html form which mine app will 
>> render, I have then go to views.py an imported contactForm class.
>> Afther that I have defined connection between  contact.html page and 
>> navbar.html, collected static, run server and bam error occur.
>> I just can not explain to mine self how come he can not import 
>> contactForm, and how com he can not render havbar.html, error pop's out 
>> line 15.
>> On Tuesday, February 17, 2015, Petar Pilipovic  wrote:
>> > Hello, I can not do it wright now I am not at home.
>> > As for mine forms.py, it is in mine contact app. I have two apps in 
>> mine root project, one off them is contact.
>> > I will send you more info as soon as posible.
>> > Tank you.
>> >
>> >
>> > On Tuesday, February 17, 2015, aRkadeFR  wrote:
>> >> Hello :)
>> >>
>> >> Can you dump us the layout of your files?
>> >> Where is your forms.py?
>> >>
>> >> Thanks
>> >>
>> >> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>> >>
>> >> Hello all, I am trying to build and e_commerc django app, but I have 
>> encounter an confusing error.
>> >> Mine Error is:
>> >> Environment:
>> >>
>> >> Request Method: GET
>> >> Request URL: http://127.0.0.1:8000/
>> >> Django Version: 1.7.4
>> >> Python Version: 2.7.6
>> >> Installed Applications:
>> >> ('django.contrib.admin',
>> >>  'django.contrib.auth',
>> >>  'django.contrib.contenttypes',
>> >>  'django.contrib.sessions',
>> >>  'django.contrib.messages',
>> >>  'django.contrib.staticfiles',
>> >>  'profiles')
>> >> Installed Middleware:
>> >> ('django.contrib.sessions.middleware.SessionMiddleware',
>> >>  'django.middleware.common.CommonMiddleware',
>> >>  'django.middleware.csrf.CsrfViewMiddleware',
>> >>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>> >>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>> >>  'django.contrib.messages.middleware.MessageMiddleware',
>> >>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>> >>
>> >> Template error:
>> >> In template 
>> /home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html, 
>> error at line 15
>> >>cannot import name contactForm
>> >>5 :   > data-toggle="collapse" data-target="#navbar" aria-expanded="false" 
>> aria-controls="navbar">
>> >>
>> >>6 : Toggle navigation
>> >>
>> >>7 : 
>> >>
>> >>8 : 
>> >>
>> >>9 : 
>> >>
>> >>10 :   
>> >>
>> >>11 :   Bootstrap theme
>> >>
>> >>12 : 
>> >>
>> >>13 : 
>> >>
>> >>14 :   
>> >>
>> >>15 : {% url 'home' as home %} 
>> >>
>> >>16 :{% url 'about' as about %}
>> >>
>> >>17 :{% url 'contact' as contact %}
>> >>
>> >>18 : > {%endif%}>Home
>> >>
>> >>19 : > {%endif%}>About
>> >>
>> >>20 : > class="active" {%endif%}>Contact
>> >>
>> >>21 : 
>> >>
>> >>22 :   > data-toggle="dropdown" role="button" aria-expanded="false">Dropdown > class="caret">
>> >>
>> >>23 :   

Re: ImportError

2015-02-17 Thread Petar Pilipovic
Hello aRkadeFR.
I have solved mine problem, I was working whit Python 2.X here, and like 
you recommended I have done some  absolute import.
from forms import contactForm ,  and that solved it.
There was one other error, mine base.html did not render mine block 
content, because I did not defined it, I did that and now mine form is 
working.
Tank you.
Best.
Petar...;-)



On Tuesday, 17 February 2015 14:57:46 UTC+1, aRkadeFR wrote:
>
>  Two different problems here.
>
> For your import of contactForm, please try the relative import like:
> from contact.forms import contactForm
> > contact is your app name
>
> try the (absolute_import)[1] too if you're python2.
>
> [1] https://docs.python.org/2/library/__future__.html
>
> Let us know if this works
>
> On 02/17/2015 01:30 PM, Petar Pilipovic wrote:
>  
> Maybea this can help you, a bref info : 
> I made a contact app, I have defined app url in mine url root project, 
> then i made a forms.py file, i have defined form in it, then i have made 
> contact.html where I have defined contact.html form which mine app will 
> render, I have then go to views.py an imported contactForm class.
> Afther that I have defined connection between  contact.html page and 
> navbar.html, collected static, run server and bam error occur.
> I just can not explain to mine self how come he can not import 
> contactForm, and how com he can not render havbar.html, error pop's out 
> line 15.
> On Tuesday, February 17, 2015, Petar Pilipovic  > wrote:
> > Hello, I can not do it wright now I am not at home.
> > As for mine forms.py, it is in mine contact app. I have two apps in mine 
> root project, one off them is contact.
> > I will send you more info as soon as posible.
> > Tank you.
> >
> >
> > On Tuesday, February 17, 2015, aRkadeFR  > wrote:
> >> Hello :)
> >>
> >> Can you dump us the layout of your files?
> >> Where is your forms.py?
> >>
> >> Thanks
> >>
> >> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
> >>
> >> Hello all, I am trying to build and e_commerc django app, but I have 
> encounter an confusing error.
> >> Mine Error is:
> >> Environment:
> >>
> >> Request Method: GET
> >> Request URL: http://127.0.0.1:8000/
> >> Django Version: 1.7.4
> >> Python Version: 2.7.6
> >> Installed Applications:
> >> ('django.contrib.admin',
> >>  'django.contrib.auth',
> >>  'django.contrib.contenttypes',
> >>  'django.contrib.sessions',
> >>  'django.contrib.messages',
> >>  'django.contrib.staticfiles',
> >>  'profiles')
> >> Installed Middleware:
> >> ('django.contrib.sessions.middleware.SessionMiddleware',
> >>  'django.middleware.common.CommonMiddleware',
> >>  'django.middleware.csrf.CsrfViewMiddleware',
> >>  'django.contrib.auth.middleware.AuthenticationMiddleware',
> >>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
> >>  'django.contrib.messages.middleware.MessageMiddleware',
> >>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
> >>
> >> Template error:
> >> In template 
> /home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html, 
> error at line 15
> >>cannot import name contactForm
> >>5 :data-toggle="collapse" data-target="#navbar" aria-expanded="false" 
> aria-controls="navbar">
> >>
> >>6 : Toggle navigation
> >>
> >>7 : 
> >>
> >>8 : 
> >>
> >>9 : 
> >>
> >>10 :   
> >>
> >>11 :   Bootstrap theme
> >>
> >>12 : 
> >>
> >>13 : 
> >>
> >>14 :   
> >>
> >>15 : {% url 'home' as home %} 
> >>
> >>16 :{% url 'about' as about %}
> >>
> >>17 :{% url 'contact' as contact %}
> >>
> >>18 :  {%endif%}>Home
> >>
> >>19 :  {%endif%}>About
> >>
> >>20 :  {%endif%}>Contact
> >>
> >>21 : 
> >>
> >>22 :data-toggle="dropdown" role="button" aria-expanded="false">Dropdown  class="caret">
> >>
> >>23 :   
> >>
> >>24 : Action
> >>
> >>25 : Another action
> >>
> >> Traceback:
> >> File 
> "/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/core/handlers/base.py"
>  
> in get_response
> >>   111. response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
> >> File 
> "/home/petarp/Documents/Udemy/Learn_Django/source/profiles/views.py" in home
> >>   7. return render(request, tempalte, context)
> >> File 
> "/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/shortcuts.py"
>  
> in render
> >>   50. return HttpResponse(loader.render_to_string(*args, **kwargs),
> >> File 
> "/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader.py"
>  
> in render_to_string
> >>   178. return t.render(context_instance)
> >> File 
> 

Re: ImportError

2015-02-17 Thread aRkadeFR

Two different problems here.

For your import of contactForm, please try the relative import like:
from contact.forms import contactForm
> contact is your app name

try the (absolute_import)[1] too if you're python2.

[1] https://docs.python.org/2/library/__future__.html

Let us know if this works

On 02/17/2015 01:30 PM, Petar Pilipovic wrote:

Maybea this can help you, a bref info :
I made a contact app, I have defined app url in mine url root project, 
then i made a forms.py file, i have defined form in it, then i have 
made contact.html where I have defined contact.html form which mine 
app will render, I have then go to views.py an imported contactForm class.
Afther that I have defined connection between  contact.html page and 
navbar.html, collected static, run server and bam error occur.
I just can not explain to mine self how come he can not import 
contactForm, and how com he can not render havbar.html, error pop's 
out line 15.
On Tuesday, February 17, 2015, Petar Pilipovic > wrote:

> Hello, I can not do it wright now I am not at home.
> As for mine forms.py, it is in mine contact app. I have two apps in 
mine root project, one off them is contact.

> I will send you more info as soon as posible.
> Tank you.
>
>
> On Tuesday, February 17, 2015, aRkadeFR > wrote:

>> Hello :)
>>
>> Can you dump us the layout of your files?
>> Where is your forms.py?
>>
>> Thanks
>>
>> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>>
>> Hello all, I am trying to build and e_commerc django app, but I 
have encounter an confusing error.

>> Mine Error is:
>> Environment:
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>> Django Version: 1.7.4
>> Python Version: 2.7.6
>> Installed Applications:
>> ('django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'profiles')
>> Installed Middleware:
>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>
>> Template error:
>> In template 
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html, error 
at line 15

>>cannot import name contactForm
>>5 :   aria-expanded="false" aria-controls="navbar">

>>
>>6 : Toggle navigation
>>
>>7 : 
>>
>>8 : 
>>
>>9 : 
>>
>>10 :   
>>
>>11 :   Bootstrap theme
>>
>>12 : 
>>
>>13 : 
>>
>>14 :   
>>
>>15 : {% url 'home' as home %}
>>
>>16 :{% url 'about' as about %}
>>
>>17 :{% url 'contact' as contact %}
>>
>>18 : class="active" {%endif%}>Home

>>
>>19 : class="active" {%endif%}>About

>>
>>20 : class="active" {%endif%}>Contact

>>
>>21 : 
>>
>>22 :   data-toggle="dropdown" role="button" aria-expanded="false">Dropdown 


>>
>>23 :   
>>
>>24 : Action
>>
>>25 : Another action
>>
>> Traceback:
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
>>   111. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
>> File 
"/home/petarp/Documents/Udemy/Learn_Django/source/profiles/views.py" 
in home

>>   7. return render(request, tempalte, context)
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/shortcuts.py" 
in render

>>   50. return HttpResponse(loader.render_to_string(*args, **kwargs),
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader.py" 
in render_to_string

>>   178. return t.render(context_instance)
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

>>   148. return self._render(context)
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in _render

>>   142. return self.nodelist.render(context)
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

>>   844. bit = self.render_node(node, context)
>> File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py" 
in render_node

>>   80. return node.render(context)
>> File 

Re: ImportError

2015-02-17 Thread Petar Pilipovic
Maybea this can help you, a bref info :
I made a contact app, I have defined app url in mine url root project, then
i made a forms.py file, i have defined form in it, then i have made
contact.html where I have defined contact.html form which mine app will
render, I have then go to views.py an imported contactForm class.
Afther that I have defined connection between  contact.html page and
navbar.html, collected static, run server and bam error occur.
I just can not explain to mine self how come he can not import contactForm,
and how com he can not render havbar.html, error pop's out line 15.
On Tuesday, February 17, 2015, Petar Pilipovic  wrote:
> Hello, I can not do it wright now I am not at home.
> As for mine forms.py, it is in mine contact app. I have two apps in mine
root project, one off them is contact.
> I will send you more info as soon as posible.
> Tank you.
>
>
> On Tuesday, February 17, 2015, aRkadeFR  wrote:
>> Hello :)
>>
>> Can you dump us the layout of your files?
>> Where is your forms.py?
>>
>> Thanks
>>
>> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>>
>> Hello all, I am trying to build and e_commerc django app, but I have
encounter an confusing error.
>> Mine Error is:
>> Environment:
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1:8000/
>> Django Version: 1.7.4
>> Python Version: 2.7.6
>> Installed Applications:
>> ('django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'profiles')
>> Installed Middleware:
>> ('django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>>
>> Template error:
>> In template
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html,
error at line 15
>>cannot import name contactForm
>>5 :   
>>
>>6 : Toggle navigation
>>
>>7 : 
>>
>>8 : 
>>
>>9 : 
>>
>>10 :   
>>
>>11 :   Bootstrap theme
>>
>>12 : 
>>
>>13 : 
>>
>>14 :   
>>
>>15 : {% url 'home' as home %}
>>
>>16 :{% url 'about' as about %}
>>
>>17 :{% url 'contact' as contact %}
>>
>>18 : Home
>>
>>19 : About
>>
>>20 : Contact
>>
>>21 : 
>>
>>22 :   Dropdown 
>>
>>23 :   
>>
>>24 : Action
>>
>>25 : Another action
>>
>> Traceback:
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
>>   111. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
>> File
"/home/petarp/Documents/Udemy/Learn_Django/source/profiles/views.py" in home
>>   7. return render(request, tempalte, context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/shortcuts.py"
in render
>>   50. return HttpResponse(loader.render_to_string(*args, **kwargs),
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader.py"
in render_to_string
>>   178. return t.render(context_instance)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>>   148. return self._render(context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in _render
>>   142. return self.nodelist.render(context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>>   844. bit = self.render_node(node, context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py"
in render_node
>>   80. return node.render(context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader_tags.py"
in render
>>   126. return compiled_parent._render(context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in _render
>>   142. return self.nodelist.render(context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>>   844. bit = self.render_node(node, context)
>> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py"
in render_node
>>   80. 

Re: ImportError

2015-02-17 Thread Petar Pilipovic
Hello, I can not do it wright now I am not at home.
As for mine forms.py, it is in mine contact app. I have two apps in mine
root project, one off them is contact.
I will send you more info as soon as posible.
Tank you.


On Tuesday, February 17, 2015, aRkadeFR  wrote:
> Hello :)
>
> Can you dump us the layout of your files?
> Where is your forms.py?
>
> Thanks
>
> On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
>
> Hello all, I am trying to build and e_commerc django app, but I have
encounter an confusing error.
> Mine Error is:
> Environment:
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
> Django Version: 1.7.4
> Python Version: 2.7.6
> Installed Applications:
> ('django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'profiles')
> Installed Middleware:
> ('django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware')
>
> Template error:
> In template
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html,
error at line 15
>cannot import name contactForm
>5 :   
>
>6 : Toggle navigation
>
>7 : 
>
>8 : 
>
>9 : 
>
>10 :   
>
>11 :   Bootstrap theme
>
>12 : 
>
>13 : 
>
>14 :   
>
>15 : {% url 'home' as home %}
>
>16 :{% url 'about' as about %}
>
>17 :{% url 'contact' as contact %}
>
>18 : Home
>
>19 : About
>
>20 : Contact
>
>21 : 
>
>22 :   Dropdown 
>
>23 :   
>
>24 : Action
>
>25 : Another action
>
> Traceback:
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
>   111. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
> File "/home/petarp/Documents/Udemy/Learn_Django/source/profiles/views.py"
in home
>   7. return render(request, tempalte, context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/shortcuts.py"
in render
>   50. return HttpResponse(loader.render_to_string(*args, **kwargs),
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader.py"
in render_to_string
>   178. return t.render(context_instance)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>   148. return self._render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in _render
>   142. return self.nodelist.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>   844. bit = self.render_node(node, context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py"
in render_node
>   80. return node.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader_tags.py"
in render
>   126. return compiled_parent._render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in _render
>   142. return self.nodelist.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>   844. bit = self.render_node(node, context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py"
in render_node
>   80. return node.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader_tags.py"
in render
>   150. return template.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>   148. return self._render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in _render
>   142. return self.nodelist.render(context)
> File
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py"
in render
>   844. bit = self.render_node(node, context)
> File

Re: ImportError

2015-02-17 Thread aRkadeFR

Hello :)

Can you dump us the layout of your files?
Where is your forms.py?

Thanks

On 02/17/2015 06:36 AM, Petar Pilipovic wrote:
Hello all, I am trying to build and e_commerc django app, but I have 
encounter an confusing error.

Mine Error is:
|
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 1.7.4
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'profiles')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Template error:
In template 
/home/petarp/Documents/Udemy/Learn_Django/static/templates/navbar.html, error 
at line 15

 cannot import name contactForm
   5 :   data-toggle="collapse" data-target="#navbar" aria-expanded="false" 
aria-controls="navbar">



   6 : Toggle navigation


   7 : 


   8 : 


   9 : 


   10 :   


   11 :   Bootstrap theme


   12 : 


   13 : 


   14 :   


   15 : {% url 'home' as home %}


   16 :{% url 'about' as about %}


   17 :{% url 'contact' as contact %}


   18 : {%endif%}>Home



   19 : {%endif%}>About



   20 : class="active" {%endif%}>Contact



   21 : 


   22 :   data-toggle="dropdown" role="button" aria-expanded="false">Dropdown 




   23 :   


   24 : Action


   25 : Another action


Traceback:
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  111. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"/home/petarp/Documents/Udemy/Learn_Django/source/profiles/views.py" 
in home

  7.   return render(request, tempalte, context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/shortcuts.py" 
in render

  50. return HttpResponse(loader.render_to_string(*args, **kwargs),
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader.py" 
in render_to_string

  178. return t.render(context_instance)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

  148. return self._render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in _render

  142. return self.nodelist.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

  844. bit = self.render_node(node, context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py" 
in render_node

  80. return node.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader_tags.py" 
in render

  126. return compiled_parent._render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in _render

  142. return self.nodelist.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

  844. bit = self.render_node(node, context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py" 
in render_node

  80. return node.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/loader_tags.py" 
in render

  150. return template.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

  148. return self._render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in _render

  142. return self.nodelist.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/base.py" 
in render

  844. bit = self.render_node(node, context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/debug.py" 
in render_node

  80. return node.render(context)
File 
"/home/petarp/.virtualenvs/e_udemy/local/lib/python2.7/site-packages/django/template/defaulttags.py" 
in render
  444.   

Re: ImportError: No module named check_constraints

2015-01-14 Thread Collin Anderson
Hi,

Yes, a full traceback would be helpful, if you can get it. If it's a 
manage.py commany, you may need to use --traceback.

Collin

On Tuesday, January 13, 2015 at 5:38:47 AM UTC-5, Jenefa Jeyaraj wrote:
>
> ImportError: No module named check_constraints
>
>

-- 
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/7626b728-5342-4f64-8bd9-3110f1d9cd30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: No module named check_constraints

2015-01-13 Thread Babatunde Akinyanmi
I don't think you are going to get any helpful replies with that kind of
statement?
On 13 Jan 2015 13:04, "Jenefa Jeyaraj"  wrote:

> ImportError: No module named check_constraints
>
>  --
> 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/4d42cbdc-49ea-4f24-97f5-d7a2e0dc62b6%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BWjgXPus81Pb35bO4OxBS4WC254NRvkw7XJWLNO_AO85UEc_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-21 Thread jogaserbia
Hi All,

Thanks very much for the help.  I managed to figure it out with tips for 
both of you. 

I am not sure exactly what helped finally fix it but:

1) I changed my python version from 64 bit to 32 bit
2) The script in that updated the path variables were pretty messed up, so 
I manually changed them to what they should have been. 
2) I had incorrectly added the GEOS_LIBRARY_PATH of

C:\program files\OSGeo4W\bin\geos_c.dll  

but I should have added:

C:\OSGeo4W\bin\geos_c.dll 

Now, I can just delete the GEOS_LIBRARY_PATH from the project settings and 
things still work, so I guess it must have been the 64 bit vs 32 bit issue, 
or the path issue.  

Thanks again for the advice. 

Ivan

-- 
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/05ba169a-f223-4d48-b445-368bebb530cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-20 Thread Tom Lockhart
> Thanks for the reply.  Yes, I am using a virtualenv for this project.  I’ll 
> try to stick it out with GeoDjango, but I really do not know what to do now 
> to try to continue on with the install.  

I would probably stop “continuing”, and go back to the start. afaict the 
installation instructions for Windows in the Django docs (mentioned by Carl) 
should address the path issues you are seeing. In particular, the lines 
including “set PATH=%PATH%;…” and the registry updates in the “Modify Windows 
environment” section of the GeoDjango installation instructions would seem to 
cover it.

If after starting over and slavishly following the instructions you still see 
the path issues, post the values of the variables from the installation 
instructions which are actually set on your system (e.g. PATH). We should be 
able to help a bit more. Not me since I don’t know much about Windows, but 
someone will…

hth

- Tom


> 
> At this point in my Django career, I am pretty much a monkey banking on a 
> keyboard when troubleshooting this type of issue.   On that note, can you 
> possible refer me to any program/documentation on how I would troubleshoot 
> such an issue (stepping through code, checking variable values, etc).
> 
> If and when I get this up and running, I'll have to put all of the info 
> somewhere, for other peoples' reference.  
> 
> Ivan  
> 
> On Thursday, November 20, 2014 9:38:09 AM UTC-5, Thomas wrote:
> 
> On Nov 19, 2014, at 2:24 PM, jogaserbia  wrote: 
> 
> > Thanks for the help Carl.  Also, thanks for filing the ticket. 
> > 
> > Every bit of info helps.  I really do like Python and Django so far.   
> > 
> > I am just wondering whether I should just quit trying to make GeoDjango 
> > work on my windows machine (at work).  I will be setting up a linux machine 
> > at home in the next couple of months, and can try it out again.   
> 
> Windows boxes can be cranky and annoying, but I’d stick with it and just Make 
> It Work. Once you have a complete installation (and document how you got 
> there!) you won’t have to think hard about it again. Or use virtualbox (and 
> Docker on top of it) to get started with your Linux installation now. 
> 
> You *are* using virtualenv, right? That is very high on my list of things 
> that make my life easier for setting up development systems and deploying to 
> production. You may find that it helps with some of the issues you are seeing 
> on your system. 
> 
> > As a workaround, what I could probably do (if I can figure it out) is call 
> > the postgres fuctions for distance between Lon Lat points that will serve 
> > as the basis for the application that I am building.   
> 
> Yeah, I wrote that code back in the day and I would use GeoDjango. Not that 
> it doesn’t do what it says it does, but GeoDjango gives you everything you 
> will need all at once. 
> 
> hth 
> 
> - Tom 
> 
> 
> -- 
> 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/fa610d6b-352e-411b-b831-1540b2c67724%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Please consider the environment before printing this message.
This message may be privileged and/or confidential, and the sender does not 
waive any related rights and obligations.  Any distribution, use or copying of 
this message or the information it contains by other than an intended recipient 
is unauthorized.  If you received this message in error, please immediately 
advise me by return e-mail or phone.  All information, references, images, 
programs, source code, or other materials whatsoever contained in, or supplied 
with, this document are TRADE SECRETS and governed by the Uniform Trade Secrets 
Act.  User assumes all direct and consequential liabilities and costs that 
result from any unauthorized disclosure or use of this information.

-- 
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/A1A3A838-5FAA-481B-9268-62ED7DBF17D6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-20 Thread jogaserbia
Hi Thomas,

Thanks for the reply.  Yes, I am using a virtualenv for this project.  I'll 
try to stick it out with GeoDjango, but I really do not know what to do now 
to try to continue on with the install.  

At this point in my Django career, I am pretty much a monkey banking on a 
keyboard when troubleshooting this type of issue.   On that note, can you 
possible refer me to any program/documentation on how I would troubleshoot 
such an issue (stepping through code, checking variable values, etc).

If and when I get this up and running, I'll have to put all of the info 
somewhere, for other peoples' reference.  

Ivan  

On Thursday, November 20, 2014 9:38:09 AM UTC-5, Thomas wrote:
>
>
> On Nov 19, 2014, at 2:24 PM, jogaserbia  
> wrote: 
>
> > Thanks for the help Carl.  Also, thanks for filing the ticket. 
> > 
> > Every bit of info helps.  I really do like Python and Django so far.   
> > 
> > I am just wondering whether I should just quit trying to make GeoDjango 
> work on my windows machine (at work).  I will be setting up a linux machine 
> at home in the next couple of months, and can try it out again.   
>
> Windows boxes can be cranky and annoying, but I’d stick with it and just 
> Make It Work. Once you have a complete installation (and document how you 
> got there!) you won’t have to think hard about it again. Or use virtualbox 
> (and Docker on top of it) to get started with your Linux installation now. 
>
> You *are* using virtualenv, right? That is very high on my list of things 
> that make my life easier for setting up development systems and deploying 
> to production. You may find that it helps with some of the issues you are 
> seeing on your system. 
>
> > As a workaround, what I could probably do (if I can figure it out) is 
> call the postgres fuctions for distance between Lon Lat points that will 
> serve as the basis for the application that I am building.   
>
> Yeah, I wrote that code back in the day and I would use GeoDjango. Not 
> that it doesn’t do what it says it does, but GeoDjango gives you everything 
> you will need all at once. 
>
> hth 
>
> - Tom 
>
>

-- 
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/fa610d6b-352e-411b-b831-1540b2c67724%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-20 Thread Tom Lockhart

On Nov 19, 2014, at 2:24 PM, jogaserbia  wrote:

> Thanks for the help Carl.  Also, thanks for filing the ticket. 
> 
> Every bit of info helps.  I really do like Python and Django so far.  
> 
> I am just wondering whether I should just quit trying to make GeoDjango work 
> on my windows machine (at work).  I will be setting up a linux machine at 
> home in the next couple of months, and can try it out again.  

Windows boxes can be cranky and annoying, but I’d stick with it and just Make 
It Work. Once you have a complete installation (and document how you got 
there!) you won’t have to think hard about it again. Or use virtualbox (and 
Docker on top of it) to get started with your Linux installation now.

You *are* using virtualenv, right? That is very high on my list of things that 
make my life easier for setting up development systems and deploying to 
production. You may find that it helps with some of the issues you are seeing 
on your system.

> As a workaround, what I could probably do (if I can figure it out) is call 
> the postgres fuctions for distance between Lon Lat points that will serve as 
> the basis for the application that I am building.  

Yeah, I wrote that code back in the day and I would use GeoDjango. Not that it 
doesn’t do what it says it does, but GeoDjango gives you everything you will 
need all at once.

hth

- Tom

-- 
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/39DE9C97-10DD-4C0A-85B2-3B8EAE12B093%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread jogaserbia
Thanks for the help Carl.  Also, thanks for filing the ticket. 

Every bit of info helps.  I really do like Python and Django so far.  

I am just wondering whether I should just quit trying to make GeoDjango 
work on my windows machine (at work).  I will be setting up a linux machine 
at home in the next couple of months, and can try it out again.  

As a workaround, what I could probably do (if I can figure it out) is call 
the postgres fuctions for distance between Lon Lat points that will serve 
as the basis for the application that I am building.  

What I am in effect trying to do in the Django app I am building is:

find the closets 3 locations (from a list of locations in a postgres 
database) to the address location that will be passed via input box (and 
might be run through a Google to get the Lon Lat info).  

Thanks again, 

Ivan

-- 
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/f6da3ce0-88a0-436d-b6ea-6fb6c3f8505c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread Carl Meyer
Hi Ivan,

On 11/19/2014 02:58 PM, jogaserbia wrote:
> Hi Carl,
> 
> Thanks very much for the response.  
> 
> I am trying to get GeoDjango up and running (for a couple of days now)
> and am having a really hard time.  

Sorry about that :/ I know the dependencies for GeoDjango can be hard to
set up in general, and it may well be worse on Windows (at the very
least, I'm sure the process is less well-tested, since I think most
users and developers of GeoDjango use OS X or Linux). Unfortunately
since I'm not an expert on GeoDjango, and I know even less about
Windows, I'm not sure I'll be able to help.

> I came across another question on the internet (that does not
> specifically have to do with my issue) that suggested putting this path
> variable into the project setting (today):
> 
> GEOS_LIBRARY_PATH = r'C:\Program Files\OSGeo4W64\bin\geos_c.dll'
> 
> Sadly, I do not know why this would work to rectify the initial problem. 
> 
> I think it gets past the GEOSException error, but another error is
> coming up:
> 
> *OSError: [WinError 126] The specified module could not be found*

This error is still related to being unable to load the GEOS libraries -
but that's about all I can tell you.

> Since I am new to all of these particular technologies (Django, Python,
> GeoDjango) I do not know where to begin troubleshooting these.  I am not
> even clear on how to read the below traceback (i.e. where the block of
> code are delineated.  I am assuming each time I see *File*, that is a
> new code block that is being run).  

Yes, each "File ..." line represents a stack frame.

Carl

-- 
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/546D1551.3030004%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread jogaserbia
Hi Carl,

Thanks very much for the response.  

I am trying to get GeoDjango up and running (for a couple of days now) and 
am having a really hard time.  

I came across another question on the internet (that does not specifically 
have to do with my issue) that suggested putting this path variable into 
the project setting (today):

GEOS_LIBRARY_PATH = r'C:\Program Files\OSGeo4W64\bin\geos_c.dll'

Sadly, I do not know why this would work to rectify the initial problem. 

I think it gets past the GEOSException error, but another error is coming 
up:

*OSError: [WinError 126] The specified module could not be found*

Since I am new to all of these particular technologies (Django, Python, 
GeoDjango) I do not know where to begin troubleshooting these.  I am not 
even clear on how to read the below traceback (i.e. where the block of code 
are delineated.  I am assuming each time I see *File*, that is a new code 
block that is being run).  

Ivan 


  File 
"C:\Python34\lib\site-packages\django\contrib\gis\forms\__init__.py", lin
e 2, in 
from .fields import (GeometryField, GeometryCollectionField, 
PointField,  #
NOQA
  File "C:\Python34\lib\site-packages\django\contrib\gis\forms\fields.py", 
line
8, in 
from django.contrib.gis.geos import GEOSException, GEOSGeometry
  File "C:\Python34\lib\site-packages\django\contrib\gis\geos\__init__.py", 
line
 9, in 
from .libgeos import geos_version, geos_version_info  # NOQA: flake8 
detects
 only the last __all__
  File "C:\Python34\lib\site-packages\django\contrib\gis\geos\libgeos.py", 
line
61, in 
lgeos = CDLL(lib_path)
  File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

-- 
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/0fa27af4-f7d9-43d9-a522-881d228d9769%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread Carl Meyer
Hello,

On 11/18/2014 09:53 AM, jogaserbia wrote:
> I just realized something.  
> 
>  
> This are all the files in django.contrib.gis.geos:
>  
> Notice there is no GEOSException, nor is there GEOSGeometry.   There is
> however geometry.py (which as the class GEOSGeometry in it) and error.py
> (which has the class GEOSException in it). 
>  
> I am not sure what to do with this information as I am new to
> Python/Django.

Sorry, this error message is obscure. I have filed a ticket to improve
it: https://code.djangoproject.com/ticket/23873

The cause of the error message is that you do not have an installation
of GEOS that is on your `sys.path` and importable. (That is, something
in
https://docs.djangoproject.com/en/1.7/ref/contrib/gis/install/#osgeo4w
or the following step didn't work correctly.)

If you look in django/contrib/gis/geos/__init__.py, you'll see that
GEOSException is only imported there if HAS_GEOS is True. That is why
importing GEOSException from django.contrib.gis.geos will succeed if you
have GEOS installed, but fails otherwise.

Carl

-- 
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/546D0E22.6070806%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: ImportError: cannot import name 'GEOSException'

2014-11-18 Thread jogaserbia

>
> I just realized something.  
>
 
This are all the files in django.contrib.gis.geos:
 
Notice there is no GEOSException, nor is there GEOSGeometry.   There is 
however geometry.py (which as the class GEOSGeometry in it) and error.py 
(which has the class GEOSException in it).  
 
I am not sure what to do with this information as I am new to 
Python/Django. 
 
 Directory of C:\Python34\Lib\site-packages\django\contrib\gis\geos
11/06/2014  02:02 PM  .
11/06/2014  02:02 PM  ..
11/06/2014  02:02 PM 1,660 base.py
11/06/2014  02:02 PM 4,482 collections.py
11/06/2014  02:02 PM 5,495 coordseq.py
11/06/2014  02:02 PM   813 error.py
11/06/2014  02:02 PM 1,033 factory.py
11/06/2014  02:02 PM25,297 geometry.py
11/06/2014  02:02 PM   810 io.py
11/06/2014  02:02 PM 5,287 libgeos.py
11/06/2014  02:02 PM 1,530 LICENSE
11/06/2014  02:02 PM 5,813 linestring.py
11/06/2014  02:02 PM10,974 mutable_list.py
11/06/2014  02:02 PM 4,400 point.py
11/06/2014  02:02 PM 6,827 polygon.py
11/06/2014  02:02 PM 2,428 prepared.py
11/06/2014  02:02 PM  prototypes
11/06/2014  02:02 PM  tests
11/06/2014  02:02 PM 1,154 __init__.py
11/06/2014  02:02 PM  __pycache__ 

-- 
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/48dd3430-110f-46db-8b11-4751cb28022e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-18 Thread jogaserbia
I got the same error when I run the following command in the Python Shell:

from django.contrib.gis.db import models 

-- 
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/776b7522-7d67-4a43-afa3-0caff9c041cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-18 Thread jogaserbia
Python 3.4

On Tuesday, November 18, 2014 9:15:29 AM UTC-5, jogaserbia wrote:
>
> Forgot to mention Django 1.7.
>
> Thanks,
>
> Ivan
>

-- 
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/4460f8c0-5993-492f-8596-6c72ae2db375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name 'GEOSException'

2014-11-18 Thread jogaserbia
Forgot to mention Django 1.7.

Thanks,

Ivan

-- 
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/67760e86-25d9-4d6b-82cd-47b4d16b92bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError failure

2014-10-22 Thread Juan Carlos
Hi Serdar,
Sure, you're right.
Thanks, thank you very much!
Regards,
Juan

El miércoles, 22 de octubre de 2014 06:53:06 UTC-5, Serdar Dalgic escribió:
>
> Hi Juan, 
>
> I believe you might have a problem while importing "example". Can you 
> check the line you're importing example and where did you put this 
> "exsite.example" module? 
>
> Your directory structure should be like this: 
>
> mysite/ 
> manage.py 
> mysite/ 
> __init__.py 
> settings.py 
> urls.py 
> wsgi.py 
> exsite/ 
> __init__.py 
> example.py 
> another_app/ 
> __init__.py 
>another_module.py 
>
> So that you can import exsite.example in your another_module.py like: 
>
> from exsite.example import AnyClassYouWantToImport 
>
> I hope this helps. 
>
> p.s. mind the "__init__.py"s on the modules you want to import. There 
> must be one in your "exsite" dir. 
> p.s.2. Instead of an example.py file under exsite dir, you may have 
> written it under __init__.py file as 
>
> mysite/ 
> ... 
> mysite/ 
> __init__.py 
> ... 
>
> in this __init__.py, you may have 
> class Example(object): 
> ... 
> ... 
>
> this is OK either ;) 
>
>
> - Serdar Dalgıç  
> FLOSS Developer, Life & Nature Hacker 
> twitter: 
> https://twitter.com/serdaroncode 
> https://twitter.com/serdarintowild 
>
>
> On Wed, Oct 22, 2014 at 5:35 AM, Juan Carlos  > wrote: 
> > Hi everyone, 
> > 
> > When I execute 
> > python manage.py runserver 
> > 
> > it appers: 
> > ImportError: cannot import name 'example' from 'exsite' 
> > 
> > The relative code in the settings.py file is: 
> > 
> > INSTALLED_APPS = ( 
> > 'django.contrib.admin', 
> > 'django.contrib.auth', 
> > 'django.contrib.contenttypes', 
> > 'django.contrib.sessions', 
> > 'django.contrib.messages', 
> > 'django.contrib.staticfiles', 
> > 'exsite.example', 
> > ) 
> > 
> > What can I do? 
> > 
> > My django version is 1.7, with Python 2.7.  I'm new in this interesting 
> > world of Django.  Thanks for your help, and time. 
> > 
> > Regards, 
> > Juan 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/13bae8aa-77d9-4ba6-b038-d9ce37a37c9c%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59475bc6-8e4e-466d-9db9-1ecb7a4e4b9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError cannot import name

2014-10-22 Thread Sabine Maennel
Hello Juan,

I think your settings file should look like this:
In *settings.py* I have:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'example',
)

but to be sure I would need to see you directory structure. Hope this 
helps. 
with kind regards
 Sabine



Am Mittwoch, 22. Oktober 2014 13:38:24 UTC+2 schrieb Sabine Maennel:
>
> Hello Juan, if your project is "exsite" and your app is "example" then you 
> should probably just add "example" to the list of installed apps. Try it, 
> hope it works.
> with kind regards
> Sabine
>
> Am Mittwoch, 22. Oktober 2014 06:16:25 UTC+2 schrieb Juan Carlos:
>>
>> Hi everyone,
>>
>> When I execute the command:
>>
>> python manage.py runserver &
>>
>> The response is:
>>
>> Traceback (most recent call last):
>>   File "../manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 385, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 354, in execute
>> django.setup()
>>   File "/usr/lib/python2.7/site-packages/django/__init__.py", line 21, in 
>> setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 
>> 85, in populate
>> app_config = AppConfig.create(entry)
>>   File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 
>> 120, in create
>> "cannot import name '%s' from '%s'" % (cls_name, mod_path))
>> ImportError: cannot import name 'example' from 'exsite'
>>
>> In *settings.py* I have:
>>
>> INSTALLED_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'exsite.example',
>> )
>>
>> If I comment (#) the last line, the bug dissapears.  ¿What can I do?  I 
>> have Django 1.7 with Python 2.7.  Thanks for your attention.
>>
>> Regards,
>> Juan
>>
>

-- 
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/e49bec3e-d757-4335-aab0-78faeb316638%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError failure

2014-10-22 Thread Serdar Dalgic
Hi Juan,

I believe you might have a problem while importing "example". Can you
check the line you're importing example and where did you put this
"exsite.example" module?

Your directory structure should be like this:

mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py
exsite/
__init__.py
example.py
another_app/
__init__.py
   another_module.py

So that you can import exsite.example in your another_module.py like:

from exsite.example import AnyClassYouWantToImport

I hope this helps.

p.s. mind the "__init__.py"s on the modules you want to import. There
must be one in your "exsite" dir.
p.s.2. Instead of an example.py file under exsite dir, you may have
written it under __init__.py file as

mysite/
...
mysite/
__init__.py
...

in this __init__.py, you may have
class Example(object):
...
...

this is OK either ;)


- Serdar Dalgıç 
FLOSS Developer, Life & Nature Hacker
twitter:
https://twitter.com/serdaroncode
https://twitter.com/serdarintowild


On Wed, Oct 22, 2014 at 5:35 AM, Juan Carlos  wrote:
> Hi everyone,
>
> When I execute
> python manage.py runserver
>
> it appers:
> ImportError: cannot import name 'example' from 'exsite'
>
> The relative code in the settings.py file is:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'exsite.example',
> )
>
> What can I do?
>
> My django version is 1.7, with Python 2.7.  I'm new in this interesting
> world of Django.  Thanks for your help, and time.
>
> Regards,
> Juan
>
> --
> 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/13bae8aa-77d9-4ba6-b038-d9ce37a37c9c%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJH%2Bopprv6qLmfCvJwFdGwUs86JMOFBGtABu8Zq-Q_8zcdYPSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError cannot import name

2014-10-22 Thread Sabine Maennel
Hello Juan, if your project is "exsite" and your app is "example" then you 
should probably just add "example" to the list of installed apps. Try it, 
hope it works.
with kind regards
Sabine

Am Mittwoch, 22. Oktober 2014 06:16:25 UTC+2 schrieb Juan Carlos:
>
> Hi everyone,
>
> When I execute the command:
>
> python manage.py runserver &
>
> The response is:
>
> Traceback (most recent call last):
>   File "../manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 385, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 354, in execute
> django.setup()
>   File "/usr/lib/python2.7/site-packages/django/__init__.py", line 21, in 
> setup
> apps.populate(settings.INSTALLED_APPS)
>   File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 
> 85, in populate
> app_config = AppConfig.create(entry)
>   File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 120, 
> in create
> "cannot import name '%s' from '%s'" % (cls_name, mod_path))
> ImportError: cannot import name 'example' from 'exsite'
>
> In *settings.py* I have:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'exsite.example',
> )
>
> If I comment (#) the last line, the bug dissapears.  ¿What can I do?  I 
> have Django 1.7 with Python 2.7.  Thanks for your attention.
>
> Regards,
> Juan
>

-- 
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/df1d736d-8af4-42bd-b52a-4b489f867c05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: No module named core in django 1.5.5

2014-03-19 Thread Alex Scoble
Never mind on this one. Ended up creating a virtual environment and running 
django in that and it's working now.

Thanks,

Alex

On Tuesday, March 18, 2014 10:32:01 AM UTC-7, Alex Scoble wrote:
>
> Hi All,
>
> Running CentOS 6.4 with python 2.6.6 and django 1.5.5
>
> Doing this at prompt works: python -c 'import django; print 
> django.VERSION'
> Returns: (1, 5, 5, 'final', 0)
>
> However, running django-admin.py or 
>
> import django
>
> from django.core.management import execute_from_command_line
>
> when in Python result in errors such as
>
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/django/bin/django-admin.py", line 
> 2, in 
> from django.core import management
> ImportError: No module named core
>
>
> or 
>
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named core.management
>
>
> Django 1.5.4 was running fine on this box. I'm not using virtual 
> environments and it doesn't look like those are required for what I'm doing 
> (running webvirtmgr https://github.com/retspen/webvirtmgr ). I've 
> uninstalled and reinstalled django using pip and still have same issues.
>
> Any ideas on what to check?
>
> Thanks,
>
> Alex
>

-- 
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/e4b5bb7d-c9ed-4f3b-9ce7-b343277b00d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError: cannot import name execute_manager

2014-02-07 Thread Larry Martell
On Fri, Feb 7, 2014 at 10:53 AM, felix kimutai  wrote:
> I get the following error
>
>  " Traceback (most recent call last):
>   File "manage.py", line 2, in 
> from django.core.management import execute_manager
> ImportError: cannot import name execute_manager "
>
>  when I run this command : python manage.py runserver, what could be the
> problem.

Sounds like the version of manage.py you have is not compatable with
the version of django you have.

https://docs.djangoproject.com/en/1.4/releases/1.4/#updated-default-project-layout-and-manage-py

-- 
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/CACwCsY4teeS%3DE79mUOeSASnXvi4U%2BQXJan4rY%3DYmphs4C0VLpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named django.core

2014-01-13 Thread Mrinmoy Das
activate your virtualenv.

Mrinmoy Das
http://goromlagche.in/


On Mon, Jan 13, 2014 at 5:47 PM,  wrote:

> I get this error while creating New Project.
>
> radhika$ django-admin.py startproject housing
>
> Traceback (most recent call last):
>
>   File "/usr/local/bin/django-admin.py", line 2, in 
>
> from django.core import management
>
> ImportError: No module named django.core
>
> Any suggestions on this please. Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To 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/7c9e503e-8127-4b8d-8f45-78ab71e3d14a%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/CAFWA-MMU1ZCY-m4ZutPx3cv2q1xmoMbzsQ5iu99_txabZN0Gog%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError at /admin/

2013-11-14 Thread Claudio Filho
Último Zhô
LoSs ihoodizincluding ds sozorsoazolWhizoOaozi i
Em 14 de Nov de 2013 10:27, "Swastik Acharya" 
escreveu:

> I m trying to read the html pages
> but it shows the folowiing error::
> mportError at /admin/
>
> No module named views
>
> Request Method:GETRequest URL:http://127.0.0.1:8050/admin/Django Version:
> 1.4.10Exception Type:ImportErrorException Value:
>
> No module named views
>
> Exception 
> Location:/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
> in import_module, line 35Python Executable:/usr/bin/pythonPython Version:
> 2.7.2Python Path:
>
> ['/home/swastik/Desktop/django1/vxlp',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-linux2',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PIL',
>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/pymodules/python2.7',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>
> Server time:Thu, 14 Nov 2013 04:18:10 -0600
> Traceback Switch to copy-and-paste view 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
> in get_response
>1.
>
>   response = callback(request, *callback_args, 
> **callback_kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in wrapper
>1.
>
>   return self.admin_view(view, cacheable)(*args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
>_wrapped_view
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>-
>/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
> in _wrapped_view_func
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in inner
>1.
>
>  current_app=self.name):
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in reverse
>1.
>
>   app_list = resolver.app_dict[ns]
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in app_dict
>1.
>
>   self._populate()
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in _populate
>1.
>
>   lookups.appendlist(pattern.callback, (bits, p_pattern, 
> pattern.default_args))
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in callback
>1.
>
>   self._callback = get_callable(self._callback_str)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in
>wrapper
>1.
>
>   result = func(*args)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in get_callable
>1.
>
>   lookup_view = getattr(import_module(mod_name), 
> func_name)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
>▶ Local vars 
>
>
> how to solve this error??
>
> --
> 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/1281eb8c-e338-4d8b-aabd-984fcb684f85%40googlegroups.com
> .
> For more options, visit 

Re: ImportError at /admin/

2013-11-14 Thread Avraham Serour
somewhere you are trying to do a 'import views' and python can't find
nothing with this name,

try using from appname import views


On Thu, Nov 14, 2013 at 12:25 PM, Swastik Acharya wrote:

> I m trying to read the html pages
> but it shows the folowiing error::
> mportError at /admin/
>
> No module named views
>
> Request Method:GET Request URL:http://127.0.0.1:8050/admin/ Django
> Version:1.4.10Exception Type: ImportErrorException Value:
>
>
> No module named views
>
> Exception 
> Location:/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
> in import_module, line 35 Python Executable:/usr/bin/python Python
> Version:2.7.2Python Path:
>
> ['/home/swastik/Desktop/django1/vxlp',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-linux2',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PIL',
>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/pymodules/python2.7',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>
> Server time: Thu, 14 Nov 2013 04:18:10 -0600
> Traceback Switch to copy-and-paste view 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
> in get_response
>1.
>
>   response = callback(request, *callback_args, 
> **callback_kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in wrapper
>1.
>
>   return self.admin_view(view, cacheable)(*args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
>_wrapped_view
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>-
>/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
> in _wrapped_view_func
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in inner
>1.
>
>  current_app=self.name):
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in reverse
>1.
>
>   app_list = resolver.app_dict[ns]
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in app_dict
>1.
>
>   self._populate()
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in _populate
>1.
>
>   lookups.appendlist(pattern.callback, (bits, p_pattern, 
> pattern.default_args))
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in callback
>1.
>
>   self._callback = get_callable(self._callback_str)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in
>wrapper
>1.
>
>   result = func(*args)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in get_callable
>1.
>
>   lookup_view = getattr(import_module(mod_name), 
> func_name)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
>▶ Local vars 
>
>
> how to solve this error??
>
> --
> 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
> 

Re: ImportError: No module named filestorage

2013-11-13 Thread tim
I did a Google search for "from filestorage import DatabaseStorage" and 
came up with this link:

https://bitbucket.org/david/django-storages/issue/132/name-databasestorage-is-not-defined

On Tuesday, November 12, 2013 1:15:13 AM UTC-5, ckg...@gmail.com wrote:
>
> i was doing this on the python interactive
>
> from filestorage import DatabaseStorage
>
>
> what do i need to install so i dont get this error:
>
>
> ImportError: No module named filestorage
>

-- 
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/0191b2f0-5bc2-4c11-b9c9-8f572bcccb7c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread Timothy W. Cook
Al I know is that I can run Django from a virtualenv using the development
server.  I have to disable SELinux to get Apache to run my Django app via
WSGI.

I am sure there are settings that you can make (have made) to SELinux to
allow access but I have not studied it to find out what they are.




On Mon, Oct 28, 2013 at 1:47 PM, G. Allegri  wrote:

> Hi Timothy,
> I'm on a managed server, so I cannot do system changes that would require
> reboot.
> Anyway, setenforce says that SELinux is disabled (even setenforce 1).
>
> Do you think it is SELinux to block Python module loading?
> If I activate my virtualenv from shell I can load Django.
>
> giovanni
>
>
>
> 2013/10/28 Timothy W. Cook 
>
>>
>>
>>
>> CentOS is a bit of a PITA. Because it is so secure.  Try turning off
>> SELinux
>>
>>
>> http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
>>
>> To test this out from the commandline:
>>
>> $setenforce 0
>>
>>
>> How to actually make it work WITH SELinux? I haven't figured that out yet.
>>
>> HTH,
>> Tim
>>
>>
>>
>> On Mon, Oct 28, 2013 at 1:06 PM, Giovanni Allegri wrote:
>>
>>> I'm getting mad with this error.
>>> I've setup Apache and wsgi configuration as usual, but this time I'm on
>>> CentOS instead of Debian, and I don't know it very well.
>>> Anyway, I tried all the ways to give mod_wsgi the chance to peak from my
>>> virtualenv libraries, both setting them with python-path argument to
>>> WSGIScriptAlias, and using site.addsitedir in my wsgi module.
>>> Printing sys.path gives me all the possible folders:
>>>
>>> ['/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
>>> '/home/giohappy/.virtualenvs/django/lib64/python2.6',
>>> '/home/giohappy/.virtualenvs/django/lib64/python2.6/site-packages',
>>> '/usr/lib/python2.6/site-packages/distribute-0.6.49-py2.6.egg',
>>> '/usr/lib/python2.6/site-packages/pip-1.4.1-py2.6.egg',
>>> '/usr/lib64/python26.zip', '/usr/lib64/python2.6',
>>> '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk',
>>> '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload',
>>> '/usr/lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages',
>>> '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
>>> '/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
>>> '/home/giohappy/.virtualenvs/django/lib/python2.6/site-packages']
>>>
>>> but still I get  ImportError: No module named django.core.wsgi
>>>
>>> Could you help to sort it out?
>>> giovanni
>>>
>>> --
>>> 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/00266e62-34b1-49d8-a981-761c374568a9%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> MLHIM VIP Signup: http://goo.gl/22B0U
>> 
>> Timothy Cook, MSc   +55 21 94711995
>> MLHIM http://www.mlhim.org
>> Like Us on FB: https://www.facebook.com/mlhim2
>> Circle us on G+: http://goo.gl/44EV5
>> Google Scholar: http://goo.gl/MMZ1o
>> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>>
>> --
>> 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/lhTc7rZgoIs/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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WBswduqcraq0W52nZ2JFwWAdzJ5rRQpPTwJ%2BCpYucxgg%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Giovanni Allegri
> http://about.me/giovanniallegri
> blog: http://blog.spaziogis.it
> GEO+ geomatica in Italia http://bit.ly/GEOplus
>
> --
> 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/CAB4g1%3DwHN_bHZg_s9PXKPrG%3DbcN-qmea9TTfLu-nP1xY%3Dq_89Q%40mail.gmail.com
> .
>
> For 

Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread G. Allegri
Hi Timothy,
I'm on a managed server, so I cannot do system changes that would require
reboot.
Anyway, setenforce says that SELinux is disabled (even setenforce 1).

Do you think it is SELinux to block Python module loading?
If I activate my virtualenv from shell I can load Django.

giovanni



2013/10/28 Timothy W. Cook 

>
>
>
> CentOS is a bit of a PITA. Because it is so secure.  Try turning off
> SELinux
>
>
> http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
>
> To test this out from the commandline:
>
> $setenforce 0
>
>
> How to actually make it work WITH SELinux? I haven't figured that out yet.
>
> HTH,
> Tim
>
>
>
> On Mon, Oct 28, 2013 at 1:06 PM, Giovanni Allegri wrote:
>
>> I'm getting mad with this error.
>> I've setup Apache and wsgi configuration as usual, but this time I'm on
>> CentOS instead of Debian, and I don't know it very well.
>> Anyway, I tried all the ways to give mod_wsgi the chance to peak from my
>> virtualenv libraries, both setting them with python-path argument to
>> WSGIScriptAlias, and using site.addsitedir in my wsgi module.
>> Printing sys.path gives me all the possible folders:
>>
>> ['/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
>> '/home/giohappy/.virtualenvs/django/lib64/python2.6',
>> '/home/giohappy/.virtualenvs/django/lib64/python2.6/site-packages',
>> '/usr/lib/python2.6/site-packages/distribute-0.6.49-py2.6.egg',
>> '/usr/lib/python2.6/site-packages/pip-1.4.1-py2.6.egg',
>> '/usr/lib64/python26.zip', '/usr/lib64/python2.6',
>> '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk',
>> '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload',
>> '/usr/lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages',
>> '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
>> '/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
>> '/home/giohappy/.virtualenvs/django/lib/python2.6/site-packages']
>>
>> but still I get  ImportError: No module named django.core.wsgi
>>
>> Could you help to sort it out?
>> giovanni
>>
>> --
>> 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/00266e62-34b1-49d8-a981-761c374568a9%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> 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/lhTc7rZgoIs/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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WBswduqcraq0W52nZ2JFwWAdzJ5rRQpPTwJ%2BCpYucxgg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Giovanni Allegri
http://about.me/giovanniallegri
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus

-- 
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/CAB4g1%3DwHN_bHZg_s9PXKPrG%3DbcN-qmea9TTfLu-nP1xY%3Dq_89Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread Timothy W. Cook
CentOS is a bit of a PITA. Because it is so secure.  Try turning off SELinux

http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

To test this out from the commandline:

$setenforce 0


How to actually make it work WITH SELinux? I haven't figured that out yet.

HTH,
Tim



On Mon, Oct 28, 2013 at 1:06 PM, Giovanni Allegri wrote:

> I'm getting mad with this error.
> I've setup Apache and wsgi configuration as usual, but this time I'm on
> CentOS instead of Debian, and I don't know it very well.
> Anyway, I tried all the ways to give mod_wsgi the chance to peak from my
> virtualenv libraries, both setting them with python-path argument to
> WSGIScriptAlias, and using site.addsitedir in my wsgi module.
> Printing sys.path gives me all the possible folders:
>
> ['/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
> '/home/giohappy/.virtualenvs/django/lib64/python2.6',
> '/home/giohappy/.virtualenvs/django/lib64/python2.6/site-packages',
> '/usr/lib/python2.6/site-packages/distribute-0.6.49-py2.6.egg',
> '/usr/lib/python2.6/site-packages/pip-1.4.1-py2.6.egg',
> '/usr/lib64/python26.zip', '/usr/lib64/python2.6',
> '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk',
> '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload',
> '/usr/lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages',
> '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
> '/var/www/vhosts/vzqn-znxs.accessdomain.com/httpdocs/imn',
> '/home/giohappy/.virtualenvs/django/lib/python2.6/site-packages']
>
> but still I get  ImportError: No module named django.core.wsgi
>
> Could you help to sort it out?
> giovanni
>
> --
> 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/00266e62-34b1-49d8-a981-761c374568a9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
MLHIM VIP Signup: http://goo.gl/22B0U

Timothy Cook, MSc   +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

-- 
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/CA%2B%3DOU3WBswduqcraq0W52nZ2JFwWAdzJ5rRQpPTwJ%2BCpYucxgg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-17 Thread y venkatesh


On Tuesday, October 15, 2013 10:38:35 PM UTC+5:30, rok wrote:
>
> I have recently been testing the 1.6b4 tag with a new app we are writing, 
> using apache and wsgi. However, I could not get rid of the following issue 
> happening on every request:
>
> ...
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line 2, 
> in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, 
> StackedInline, TabularInline, HORIZONTAL, VERTICAL
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6, in 
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin.sites import AdminSite, site
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File 
> "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in 
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from 
> django.contrib.admin import ModelAdmin, actions
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError: cannot 
> import name actions
>
> by doing the following change, I could get rid of what looked like a 
> circular import issue:
> --- a/django/contrib/admin/sites.py
> +++ b/django/contrib/admin/sites.py
> @@ -1,6 +1,7 @@
>  from functools import update_wrapper
>  from django.http import Http404, HttpResponseRedirect
> -from django.contrib.admin import ModelAdmin, actions
> +from django.contrib.admin import ModelAdmin
> +from django.contrib.admin.actions import delete_selected
>  from django.contrib.admin.forms import AdminAuthenticationForm
>  from django.contrib.auth import REDIRECT_FIELD_NAME
>  from django.contrib.contenttypes import views as contenttype_views
> @@ -46,7 +47,7 @@ class AdminSite(object):
>  self._registry = {}  # model_class class -> admin_class instance
>  self.name = name
>  self.app_name = app_name
> -self._actions = {'delete_selected': actions.delete_selected}
> +self._actions = {'delete_selected': delete_selected}
>  self._global_actions = self._actions.copy()
>  
>  def register(self, model_or_iterable, admin_class=None, **options):
>
> Switching to 1.5.4 resolves the issue as well (even though the sites.py 
> code is the same). What is more, this did not occur in the development 
> environment when using the runserver run.
>
> Any clue?
>

-- 
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/9a44b544-2bce-4bd9-b506-75f9993284d5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men
Hi, Tom and rok!

I didn't mean to start http server flame war, Apache obviously has it's 
upsides and we also use it. What I've proposed is a simple, albeit dirty, 
workaround to run non-forked Django 1.6 in production.

For Django devs to be able to address the root of the issue and solve it 
properly you will probably need to prepare a sample bare bones Django 
project that has the issue.

On Wednesday, October 16, 2013 7:23:53 PM UTC+4, rok wrote:
>
> Hi, I am not a particular evangelist of one or the other but since we use 
> apache+mod_wsgi for several apps throughout the company, we obviously want 
> to stick with one, easier for deployment and maintenance. 
>
> On Wednesday, October 16, 2013 5:17:35 PM UTC+2, Tom Evans wrote:
>>
>> On Wed, Oct 16, 2013 at 3:20 PM,   wrote: 
>> > Ouch! I should have read your post more carefully! If you don't have 
>> any 
>> > other options than to use Apache, you could run it as proxy to 
>> gunicorn. Or 
>> > you could use Nginx instead of Apache... 
>>
>> What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting 
>> solution? 
>>
>> httpd can be as lean and efficient as nginx in memory usage if you 
>> configure it so, doesn't abandon the httpd ecosystem, and can actually 
>> host wsgi apps itself, rather than requiring yet another webserver in 
>> to the mix. 
>>
>> Especially so, I'd imagine, if that other webserver has, in your words 
>> "some weird import errors which occured only when I was running the 
>> project with `gunicorn_django" 
>>
>> Cheers 
>>
>> Tom 
>>
>

-- 
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/f7a4398d-bb0d-4351-bf8f-2cf1481078cb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread Tom Evans
On Wed, Oct 16, 2013 at 3:20 PM,   wrote:
> Ouch! I should have read your post more carefully! If you don't have any
> other options than to use Apache, you could run it as proxy to gunicorn. Or
> you could use Nginx instead of Apache...

What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting solution?

httpd can be as lean and efficient as nginx in memory usage if you
configure it so, doesn't abandon the httpd ecosystem, and can actually
host wsgi apps itself, rather than requiring yet another webserver in
to the mix.

Especially so, I'd imagine, if that other webserver has, in your words
"some weird import errors which occured only when I was running the
project with `gunicorn_django"

Cheers

Tom

-- 
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/CAFHbX1%2B6%3Dx9cvGD9QgaK7c%2BY0szH7t8pV%3DzXBbipcowpwP3tLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread rok
Hi, I am not a particular evangelist of one or the other but since we use 
apache+mod_wsgi for several apps throughout the company, we obviously want 
to stick with one, easier for deployment and maintenance. 

On Wednesday, October 16, 2013 5:17:35 PM UTC+2, Tom Evans wrote:
>
> On Wed, Oct 16, 2013 at 3:20 PM,   
> wrote: 
> > Ouch! I should have read your post more carefully! If you don't have any 
> > other options than to use Apache, you could run it as proxy to gunicorn. 
> Or 
> > you could use Nginx instead of Apache... 
>
> What, precisely, is wrong with Apache httpd/mod_wsgi as a hosting 
> solution? 
>
> httpd can be as lean and efficient as nginx in memory usage if you 
> configure it so, doesn't abandon the httpd ecosystem, and can actually 
> host wsgi apps itself, rather than requiring yet another webserver in 
> to the mix. 
>
> Especially so, I'd imagine, if that other webserver has, in your words 
> "some weird import errors which occured only when I was running the 
> project with `gunicorn_django" 
>
> Cheers 
>
> Tom 
>

-- 
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/000f4297-bf65-4929-8bee-2d82b030cde2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men


On Wednesday, October 16, 2013 4:18:13 PM UTC+4, rok wrote:
>
> Hi Ivan, thanks for the response. No. we are not using gunicorn, just 
>  apache+mod_wsgi.
>
> moreover, I configured WSGIDaemon option for the host to separate it from 
> the rest of the system and still no luck.
>
> Rok
>
> On Wednesday, October 16, 2013 9:39:28 AM UTC+2, the.pa...@gmail.comwrote:
>>
>> Hi!
>>
>>  Original Message 
>> Subject: Re: ImportError: cannot import name actions
>> Date: Wed, 16 Oct 2013 11:26:33 +0400
>> From: Ivan Kharlamov <the.pa...@gmail.com>
>> To: django-d...@googlegroups.com
>>
>> On 10/15/2013 04:56 PM, rok wrote:
>> > I have recently been testing the 1.6b4 tag with a new app we are
>> > writing, using apache and wsgi. However, I could not get rid of the
>> > following issue happening on every request:
>> > 
>> > ...
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
>> > 2, in 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
>> > StackedInline, TabularInline, HORIZONTAL, VERTICAL
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
>> > in 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin.sites import AdminSite, site
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
>> > "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
>> > 
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
>> > django.contrib.admin import ModelAdmin, actions
>> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
>> > cannot import name actions
>> > 
>> > by doing the following change, I could get rid of what looked like a
>> > circular import issue:
>> > --- a/django/contrib/admin/sites.py
>> > +++ b/django/contrib/admin/sites.py
>> > @@ -1,6 +1,7 @@
>> >  from functools import update_wrapper
>> >  from django.http import Http404, HttpResponseRedirect
>> > -from django.contrib.admin import ModelAdmin, actions
>> > +from django.contrib.admin import ModelAdmin
>> > +from django.contrib.admin.actions import delete_selected
>> >  from django.contrib.admin.forms import AdminAuthenticationForm
>> >  from django.contrib.auth import REDIRECT_FIELD_NAME
>> >  from django.contrib.contenttypes import views as contenttype_views
>> > @@ -46,7 +47,7 @@ class AdminSite(object):
>> >  self._registry = {}  # model_class class -> admin_class 
>> instance
>> >  self.name = name
>> >  self.app_name = app_name
>> > -self._actions = {'delete_selected': actions.delete_selected}
>> > +self._actions = {'delete_selected': delete_selected}
>> >  self._global_actions = self._actions.copy()
>> >  
>> >  def register(self, model_or_iterable, admin_class=None, **options):
>> > 
>> > Switching to 1.5.4 resolves the issue as well (even though the sites.py
>> > code is the same). What is more, this did not occur in the development
>> > environment when using the runserver run.
>> > 
>> > Any clue?
>>
>> Well, if this doesn't happen in the dev environment and does happen in
>> production, is there any chance that you're using gunicorn via
>> `gunicorn_django` command? If yes, try running the project with
>> `gunicorn` command instead.
>>
>> I have seen some weird import errors which occured only when I was
>> running the project with `gunicorn_django` in conjunction with Django
>> 1.6, but I didn't take time to debug and report them since
>> `gunicorn_django` command is deprecated and switching to `gunicorn`
>> command fixed everything.
>>
>> Still, I have written about them on SO: 
>> http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778
>>
>> Hope this helps!
>>
>> Regards,
>> Ivan
>>
>>

Ouch! I should have read your post more carefully! If you don't have any 
other options than to use Apache, you could run it as proxy to gunicorn. Or 
you could use Nginx instead of Apache...
 

-- 
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/8ada7e97-fc4d-4f5d-83f7-14ab7b751123%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread rok
Hi Ivan, thanks for the response. No. we are not using gunicorn, just 
 apache+mod_wsgi.

moreover, I configured WSGIDaemon option for the host to separate it from 
the rest of the system and still no luck.

Rok

On Wednesday, October 16, 2013 9:39:28 AM UTC+2, the.pa...@gmail.com wrote:
>
> Hi!
>
>  Original Message 
> Subject: Re: ImportError: cannot import name actions
> Date: Wed, 16 Oct 2013 11:26:33 +0400
> From: Ivan Kharlamov <the.pa...@gmail.com >
> To: django-d...@googlegroups.com 
>
> On 10/15/2013 04:56 PM, rok wrote:
> > I have recently been testing the 1.6b4 tag with a new app we are
> > writing, using apache and wsgi. However, I could not get rid of the
> > following issue happening on every request:
> > 
> > ...
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
> > 2, in 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
> > StackedInline, TabularInline, HORIZONTAL, VERTICAL
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
> > in 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin.sites import AdminSite, site
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> > "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
> > 
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> > django.contrib.admin import ModelAdmin, actions
> > [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
> > cannot import name actions
> > 
> > by doing the following change, I could get rid of what looked like a
> > circular import issue:
> > --- a/django/contrib/admin/sites.py
> > +++ b/django/contrib/admin/sites.py
> > @@ -1,6 +1,7 @@
> >  from functools import update_wrapper
> >  from django.http import Http404, HttpResponseRedirect
> > -from django.contrib.admin import ModelAdmin, actions
> > +from django.contrib.admin import ModelAdmin
> > +from django.contrib.admin.actions import delete_selected
> >  from django.contrib.admin.forms import AdminAuthenticationForm
> >  from django.contrib.auth import REDIRECT_FIELD_NAME
> >  from django.contrib.contenttypes import views as contenttype_views
> > @@ -46,7 +47,7 @@ class AdminSite(object):
> >  self._registry = {}  # model_class class -> admin_class instance
> >  self.name = name
> >  self.app_name = app_name
> > -self._actions = {'delete_selected': actions.delete_selected}
> > +self._actions = {'delete_selected': delete_selected}
> >  self._global_actions = self._actions.copy()
> >  
> >  def register(self, model_or_iterable, admin_class=None, **options):
> > 
> > Switching to 1.5.4 resolves the issue as well (even though the sites.py
> > code is the same). What is more, this did not occur in the development
> > environment when using the runserver run.
> > 
> > Any clue?
>
> Well, if this doesn't happen in the dev environment and does happen in
> production, is there any chance that you're using gunicorn via
> `gunicorn_django` command? If yes, try running the project with
> `gunicorn` command instead.
>
> I have seen some weird import errors which occured only when I was
> running the project with `gunicorn_django` in conjunction with Django
> 1.6, but I didn't take time to debug and report them since
> `gunicorn_django` command is deprecated and switching to `gunicorn`
> command fixed everything.
>
> Still, I have written about them on SO: 
> http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778
>
> Hope this helps!
>
> Regards,
> Ivan
>
>

-- 
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/d1a88cb3-19d6-4e6e-8dd7-ec93f7bc4518%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: cannot import name actions

2013-10-16 Thread the . paper . men
Hi!

 Original Message 
Subject: Re: ImportError: cannot import name actions
Date: Wed, 16 Oct 2013 11:26:33 +0400
From: Ivan Kharlamov <the.paper@gmail.com>
To: django-develop...@googlegroups.com

On 10/15/2013 04:56 PM, rok wrote:
> I have recently been testing the 1.6b4 tag with a new app we are
> writing, using apache and wsgi. However, I could not get rid of the
> following issue happening on every request:
> 
> ...
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/gis/admin/__init__.py", line
> 2, in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin,
> StackedInline, TabularInline, HORIZONTAL, VERTICAL
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/admin/__init__.py", line 6,
> in 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin.sites import AdminSite, site
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1]   File
> "/home/rok/apps/django-trunk/django/contrib/admin/sites.py", line 3, in
> 
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] from
> django.contrib.admin import ModelAdmin, actions
> [Tue Oct 15 12:50:36 2013] [error] [client 127.0.0.1] ImportError:
> cannot import name actions
> 
> by doing the following change, I could get rid of what looked like a
> circular import issue:
> --- a/django/contrib/admin/sites.py
> +++ b/django/contrib/admin/sites.py
> @@ -1,6 +1,7 @@
>  from functools import update_wrapper
>  from django.http import Http404, HttpResponseRedirect
> -from django.contrib.admin import ModelAdmin, actions
> +from django.contrib.admin import ModelAdmin
> +from django.contrib.admin.actions import delete_selected
>  from django.contrib.admin.forms import AdminAuthenticationForm
>  from django.contrib.auth import REDIRECT_FIELD_NAME
>  from django.contrib.contenttypes import views as contenttype_views
> @@ -46,7 +47,7 @@ class AdminSite(object):
>  self._registry = {}  # model_class class -> admin_class instance
>  self.name = name
>  self.app_name = app_name
> -self._actions = {'delete_selected': actions.delete_selected}
> +self._actions = {'delete_selected': delete_selected}
>  self._global_actions = self._actions.copy()
>  
>  def register(self, model_or_iterable, admin_class=None, **options):
> 
> Switching to 1.5.4 resolves the issue as well (even though the sites.py
> code is the same). What is more, this did not occur in the development
> environment when using the runserver run.
> 
> Any clue?

Well, if this doesn't happen in the dev environment and does happen in
production, is there any chance that you're using gunicorn via
`gunicorn_django` command? If yes, try running the project with
`gunicorn` command instead.

I have seen some weird import errors which occured only when I was
running the project with `gunicorn_django` in conjunction with Django
1.6, but I didn't take time to debug and report them since
`gunicorn_django` command is deprecated and switching to `gunicorn`
command fixed everything.

Still, I have written about them on SO: 
http://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore/16373778#16373778

Hope this helps!

Regards,
Ivan

-- 
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/7feec2af-b401-49cf-b96e-1132764d2379%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError No module named django.core

2013-09-07 Thread voger
Hi, I am as noob as you so maybe this is a case of blind leading blind. 
From what I hear it is considered best practice to first create a 
virtualenv and then install django and any other packages inside that 
virtualenv. Read here for virtualenv 
http://dabapps.com/blog/introduction-to-pip-and-virtualenv-python/?=J7crUq_PM4XFtAaM7IHoCw?=AFQjCNEjUbnsJfGho1bGo4exJlT99Aod2Q?=aac8nwmTkJdYsk_TVCRf5g?=bv.51773540,d.Yms


After you created your virtualenv in let's say ~/env then you do

$ source /env/bin/activate

and your prompt becomes (env)[your normal prompt]$

then you do

(env)$ pip install django

and after that you start playing with django.



On 09/07/2013 07:42 PM, pzul wrote:

Hello,
I just installed Django-1.5.2 in a server (using command : python
setup.py install)
But now, as I'm expecting to create a new project (django-admin.py
startproject mysite ), I have this message :
ImportError No module named django.core

What can I do ?
Thank you !

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError: No module named 'exceptions' - Python3

2013-08-12 Thread Mike Dewhirst

On 12/08/2013 3:21pm, abhijeet shete wrote:

Hi Folks,

 I ported my project from python2.7 to python3 using 2to3 module.
One of my class is inherited from Exception class, but after porting to
python3 i am getting *No module named 'exceptions' *error.

 My class looks something like this :-



Try it without importing Exception. Looking at django.core.exceptions it 
seems specifically importing Exception is not required.



*from exceptions import Exception*
*class A(Exception):*
*def __init__(self, value=None):*
*self.value = value*
*
*
And the error which I am getting is
*
*
Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named 'exceptions'


I tried to import exceptions in python3 shell but there also I am
getting same error.
Is there any problem with my code or did I missed something while
porting or python3 itself has some problem while importing exceptions ?


Thanks and Regards.
Abhijeet Shete

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ImportError: No module named 'exceptions' - Python3

2013-08-12 Thread Jani Tiainen
Hi,

In Python 3 exceptions module was removed and all standard exceptions were 
moved to builtin module. Thus meaning that there is no more need to do explicit 
import of any standard exceptions.


On Mon, 12 Aug 2013 10:51:32 +0530
abhijeet shete  wrote:

> Hi Folks,
> 
> I ported my project from python2.7 to python3 using 2to3 module. One of
> my class is inherited from Exception class, but after porting to python3 i
> am getting *No module named 'exceptions'  *error.
> 
> My class looks something like this :-
> 
> *from exceptions import Exception*
> *class A(Exception):*
> *def __init__(self, value=None):*
> *self.value = value*
> *
> *
> And the error which I am getting is
> *
> *
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named 'exceptions'
> 
> 
> I tried to import exceptions in python3 shell but there also I am getting
> same error.
> Is there any problem with my code or did I missed something while porting
> or python3 itself has some problem while importing exceptions ?
> 
> 
> Thanks and Regards.
> Abhijeet Shete
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ImportError at/ No module name

2013-08-11 Thread Pranay Shah
I just want to thank everyone. I had an error "no module name image" since 
yesterday nite. I googled and found out that I need to install python image 
library. I did that. I still continued getting error. Just then I came 
across this post where someone was getting "no module... blog". I read it 
and found out the prob. Initially I had an "image" view which I deleted 
last nite as I was no longer gonna use it. But I didnt remove its mapping 
form the urls.py. I commented the lines for image - views and it worked.

Thank you all. Now I shall start working on the actual stuff which I was 
supposed to work from last nite. Its actually my internship homework.

Thank you once again. 

On Thursday, 20 December 2012 05:27:42 UTC-8, djangobie wrote:
>
> Hi, I have just started practicing a tutorial for buidling a  basic blog ( 
> http://www.djangorocks.com/tutorials/how-to-create-a-basic-blog-in-django/starting-your-application.html
>  )
>
> Did exactly the same (except, using 'djangopractice' as project name 
> instead of 'djangorocks')
> Actually It also did run twice, but than started showing ImportError.
>
> My files:
> 
> ***settings.py***
> 
> # Django settings for djangopractice project.
> #import os, django
> #DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
> #SITE_ROOT = os.path.dirname(os.path.realpath('__file__'))
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_...@example.com '),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'djangopractice',  # Or path to 
> database file if using sqlite3.
> 'USER': 'root',  # Not used with sqlite3.
> 'PASSWORD': '1290',  # 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.
> }
> }
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'Asia/Karachi'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded 
> files.
> # Example: "/home/media/media.lawrence.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://media.lawrence.com/media/;, "http://example.com/media/
> "
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/home/media/media.lawrence.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://media.lawrence.com/static/;
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # List of finder classes that know how to find static files in
> # various locations.
> STATICFILES_FINDERS = (
> 'django.contrib.staticfiles.finders.FileSystemFinder',
> 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '@io!2+0*rw1o0tjq%t5zb8e$v(wf3p#yk_8#lb^%hrerzijwt1'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 

Re: ImportError: No module named django.core.management

2013-07-28 Thread vinoth job
after cleared the above problem getting new error .when i run this
command : python manage.py syncdb

TypeError: __init__() got an unexpected keyword argument 'verify_exists'

and this is the problem i got in my terminal and i installed all the
packages needed to run the application in  virtualenv .

-- 
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: ImportError: No module named django.core.management

2013-07-28 Thread vinoth job
 i installed inside lib/python2.7/site-packages/django .now it is running.

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




  1   2   3   4   >