Re: os module import error

2021-05-31 Thread Avi shah
you could just add "import os" in settings.py file

On Mon, May 31, 2021 at 8:32 PM James Ndubuisi 
wrote:

> Good afternoon.
> It seems on creating the Django project using django-admin startproject
> command , the os module isn't imported by default, causing an 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/CAK4ckVVeaT75CAPQWZeD6q6ewraHmaRH07W_6JQRemX6QV%2BXNA%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/CALa7AFPHGEsvpgdaUDpefw1nmVp_c56n95quZUFF_Q-ur0rX%2Bg%40mail.gmail.com.


Re: os module import error

2021-05-31 Thread Antonis Christofides

Hi!

Could you show exactly which command(s) you are running, and the exact error 
message?


Regards,

Antonis Christofides
+30-6979924665 (mobile)

On 31/05/2021 17.57, James Ndubuisi wrote:

Good afternoon.
It seems on creating the Django project using django-admin startproject 
command , the os module isn't imported by default, causing an 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/CAK4ckVVeaT75CAPQWZeD6q6ewraHmaRH07W_6JQRemX6QV%2BXNA%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/cf967d61-ef98-0cdc-8f39-991641ba5728%40antonischristofides.com.


os module import error

2021-05-31 Thread James Ndubuisi
Good afternoon.
It seems on creating the Django project using django-admin startproject
command , the os module isn't imported by default, causing an 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/CAK4ckVVeaT75CAPQWZeD6q6ewraHmaRH07W_6JQRemX6QV%2BXNA%40mail.gmail.com.


Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-22 Thread Chaitanya Sai
Thanks for your reply guys. I figured it out. I have typo of serializer
name in serilizers.py which is causing the error.
Damn, I spend 4 hours into this.

On Wed, Jul 22, 2020 at 11:22 AM Liu Zheng  wrote:

> Hi,
>
> Probably not enough to look at urls.py files only. My guess: Do you use
> ‘reverse’ function anywhere in covid app? If so, here’s a circular import:
>
> urls.py imports covid urls -> covid urls import covid views -> one covid
> view uses reverse -> reverse import urls.py of the project (to look up the
> url with the end point name).
>
> A quick fix will be using lazy_reverse instead of reverse.
>
> On Wed, 22 Jul 2020 at 10:22 PM, sandeep kumar 
> wrote:
>
>> I have faced this issue atleast 100 times..:)
>>
>> Her are the steps (sorry, I could not find a better way):
>>
>> 1. comment urls in urls.py (inside individual app)
>> 2. check if you still have issue
>> 2a. if you do not have issue, then you probably have not defined views
>> for some of the urls
>> 2b. if you still see the error, comment 'impot views' statement.
>> 3a. if the issue is gone after commenting 'import views' then check
>> views.py file, it must have some typos (e.g., misalignment, accidental
>> copying of some special character etc.)
>> 3b. if the issue is not gone even after commenting 'import views', let me
>> know. I am not sure I have reached that stage ever..:)
>>
>> Hope this helps.
>>
>> Thanks,
>> Sandeep
>>
>> --
>> *Dr. Sandeep Kumar,*
>> Postdoctoral Researcher,
>> Lunenfeld Tanenbaum Research Institute,
>> Mount Sinai Hospital,
>> 600 University Ave,
>> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
>> Toronto, Ontario
>> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
>> Canada
>> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
>> http://individual.utoronto.ca/sandeepkumar/
>>
>>
>> On Wed, Jul 22, 2020 at 10:12 AM Chaitanya Sai 
>> wrote:
>>
>>> Hello Django users,
>>> Is there not even single person who can solve this issue??
>>>
>>>
>>> On Tue, Jul 21, 2020 at 8:09 PM Sai  wrote:
>>>
>>>> I am working Django rest framework api project, where I had multiple
>>>> apps in the project. I got a circular import error when I am adding the app
>>>> URLs to the main URLs. I Tried everything checked spellings, checked app
>>>> structure but no use. Its been really frustrating with issue..please help
>>>> to solve the problem. The app is working fine when I take off newly added
>>>> line `path("covid/", include("Covid.urls")),`
>>>>
>>>> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>>>>
>>>> Here is project
>>>> **urls.py**
>>>>
>>>>
>>>> from django.contrib import admin
>>>> from django.conf.urls import url
>>>> from django.urls import path, include
>>>> from rest_framework_swagger.views import get_swagger_view
>>>>
>>>> schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>>>>
>>>> urlpatterns = [
>>>> path('admin/', admin.site.urls),
>>>> # path('', include('django.contrib.auth.urls')),
>>>> # path('rest_auth/', include('rest_auth.urls')),
>>>> path('api/password_reset/',
>>>> include('django_rest_passwordreset.urls',
>>>> namespace='password_reset')),
>>>> # url(r'^invitations/', include('invitations.urls',
>>>> namespace='invitations')),
>>>> path('', include('rest_invitations.urls')),
>>>> path("", include("UserAuth.urls")),
>>>> path("doctors/", include("Administration.urls")),
>>>> path("appointments/", include("Appointments.urls")),
>>>> path("messaging/", include("messaging.urls")),
>>>> path("meet/", include("meet.urls")),
>>>> path("api_documentation/", schema_view),
>>>> path("covid/", include("Covid.urls")),
>>>> ]
>>>>
>>>> This is app **urls.py** file
>>>>
>>>> from django.urls import 

Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-22 Thread Liu Zheng
Hi,

Probably not enough to look at urls.py files only. My guess: Do you use
‘reverse’ function anywhere in covid app? If so, here’s a circular import:

urls.py imports covid urls -> covid urls import covid views -> one covid
view uses reverse -> reverse import urls.py of the project (to look up the
url with the end point name).

A quick fix will be using lazy_reverse instead of reverse.

On Wed, 22 Jul 2020 at 10:22 PM, sandeep kumar 
wrote:

> I have faced this issue atleast 100 times..:)
>
> Her are the steps (sorry, I could not find a better way):
>
> 1. comment urls in urls.py (inside individual app)
> 2. check if you still have issue
> 2a. if you do not have issue, then you probably have not defined views for
> some of the urls
> 2b. if you still see the error, comment 'impot views' statement.
> 3a. if the issue is gone after commenting 'import views' then check
> views.py file, it must have some typos (e.g., misalignment, accidental
> copying of some special character etc.)
> 3b. if the issue is not gone even after commenting 'import views', let me
> know. I am not sure I have reached that stage ever..:)
>
> Hope this helps.
>
> Thanks,
> Sandeep
>
> --
> *Dr. Sandeep Kumar,*
> Postdoctoral Researcher,
> Lunenfeld Tanenbaum Research Institute,
> Mount Sinai Hospital,
> 600 University Ave,
> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
> Toronto, Ontario
> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
> Canada
> <https://www.google.com/maps/search/600+University+Ave,+Toronto,+Ontario+Canada?entry=gmail=g>
> http://individual.utoronto.ca/sandeepkumar/
>
>
> On Wed, Jul 22, 2020 at 10:12 AM Chaitanya Sai 
> wrote:
>
>> Hello Django users,
>> Is there not even single person who can solve this issue??
>>
>>
>> On Tue, Jul 21, 2020 at 8:09 PM Sai  wrote:
>>
>>> I am working Django rest framework api project, where I had multiple
>>> apps in the project. I got a circular import error when I am adding the app
>>> URLs to the main URLs. I Tried everything checked spellings, checked app
>>> structure but no use. Its been really frustrating with issue..please help
>>> to solve the problem. The app is working fine when I take off newly added
>>> line `path("covid/", include("Covid.urls")),`
>>>
>>> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>>>
>>> Here is project
>>> **urls.py**
>>>
>>>
>>> from django.contrib import admin
>>> from django.conf.urls import url
>>> from django.urls import path, include
>>> from rest_framework_swagger.views import get_swagger_view
>>>
>>> schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> # path('', include('django.contrib.auth.urls')),
>>> # path('rest_auth/', include('rest_auth.urls')),
>>> path('api/password_reset/',
>>> include('django_rest_passwordreset.urls',
>>> namespace='password_reset')),
>>> # url(r'^invitations/', include('invitations.urls',
>>> namespace='invitations')),
>>> path('', include('rest_invitations.urls')),
>>> path("", include("UserAuth.urls")),
>>> path("doctors/", include("Administration.urls")),
>>> path("appointments/", include("Appointments.urls")),
>>> path("messaging/", include("messaging.urls")),
>>> path("meet/", include("meet.urls")),
>>> path("api_documentation/", schema_view),
>>> path("covid/", include("Covid.urls")),
>>> ]
>>>
>>> This is app **urls.py** file
>>>
>>> from django.urls import path
>>> from . import views
>>>
>>> app_name = 'Covid'
>>>
>>> urlpatterns = [
>>> path('event/', views.EventBookingView.as_view()),
>>> ]
>>>
>>> **settings.py** installed apps
>>>
>>> ALLOWED_HOSTS = ['*']
>>>
>>>
>>> # Application definition
>>>
>>> INSTALLED_APPS = [
>>> "django.contrib.admin",
>>> "django.contrib.auth",
>>> "django.contrib.sites&quo

Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-22 Thread sandeep kumar
I have faced this issue atleast 100 times..:)

Her are the steps (sorry, I could not find a better way):

1. comment urls in urls.py (inside individual app)
2. check if you still have issue
2a. if you do not have issue, then you probably have not defined views for
some of the urls
2b. if you still see the error, comment 'impot views' statement.
3a. if the issue is gone after commenting 'import views' then check
views.py file, it must have some typos (e.g., misalignment, accidental
copying of some special character etc.)
3b. if the issue is not gone even after commenting 'import views', let me
know. I am not sure I have reached that stage ever..:)

Hope this helps.

Thanks,
Sandeep

-- 
*Dr. Sandeep Kumar,*
Postdoctoral Researcher,
Lunenfeld Tanenbaum Research Institute,
Mount Sinai Hospital,
600 University Ave,
Toronto, Ontario
Canada
http://individual.utoronto.ca/sandeepkumar/


On Wed, Jul 22, 2020 at 10:12 AM Chaitanya Sai 
wrote:

> Hello Django users,
> Is there not even single person who can solve this issue??
>
>
> On Tue, Jul 21, 2020 at 8:09 PM Sai  wrote:
>
>> I am working Django rest framework api project, where I had multiple apps
>> in the project. I got a circular import error when I am adding the app URLs
>> to the main URLs. I Tried everything checked spellings, checked app
>> structure but no use. Its been really frustrating with issue..please help
>> to solve the problem. The app is working fine when I take off newly added
>> line `path("covid/", include("Covid.urls")),`
>>
>> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>>
>> Here is project
>> **urls.py**
>>
>>
>> from django.contrib import admin
>> from django.conf.urls import url
>> from django.urls import path, include
>> from rest_framework_swagger.views import get_swagger_view
>>
>> schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> # path('', include('django.contrib.auth.urls')),
>> # path('rest_auth/', include('rest_auth.urls')),
>> path('api/password_reset/',
>> include('django_rest_passwordreset.urls',
>> namespace='password_reset')),
>> # url(r'^invitations/', include('invitations.urls',
>> namespace='invitations')),
>> path('', include('rest_invitations.urls')),
>> path("", include("UserAuth.urls")),
>> path("doctors/", include("Administration.urls")),
>> path("appointments/", include("Appointments.urls")),
>> path("messaging/", include("messaging.urls")),
>> path("meet/", include("meet.urls")),
>> path("api_documentation/", schema_view),
>> path("covid/", include("Covid.urls")),
>> ]
>>
>> This is app **urls.py** file
>>
>> from django.urls import path
>> from . import views
>>
>> app_name = 'Covid'
>>
>> urlpatterns = [
>> path('event/', views.EventBookingView.as_view()),
>> ]
>>
>> **settings.py** installed apps
>>
>> ALLOWED_HOSTS = ['*']
>>
>>
>> # Application definition
>>
>> INSTALLED_APPS = [
>> "django.contrib.admin",
>> "django.contrib.auth",
>> "django.contrib.sites",
>> "django.contrib.contenttypes",
>> "django.contrib.sessions",
>> "django.contrib.messages",
>> "django.contrib.staticfiles",
>> "UserAuth",
>> "rest_framework",
>> "corsheaders",
>> 'rest_framework.authtoken',
>> 'rest_auth',
>> 'Appointments',
>> 'messaging',
>> 'Administration',
>> 'channels',
>> 'invitations',
>> 'rest_invitations',
>> 'django_rest_passwordreset',
>> 'django_celery_beat',
>> 'meet',
>> 'rest_framework_swagger',
>>  'Covid',
>>
>> ]
>>
>> This is a project structure
>>
>> [Project Structure][1]
>>
>>
>>   [1]: https://i.stack.imgur.com/E8qro.jpg
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emai

Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-22 Thread Chaitanya Sai
Hello Django users,
Is there not even single person who can solve this issue??


On Tue, Jul 21, 2020 at 8:09 PM Sai  wrote:

> I am working Django rest framework api project, where I had multiple apps
> in the project. I got a circular import error when I am adding the app URLs
> to the main URLs. I Tried everything checked spellings, checked app
> structure but no use. Its been really frustrating with issue..please help
> to solve the problem. The app is working fine when I take off newly added
> line `path("covid/", include("Covid.urls")),`
>
> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>
> Here is project
> **urls.py**
>
>
> from django.contrib import admin
> from django.conf.urls import url
> from django.urls import path, include
> from rest_framework_swagger.views import get_swagger_view
>
> schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> # path('', include('django.contrib.auth.urls')),
> # path('rest_auth/', include('rest_auth.urls')),
> path('api/password_reset/',
> include('django_rest_passwordreset.urls',
> namespace='password_reset')),
> # url(r'^invitations/', include('invitations.urls',
> namespace='invitations')),
> path('', include('rest_invitations.urls')),
> path("", include("UserAuth.urls")),
> path("doctors/", include("Administration.urls")),
> path("appointments/", include("Appointments.urls")),
> path("messaging/", include("messaging.urls")),
> path("meet/", include("meet.urls")),
> path("api_documentation/", schema_view),
> path("covid/", include("Covid.urls")),
> ]
>
> This is app **urls.py** file
>
> from django.urls import path
> from . import views
>
> app_name = 'Covid'
>
> urlpatterns = [
> path('event/', views.EventBookingView.as_view()),
> ]
>
> **settings.py** installed apps
>
> ALLOWED_HOSTS = ['*']
>
>
> # Application definition
>
> INSTALLED_APPS = [
> "django.contrib.admin",
> "django.contrib.auth",
> "django.contrib.sites",
> "django.contrib.contenttypes",
> "django.contrib.sessions",
> "django.contrib.messages",
> "django.contrib.staticfiles",
> "UserAuth",
> "rest_framework",
> "corsheaders",
> 'rest_framework.authtoken',
> 'rest_auth',
> 'Appointments',
> 'messaging',
> 'Administration',
> 'channels',
> 'invitations',
> 'rest_invitations',
> 'django_rest_passwordreset',
> 'django_celery_beat',
> 'meet',
> 'rest_framework_swagger',
>  'Covid',
>
> ]
>
> This is a project structure
>
> [Project Structure][1]
>
>
>   [1]: https://i.stack.imgur.com/E8qro.jpg
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPcTzRYQztSpyh5AD%3DYo9%3DYMvRHfYcFBXdfq6rrK956ZqdcAcQ%40mail.gmail.com.


Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-21 Thread Chaitanya Sai
Can any one Look into this thing ??

On Tue, Jul 21, 2020 at 8:09 PM Sai  wrote:

> I am working Django rest framework api project, where I had multiple apps
> in the project. I got a circular import error when I am adding the app URLs
> to the main URLs. I Tried everything checked spellings, checked app
> structure but no use. Its been really frustrating with issue..please help
> to solve the problem. The app is working fine when I take off newly added
> line `path("covid/", include("Covid.urls")),`
>
> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>
> Here is project
> **urls.py**
>
>
> from django.contrib import admin
> from django.conf.urls import url
> from django.urls import path, include
> from rest_framework_swagger.views import get_swagger_view
>
> schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> # path('', include('django.contrib.auth.urls')),
> # path('rest_auth/', include('rest_auth.urls')),
> path('api/password_reset/',
> include('django_rest_passwordreset.urls',
> namespace='password_reset')),
> # url(r'^invitations/', include('invitations.urls',
> namespace='invitations')),
> path('', include('rest_invitations.urls')),
> path("", include("UserAuth.urls")),
> path("doctors/", include("Administration.urls")),
> path("appointments/", include("Appointments.urls")),
> path("messaging/", include("messaging.urls")),
> path("meet/", include("meet.urls")),
> path("api_documentation/", schema_view),
> path("covid/", include("Covid.urls")),
> ]
>
> This is app **urls.py** file
>
> from django.urls import path
> from . import views
>
> app_name = 'Covid'
>
> urlpatterns = [
> path('event/', views.EventBookingView.as_view()),
> ]
>
> **settings.py** installed apps
>
> ALLOWED_HOSTS = ['*']
>
>
> # Application definition
>
> INSTALLED_APPS = [
> "django.contrib.admin",
> "django.contrib.auth",
> "django.contrib.sites",
> "django.contrib.contenttypes",
> "django.contrib.sessions",
> "django.contrib.messages",
> "django.contrib.staticfiles",
> "UserAuth",
> "rest_framework",
> "corsheaders",
> 'rest_framework.authtoken',
> 'rest_auth',
> 'Appointments',
> 'messaging',
> 'Administration',
> 'channels',
> 'invitations',
> 'rest_invitations',
> 'django_rest_passwordreset',
> 'django_celery_beat',
> 'meet',
> 'rest_framework_swagger',
>  'Covid',
>
> ]
>
> This is a project structure
>
> [Project Structure][1]
>
>
>   [1]: https://i.stack.imgur.com/E8qro.jpg
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPcTzRbuTv9FrDwa150qn%2BJdUa4zHNzsLLkLh4RP1xOr9%2BPrag%40mail.gmail.com.


Re: How to trace circular import error Django never solved!! Please sort this out.

2020-07-21 Thread Mike Dewhirst
On 22/07/2020 10:08 am, Sai wrote:
> I am working Django rest framework api project, where I had multiple
> apps in the project. I got a circular import error when I am adding
> the app URLs to the main URLs. I Tried everything checked spellings,
> checked app structure but no use. Its been really frustrating with
> issue..please help to solve the problem. The app is working fine when
> I take off newly added line `path("covid/", include("Covid.urls")),`

I can't help specifically but generally maybe. I have never been able to
trace circular imports. Instead I just remove them and drop them into
the methods which need them.

At first glance "from django.conf.urls import url" seems to be unused.
I'd try again without it or if I missed something you could add re_path
to the django.urls imports.

Hope I haven't steered you down a blind alley.

M


>
> I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0
>
> Here is project 
> **urls.py** 
>
>            
>     from django.contrib import admin
>     from django.conf.urls import url
>     from django.urls import path, include
>     from rest_framework_swagger.views import get_swagger_view
>     
>     schema_view = get_swagger_view(title='TmmrwInc API Documentation')
>     
>     urlpatterns = [
>         path('admin/', admin.site.urls),
>         # path('', include('django.contrib.auth.urls')),
>         # path('rest_auth/', include('rest_auth.urls')),
>         path('api/password_reset/',
>             include('django_rest_passwordreset.urls',
> namespace='password_reset')),
>         # url(r'^invitations/', include('invitations.urls',
> namespace='invitations')),
>         path('', include('rest_invitations.urls')),
>         path("", include("UserAuth.urls")),
>         path("doctors/", include("Administration.urls")),
>         path("appointments/", include("Appointments.urls")),
>         path("messaging/", include("messaging.urls")),
>         path("meet/", include("meet.urls")),
>         path("api_documentation/", schema_view),
>         path("covid/", include("Covid.urls")),
>     ]
>
> This is app **urls.py** file
>
>     from django.urls import path
>     from . import views
>     
>     app_name = 'Covid'
>     
>     urlpatterns = [
>         path('event/', views.EventBookingView.as_view()),
>     ]
>
> **settings.py** installed apps 
>
>     ALLOWED_HOSTS = ['*']
>     
>     
>     # Application definition
>     
>     INSTALLED_APPS = [
>         "django.contrib.admin",
>         "django.contrib.auth",
>         "django.contrib.sites",
>         "django.contrib.contenttypes",
>         "django.contrib.sessions",
>         "django.contrib.messages",
>         "django.contrib.staticfiles",
>         "UserAuth",
>         "rest_framework",
>         "corsheaders",
>         'rest_framework.authtoken',
>         'rest_auth',
>         'Appointments',
>         'messaging',
>         'Administration',
>         'channels',
>         'invitations',
>         'rest_invitations',
>         'django_rest_passwordreset',
>         'django_celery_beat',
>         'meet',
>         'rest_framework_swagger',
>          'Covid',
>     
>     ]
>
> This is a project structure
>
> [Project Structure][1]
>
>
>   [1]: https://i.stack.imgur.com/E8qro.jpg
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com?utm_medium=email_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/68400690-f3b1-305e-83b1-577767bc7469%40dewhirst.com.au.


signature.asc
Description: OpenPGP digital signature


How to trace circular import error Django never solved!! Please sort this out.

2020-07-21 Thread Sai
I am working Django rest framework api project, where I had multiple apps 
in the project. I got a circular import error when I am adding the app URLs 
to the main URLs. I Tried everything checked spellings, checked app 
structure but no use. Its been really frustrating with issue..please help 
to solve the problem. The app is working fine when I take off newly added 
line `path("covid/", include("Covid.urls")),`

I am using python3.6, django 3.0.4 and django-rest-framework 3.11.0

Here is project 
**urls.py** 

   
from django.contrib import admin
from django.conf.urls import url
from django.urls import path, include
from rest_framework_swagger.views import get_swagger_view

schema_view = get_swagger_view(title='TmmrwInc API Documentation')

urlpatterns = [
path('admin/', admin.site.urls),
# path('', include('django.contrib.auth.urls')),
# path('rest_auth/', include('rest_auth.urls')),
path('api/password_reset/',
include('django_rest_passwordreset.urls', 
namespace='password_reset')),
# url(r'^invitations/', include('invitations.urls', 
namespace='invitations')),
path('', include('rest_invitations.urls')),
path("", include("UserAuth.urls")),
path("doctors/", include("Administration.urls")),
path("appointments/", include("Appointments.urls")),
path("messaging/", include("messaging.urls")),
path("meet/", include("meet.urls")),
path("api_documentation/", schema_view),
path("covid/", include("Covid.urls")),
]

This is app **urls.py** file

from django.urls import path
from . import views

app_name = 'Covid'

urlpatterns = [
path('event/', views.EventBookingView.as_view()),
]

**settings.py** installed apps 

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.sites",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"UserAuth",
"rest_framework",
"corsheaders",
'rest_framework.authtoken',
'rest_auth',
'Appointments',
'messaging',
'Administration',
'channels',
'invitations',
'rest_invitations',
'django_rest_passwordreset',
'django_celery_beat',
'meet',
'rest_framework_swagger',
 'Covid',

]

This is a project structure

[Project Structure][1]


  [1]: https://i.stack.imgur.com/E8qro.jpg

-- 
You received this message because you are subscribed to the Google Groups 
"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/90296ccf-c893-4cf1-b57a-2da47396a2bbo%40googlegroups.com.


Import error on version 3.1a1

2020-06-08 Thread Jules Capacilllo
Hi guys,

Am getting the below error when we I tried updating to 3.1a1 from 3.0.6

from rest_framework import filters as rest_filters

  File 
"/home/jules/.cache/pypoetry/virtualenvs/plum-TXT4_AUl-py3.8/lib/python3.8/site-packages/rest_framework/filters.py",
 
line 11, in 

from django.db.models.sql.constants import ORDER_PATTERN

ImportError: cannot import name 'ORDER_PATTERN' from 
'django.db.models.sql.constants' 
(/home/jules/.cache/pypoetry/virtualenvs/plum-TXT4_AUl-py3.8/lib/python3.8/site-packages/django/db/models/sql/constants.py)

There does not seem any mention in the release docs (
https://docs.djangoproject.com/en/dev/releases/3.1/#models) pertaining to 
this. 

Hope you guys can help.

-- 
You received this message because you are subscribed to the Google Groups 
"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/a143551d-3c5b-4bb1-b331-679ae2c3345bo%40googlegroups.com.


Import error on version 3.1a1

2020-06-08 Thread Jules Capacilllo
Hi guys,

Am getting the below error when we I tried updating to 3.1a1 from 3.0.6

from .router import router

  File "/home/jules/plum/plum/router.py", line 4, in 

from plum.plum_task.views_api import TaskViewSet, TaskStatusViewSet

  File "/home/jules/plum/plum/plum_task/views_api.py", line 12, in 

from rest_framework import filters as rest_filters

  File 
"/home/jules/.cache/pypoetry/virtualenvs/plum-TXT4_AUl-py3.8/lib/python3.8/site-packages/rest_framework/filters.py",
 
line 11, in 

from django.db.models.sql.constants import ORDER_PATTERN

ImportError: cannot import name 'ORDER_PATTERN' from 
'django.db.models.sql.constants' 
(/home/jules/.cache/pypoetry/virtualenvs/plum-TXT4_AUl-py3.8/lib/python3.8/site-packages/django/db/models/sql/constants.py)

There does not seem any mention in the release docs (
https://docs.djangoproject.com/en/dev/releases/3.1/#models) pertaining to 
this. 

Hope you guys can help.

-- 
You received this message because you are subscribed to the Google Groups 
"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/242db336-ab64-4c94-b57e-1fb254ccf280o%40googlegroups.com.


Re: import error

2018-02-05 Thread Matemática A3K
On Mon, Feb 5, 2018 at 10:59 AM, sarvit sarvit 
wrote:

> is not app
> views.py
> from django.http import HttpRequest
>
> def index(request):
>return HttpRequest("Hello World.")
>
> urls.py
>
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from views.py import views
>
> urlpatterns = [
>path('admin/', admin.site.urls),
>url(r'^$',views.index),
>
>
> ]
>
>
>
Judging from this, you are trying to import the views from your "main"
urls.py, and generally the views are within an django app. In that case,
you should use your_app_name.views as stated before. "Relative imports"
(from . import views) will work only if the file is on the same directory
you are working (i.e. inside an app).
 .

>
>
> On Monday, February 5, 2018 at 4:54:59 PM UTC+3:30, sarvit sarvit wrote:
>>
>> Hello
>> I importing error
>> Please help me
>> from django.shortcuts import render
>> from django.conf.urls import url
>> from django.contrib import admin
>> from django.urls import path
>> from . import views
>>
>>
>> Traceback (most recent call last):
>>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in
>> 
>> from . import views
>> ImportError: cannot import name 'views'
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "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/1d3b5804-123c-40ce-9ec9-fa4bb5fc8495%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/CA%2BFDnhLCgR_6AjyYXSZ8Nu%2BOpkQnLsLaCpUkBSJ21Ekuw39Baw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2018-02-05 Thread sarvit sarvit
is not app 
views.py
from django.http import HttpRequest

def index(request):
   return HttpRequest("Hello World.")

urls.py

from django.shortcuts import render
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from views.py import views

urlpatterns = [
   path('admin/', admin.site.urls),
   url(r'^$',views.index),


]




On Monday, February 5, 2018 at 4:54:59 PM UTC+3:30, sarvit sarvit wrote:
>
> Hello 
> I importing error 
> Please help me 
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from . import views
>
>
> Traceback (most recent call last):
>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in 
> 
> from . import views
> ImportError: cannot import name 'views'
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/1d3b5804-123c-40ce-9ec9-fa4bb5fc8495%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2018-02-05 Thread pradam
Bro,
do it like this:
from *your_app_name* import views

On Mon, Feb 5, 2018 at 6:54 PM, sarvit sarvit 
wrote:

> Hello
> I importing error
> Please help me
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from . import views
>
>
> Traceback (most recent call last):
>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in
> 
> from . import views
> ImportError: cannot import name 'views'
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/2ff76016-b9a4-47dc-a4c1-87a828e86c0f%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/CAGGVXBMUEiy7jmE-pHqqgk680wnixNkxV-q1fH5vL4Z%2BQHhjow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


import error

2018-02-05 Thread sarvit sarvit
Hello 
I importing error 
Please help me 
from django.shortcuts import render
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from . import views


Traceback (most recent call last):
  File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in 

from . import views
ImportError: cannot import name 'views'



-- 
You received this message because you are subscribed to the Google Groups 
"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/2ff76016-b9a4-47dc-a4c1-87a828e86c0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2017-12-11 Thread Dylan Reinhold
For your other error, are you are using passing the literal string Home,
then enclose it in quotes.


On Mon, Dec 11, 2017 at 8:03 PM, Dylan Reinhold  wrote:

> It does not look like you have created an app yet in your project.
>
> You should create one say web [ manage.py startapp web ]
> Then move that views.py and the templates folder into that app folder web/
>
> Then in your urls.py change the
> from .views import index
> to
> from web.views import index.
>
> In your settings you will need to add wed to your INSTALLED_APPS.
>
> Dylan
>
> On Mon, Dec 11, 2017 at 4:25 PM, Rabin BK  wrote:
>
>>
>> 
>>
>>
>> 
>> Please help me with this. I have been trying for weeks, but have not
>> found a solution. I have highlighted the errors there.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/4fde6e60-fac3-46d1-a426-f0e972c41097%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/CAHtg44DGajsJ4bg-7hSzK5uR%3D_LtVCaxw0PitNT8_BFfrDGm1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2017-12-11 Thread Dylan Reinhold
It does not look like you have created an app yet in your project.

You should create one say web [ manage.py startapp web ]
Then move that views.py and the templates folder into that app folder web/

Then in your urls.py change the
from .views import index
to
from web.views import index.

In your settings you will need to add wed to your INSTALLED_APPS.

Dylan

On Mon, Dec 11, 2017 at 4:25 PM, Rabin BK  wrote:

>
> 
>
>
> 
> Please help me with this. I have been trying for weeks, but have not found
> a solution. I have highlighted the errors there.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/4fde6e60-fac3-46d1-a426-f0e972c41097%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/CAHtg44Aq9aZHPSy0U8JPZjfCqwod9zw4Bb5bx7khdihVNJchAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


import error

2017-12-11 Thread Rabin BK





Please help me with this. I have been trying for weeks, but have not found 
a solution. I have highlighted the errors there. 

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


Re: Django Gunicorn Import Error: no module name wsgi

2017-09-04 Thread Melvyn Sopacua
Your Django project really is "weather_station", but you treat
"myproject" as the
project.

Revisit:
https://docs.djangoproject.com/en/1.11/intro/tutorial01/#creating-a-project

And follow instructions to the tee and look at the directory structure.

On Sun, Sep 3, 2017 at 6:04 PM, Jonathan Cheng  wrote:
> I use Python3.5.2 Django1.9
>
> I use `python -m venv venv/weather_station` to create virtual evnironment
> (/home/user/venv)
>
> This is my project tree in Ubuntu /home/user/myproject:
> (`export project=/home/user/myproject`)
>
> myproject
>|
>├── gunicorn.conf.py
>├── static
>│   ├── admin
>└── weather_station
>├── base
>│   ├── migrations
>│   ├── static
>│   └── templates
>└── weather_station
>├── __init__.py
>├── wsgi.py
>├── urls.py
>├── settings
>├── base.py
>├── production.py
> 在此輸入代碼...
>
> __init__.py:
> import pymysql
> pymysql.install_as_MySQLdb()
> wsgi.py
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE",
> "weather_station.settings.production")
>
> application = get_wsgi_application()
> The partial in the settings.base.py:
> BASE_DIR =
> os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__
>
> ROOT_URLCONF = 'weather_station.urls'
>
> WSGI_APPLICATION = 'weather_station.wsgi.application'
>
> STATIC_URL = '/static/'
> In the partial of settings.production.py:
> from .base import *
>
> DEBUG = False
>
> STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
>
> MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media')
> gunicorn.conf.py:
> import os
>
> bind = '127.0.0.1:8080'
> worders = (os.sysconf('SC_NPROCESSORS_ONLN') * 2) + 1
> loglevel = 'error'
> command = '/home/user/venv/weather_station/bin/gunicorn'
> pythonpath = '/home/user/myproject/weather_station'
>
> And in the /etc/nginx/sites-available/weather.conf:
>
> upstream weather_station {
> server 127.0.0.1:8080;
> }
>
> server {
> listen 80 default_server;
> listen 443 default ssl;
> server_name http://my_ip;
> client_max_body_size 10M;
> keepalive_timeout15;
>
> location /static/ {
> alias   /$project/static/;
> }
> location /media/ {
> alias   /$project/media/;
> }
>
> location / {
> proxy_redirect  off;
> proxy_set_headerHost$host;
> proxy_set_headerX-Real-IP   $remote_addr;
> proxy_set_headerX-Forwarded-For
> $proxy_add_x_forwarded_for;
> proxy_set_headerX-Forwarded-Protocol$scheme;
> proxy_pass  http://myproject;
>
> When I the follwoing command under myproject
> gunicorn -c gunicorn.conf.py weather_station.weather_station.wsgi
>
>
>
> It showed `ImportError: No module named 'weather_station.settings'`
>
> Does any know the reason ?
>
>
> it successfully weather_station.wsgi.
>
> But the new error is  `ImportError: No module named
> 'weather_station.settings'`
>
> detailed log
>
>
>  File "/home/user/myproject/weather_station/weather_station/wsgi.py", line
> 17, in 
> application = get_wsgi_application()
>   File
> "/home/user/.local/lib/python3.5/site-packages/django/core/wsgi.py", line
> 13, in get_wsgi_application
> django.setup()
>   File
> "/home/user/.local/lib/python3.5/site-packages/django/__init__.py", line 17,
> in setup
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
>   File
> "/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py",
> line 55, in __getattr__
> self._setup(name)
>   File
> "/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py",
> line 43, in _setup
> self._wrapped = Settings(settings_module)
>   File
> "/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py",
> line 99, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> ImportError: No module named 'weather_station.settings'
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/87a81098-2124-4702-a429-4f161cd055d8%40googlegroups.com.
> 

Re: Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread M Hashmi
Try:

gunicorn --bind ip:port wsgi:application

Make sure you run it from the directory where manage.py is located.
Regards,
M

On Sun, Sep 3, 2017 at 9:04 AM, Jonathan Cheng 
wrote:

> I use Python3.5.2 Django1.9
>
> I use `python -m venv venv/weather_station` to create virtual evnironment
> (/home/user/venv)
>
> This is my project tree in Ubuntu /home/user/myproject:
> (`export project=/home/user/myproject`)
>
> myproject
>|
>├── gunicorn.conf.py
>├── static
>│   ├── admin
>└── weather_station
>├── base
>│   ├── migrations
>│   ├── static
>│   └── templates
>└── weather_station
>├── __init__.py
>├── wsgi.py
>├── urls.py
>├── settings
>├── base.py
>├── production.py
> 在此輸入代碼...
>
> __init__.py:
> import pymysql
> pymysql.install_as_MySQLdb()
> wsgi.py
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE",
> "weather_station.settings.production")
>
> application = get_wsgi_application()
> The partial in the settings.base.py:
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.
> path.abspath(__file__
>
> ROOT_URLCONF = 'weather_station.urls'
>
> WSGI_APPLICATION = 'weather_station.wsgi.application'
>
> STATIC_URL = '/static/'
> In the partial of settings.production.py:
> from .base import *
>
> DEBUG = False
>
> STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
>
> MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media')
> gunicorn.conf.py:
> import os
>
> bind = '127.0.0.1:8080'
> worders = (os.sysconf('SC_NPROCESSORS_ONLN') * 2) + 1
> loglevel = 'error'
> command = '/home/user/venv/weather_station/bin/gunicorn'
> pythonpath = '/home/user/myproject/weather_station'
>
> And in the /etc/nginx/sites-available/weather.conf:
>
> upstream weather_station {
> server 127.0.0.1:8080;
> }
>
> server {
> listen 80 default_server;
> listen 443 default ssl;
> server_name http://my_ip;
> client_max_body_size 10M;
> keepalive_timeout15;
>
> location /static/ {
> alias   /$project/static/;
> }
> location /media/ {
> alias   /$project/media/;
> }
>
> location / {
> proxy_redirect  off;
> proxy_set_headerHost$host;
> proxy_set_headerX-Real-IP   $remote_addr;
> proxy_set_headerX-Forwarded-For
> $proxy_add_x_forwarded_for;
> proxy_set_headerX-Forwarded-Protocol$scheme;
> proxy_pass  http://myproject;
>
> When I the follwoing command under myproject
> gunicorn -c gunicorn.conf.py weather_station.weather_station.wsgi
>
>
>
> It showed `ImportError: No module named 'weather_station.settings'`
>
> Does any know the reason ?
>
>
> it successfully weather_station.wsgi.
>
> But the new error is  `ImportError: No module named
> 'weather_station.settings'`
>
> detailed log
>
>
>  File "/home/user/myproject/weather_station/weather_station/wsgi.py",
> line 17, in 
> application = get_wsgi_application()
>   File "/home/user/.local/lib/python3.5/site-packages/
> django/core/wsgi.py", line 13, in get_wsgi_application
> django.setup()
>   File "/home/user/.local/lib/python3.5/site-packages/
> django/__init__.py", line 17, in setup
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
>   File "/home/user/.local/lib/python3.5/site-packages/
> django/conf/__init__.py", line 55, in __getattr__
> self._setup(name)
>   File "/home/user/.local/lib/python3.5/site-packages/
> django/conf/__init__.py", line 43, in _setup
> self._wrapped = Settings(settings_module)
>   File "/home/user/.local/lib/python3.5/site-packages/
> django/conf/__init__.py", line 99, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   File "/usr/lib/python3.5/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> ImportError: No module named 'weather_station.settings'
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/87a81098-2124-4702-a429-4f161cd055d8%40googlegroups.com
> 

Django Gunicorn Import Error: no module name wsgi

2017-09-03 Thread Jonathan Cheng
I use Python3.5.2 Django1.9

I use `python -m venv venv/weather_station` to create virtual evnironment 
(/home/user/venv)

This is my project tree in Ubuntu /home/user/myproject:
(`export project=/home/user/myproject`)

myproject
   |
   ├── gunicorn.conf.py
   ├── static
   │   ├── admin
   └── weather_station
   ├── base
   │   ├── migrations
   │   ├── static
   │   └── templates
   └── weather_station
   ├── __init__.py
   ├── wsgi.py
   ├── urls.py
   ├── settings
   ├── base.py
   ├── production.py
在此輸入代碼...

__init__.py:
import pymysql
pymysql.install_as_MySQLdb()
wsgi.py
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", 
"weather_station.settings.production")

application = get_wsgi_application()
The partial in the settings.base.py:
BASE_DIR = 
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__
 
ROOT_URLCONF = 'weather_station.urls'

WSGI_APPLICATION = 'weather_station.wsgi.application'

STATIC_URL = '/static/'
In the partial of settings.production.py:
from .base import *   

DEBUG = False

STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')

MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media')
gunicorn.conf.py:
import os
 
bind = '127.0.0.1:8080'
worders = (os.sysconf('SC_NPROCESSORS_ONLN') * 2) + 1
loglevel = 'error'
command = '/home/user/venv/weather_station/bin/gunicorn'
pythonpath = '/home/user/myproject/weather_station'

And in the /etc/nginx/sites-available/weather.conf:

upstream weather_station {
server 127.0.0.1:8080;
}

server {
listen 80 default_server;
listen 443 default ssl;
server_name http://my_ip;
client_max_body_size 10M;
keepalive_timeout15;

location /static/ {
alias   /$project/static/;
}
location /media/ {
alias   /$project/media/;
}

location / {
proxy_redirect  off;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP   $remote_addr;
proxy_set_headerX-Forwarded-For 
$proxy_add_x_forwarded_for;
proxy_set_headerX-Forwarded-Protocol$scheme;
proxy_pass  http://myproject;

When I the follwoing command under myproject
gunicorn -c gunicorn.conf.py weather_station.weather_station.wsgi



It showed `ImportError: No module named 'weather_station.settings'`

Does any know the reason ?


it successfully weather_station.wsgi.

But the new error is  `ImportError: No module named 
'weather_station.settings'`

detailed log

   
 File "/home/user/myproject/weather_station/weather_station/wsgi.py", line 
17, in 
application = get_wsgi_application()
  File 
"/home/user/.local/lib/python3.5/site-packages/django/core/wsgi.py", line 13
, in get_wsgi_application
django.setup()
  File 
"/home/user/.local/lib/python3.5/site-packages/django/__init__.py", line 17, 
in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 55, in __getattr__
self._setup(name)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 43, in _setup
self._wrapped = Settings(settings_module)
  File 
"/home/user/.local/lib/python3.5/site-packages/django/conf/__init__.py", 
line 99, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named 'weather_station.settings'







-- 
You received this message because you are subscribed to the Google Groups 
"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/87a81098-2124-4702-a429-4f161cd055d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up an App and getting an import error

2017-04-07 Thread Nate Granatir
I may be speaking a bit out of my depth here, but I wonder if it's maybe 
because you haven't created __init__.py files in the directories? I believe 
Django (well, Python), requires an empty __init__.py file in directories 
when loading them as modules:
https://docs.python.org/3/tutorial/modules.html#packages

If it's not that, then I have no idea!

Nate

On Wednesday, April 5, 2017 at 11:28:23 AM UTC-5, jjander...@gmail.com 
wrote:
>
>
> Hi,
>
> I'm setting up a Django app using Django 1.10.3 and python 3.5.2. When I 
> run the following command in my 3.5.2 virtual environment:
>
>   
>
> *python manage.py runserver*prior to entering the  app in INSTALLED_APPS 
> in settings.py, my webpage comes up fine.
>
>
> When I add the following line to INSTALLED_APPS:
>
>   *  'util.siggy.apps.SiggyConfig',*
>
> I get the following error message:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Unhandled exception in thread started by  check_errors..wrapper at 0x7f47313e7620>Traceback (most recent call 
> last):  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 226, in wrapperfn(*args, **kwargs)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/core/management/commands/runserver.py",
>  
> line 113, in inner_runautoreload.raise_last_exception()  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 249, in raise_last_exceptionsix.reraise(*_exception)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/six.py", 
> line 685, in reraiseraise value.with_traceback(tb)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py",
>  
> line 226, in wrapperfn(*args, **kwargs)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/__init__.py", line 
> 27, in setupapps.populate(settings.INSTALLED_APPS)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/registry.py", 
> line 85, in populateapp_config = AppConfig.create(entry)  File 
> "/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/config.py", 
> line 116, in createmod = import_module(mod_path)  File 
> "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)  File " importlib._bootstrap>", line 986, in _gcd_import  File " importlib._bootstrap>", line 969, in _find_and_load  File " importlib._bootstrap>", line 944, in _find_and_load_unlocked  File " importlib._bootstrap>", line 222, in _call_with_frames_removed  File 
> "", line 986, in _gcd_import  File " importlib._bootstrap>", line 969, in _find_and_load  File " importlib._bootstrap>", line 956, in _find_and_load_unlockedImportError: No 
> module named 'util.siggy'*In my project directory, I have a path 
> .../project_dir/util/siggy/apps.py that has the class SiggyConfig defined 
> in it.
>
> It looks to me that python is not finding my util/siggy directory, but I'm 
> not sure why. I included a print statement
> in manage.py and it prinsts out the sys.path as:
>
>
>
>
>
>
>
>
>
> *['/home/jja/prog/dev/newSiggy', 
> '/home/jja/testenv3.5/lib/python3.5/site-packages/django_classy_tags-0.8.0-py3.5.egg',
>  '/home/jja/testenv3.5/lib', '/usr/lib/python35.zip', '/usr/lib/python3.5', 
> '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', 
> '/home/jja/testenv3.5/lib/python3.5/site-packages']*
>
> where /home/jja/prog/dev/newSiggy is the path to my Django project root.
>
> The full path to my app is /home/jja/prog/dev/newSiggy/util/siggy/apps.py.
>
> It is a mystery to my why python cannot find 'util.siggy'.
>
> I've looked on the web and have not found a case that seems to match mine 
> (some are close). I have tried changing a few
> path related settings, but so far, no success.
>
> Any suggestions on what to try next?
>
> Jim A.
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/cd7eca9e-7ea2-4bcd-8c05-97bedc26cd6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Setting up an App and getting an import error

2017-04-05 Thread jjanderson52000

Hi,

I'm setting up a Django app using Django 1.10.3 and python 3.5.2. When I 
run the following command in my 3.5.2 virtual environment:

  

*python manage.py runserver*prior to entering the  app in INSTALLED_APPS in 
settings.py, my webpage comes up fine.


When I add the following line to INSTALLED_APPS:

  *  'util.siggy.apps.SiggyConfig',*

I get the following error message:






























*Unhandled exception in thread started by .wrapper at 0x7f47313e7620>Traceback (most recent call 
last):  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 226, in wrapperfn(*args, **kwargs)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/core/management/commands/runserver.py",
 
line 113, in inner_runautoreload.raise_last_exception()  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 249, in raise_last_exceptionsix.reraise(*_exception)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/six.py", 
line 685, in reraiseraise value.with_traceback(tb)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/utils/autoreload.py", 
line 226, in wrapperfn(*args, **kwargs)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/__init__.py", line 
27, in setupapps.populate(settings.INSTALLED_APPS)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/registry.py", 
line 85, in populateapp_config = AppConfig.create(entry)  File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/apps/config.py", 
line 116, in createmod = import_module(mod_path)  File 
"/usr/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 _find_and_load  File "", line 944, in _find_and_load_unlocked  File "", line 222, in _call_with_frames_removed  File 
"", line 986, in _gcd_import  File "", line 969, in _find_and_load  File "", line 956, in _find_and_load_unlockedImportError: No 
module named 'util.siggy'*In my project directory, I have a path 
.../project_dir/util/siggy/apps.py that has the class SiggyConfig defined 
in it.

It looks to me that python is not finding my util/siggy directory, but I'm 
not sure why. I included a print statement
in manage.py and it prinsts out the sys.path as:








*['/home/jja/prog/dev/newSiggy', 
'/home/jja/testenv3.5/lib/python3.5/site-packages/django_classy_tags-0.8.0-py3.5.egg',
 '/home/jja/testenv3.5/lib', '/usr/lib/python35.zip', '/usr/lib/python3.5', 
'/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', 
'/home/jja/testenv3.5/lib/python3.5/site-packages']*

where /home/jja/prog/dev/newSiggy is the path to my Django project root.

The full path to my app is /home/jja/prog/dev/newSiggy/util/siggy/apps.py.

It is a mystery to my why python cannot find 'util.siggy'.

I've looked on the web and have not found a case that seems to match mine 
(some are close). I have tried changing a few
path related settings, but so far, no success.

Any suggestions on what to try next?

Jim A.

 

-- 
You received this message because you are subscribed to the Google Groups 
"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/8a142ed8-84b5-4bc9-a13a-742d40f6df50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error: no module named viewflow.frontend

2017-02-24 Thread Михаил Подгурский
It looks that you are using an outdated version of the viewflow.

viewflow.frontend was added to the open-source version since 0.12+

Please consider upgrade to the latest 0.12.2

You can check out the viewflow cookbook helloword sample, and get it 
running with few commands.
 
https://github.com/viewflow/cookbook/tree/master/helloworld

$ virtualenv env --python=python3.4
$ env/bin/pip install requirements.txt
$ env/bin/python manage.py migrate
$ env/bin/python manage.py createsuperuser
$ env/bin/python manage.py runserver


четверг, 23 февраля 2017 г., 17:58:53 UTC+6 пользователь angelachakupa.at 
написал:
>
> hie guys
> m getting this error * Import error: no module named viewflow.frontend * yet 
> i followed the procedures on how to apply the view flow module what could 
> be the problem.
>
>
>  
>
> Flow.py
>
>  
>
>  
>
> from viewflow import flow,lock
>
> from viewflow.base import this, Flow
>
> from viewflow.contrib import celery
>
> from viewflow.flow.views import CreateProcessView, UpdateProcessView, 
> Startview
>
> from viewflow import frontend
>
> from viewflow.site import viewsite
>
>  
>
>  
>
> from .models import HelloWorldProcess
>
>  
>
>  
>
> @frontend.register
>
> class HelloWorldFlow(Flow):
>
> process_class = HelloWorldProcess
>
> lock_impl = lock.select_for_update_lock
>
>  
>
> start = (
>
> flow.Start
>
> (CreateProcessView,
>
> fields=["text"]
>
> ).Permission(auto_create=True)\
>
> .Next(this.approve))
>
>  
>
> approve = (flow.View(UpdateProcessView,fields=["approved"])\
>
> .Permission(auto_create=True)\
>
> .Next(this.check_approve)
>
> )
>
>  
>
> check_approve = (
>
> flow.If(lambda activation: activation.process.approved)\
>
> .Then(this.send)\
>
> .Else(this.end)
>
> )
>
>  
>
> send = (celery.Job(tasks.send_hello_world_request)\
>
> .Next(this.end)
>
> )
>
>  
>
> end = flow.End()
>
>  
>
> viewsite.register(HelloWorldFlow)
>
>  
>
> #def send_question_app_request(self, activation):
>
> #print(activation.process.text)
>
>
>
> this is my flow.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57d99d23-b93b-484d-ae57-4827dcdce9c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error: no module named viewflow.frontend

2017-02-23 Thread chris rose
did you add 'viewflow.frontend' to installed_apps?

-- 
You received this message because you are subscribed to the Google Groups 
"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/be562e55-25fb-45df-b4a5-f58dbf75aa7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


import error: no module named viewflow.frontend

2017-02-23 Thread angelachakupa.at
hie guys
m getting this error * Import error: no module named viewflow.frontend * yet 
i followed the procedures on how to apply the view flow module what could 
be the problem.


 

Flow.py

 

 

from viewflow import flow,lock

from viewflow.base import this, Flow

from viewflow.contrib import celery

from viewflow.flow.views import CreateProcessView, UpdateProcessView, 
Startview

from viewflow import frontend

from viewflow.site import viewsite

 

 

from .models import HelloWorldProcess

 

 

@frontend.register

class HelloWorldFlow(Flow):

process_class = HelloWorldProcess

lock_impl = lock.select_for_update_lock

 

start = (

flow.Start

(CreateProcessView,

fields=["text"]

).Permission(auto_create=True)\

.Next(this.approve))

 

approve = (flow.View(UpdateProcessView,fields=["approved"])\

.Permission(auto_create=True)\

.Next(this.check_approve)

)

 

check_approve = (

flow.If(lambda activation: activation.process.approved)\

.Then(this.send)\

.Else(this.end)

)

 

send = (celery.Job(tasks.send_hello_world_request)\

.Next(this.end)

)

 

end = flow.End()

 

viewsite.register(HelloWorldFlow)

 

#def send_question_app_request(self, activation):

#print(activation.process.text)



this is my flow.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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea26d0b2-29e9-49a6-808c-b8c12b43d018%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Import Error Running script to populate database using models

2016-09-20 Thread miguel vfx
Good day,

I'm getting import errors when I try to run a script to populate a database 
using models. I'm new to django so it means I haven't done anything special 
than follow djangobook and other beginner tutorials.

The script I would like to run is in the same folder as the models.py. I 
figured I was going to use the same import headings as admin.py but I'm 
getting the following error:

from .models import currentRecord
>
> SystemError: Parent module '' not loaded, cannot perform relative import
>

Further searching for solutions, I stumbled upon adding this lines:

from models import currentRecord
>

sys.path.append('E:/misite/')
> os.environ['DJANGO_SETTINGS_MODULE']='project.settings'
> django.setup()
>
 

> django.core.exceptions.ImproperlyConfigured: Requested setting 
> DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either 
> define the environment variable DJANGO_SETTINGS_MODULE or call 
> settings.configure() before accessing settings. 
>
 
I would really appreciate any pointers.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f5cff386-8189-4729-9757-aec0122b53b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: WeakMethod import error in Django 1.9 with python 3.3

2016-02-09 Thread Tim Graham
As noted in the Django 1.9 release notes, "Django 1.9 requires Python 2.7, 
3.4, or 3.5."

On Tuesday, February 9, 2016 at 5:49:41 AM UTC-5, Mohammad Asif wrote:
>
> Hello,
>
> I'm using django 1.9.1 with python 3.3.
> Whenever I'm running manage.py runserver, I'm getting following error.
>
> * File 
> "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/django/dispatch/__init__.py",
>  
> line 9, in *
>
> * from django.dispatch.dispatcher import Signal, receiver # NOQA*
>
> * File 
> "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/django/dispatch/dispatcher.py",
>  
> line 14, in *
>
> * from weakref import WeakMethod*
>
> *ImportError: cannot import name WeakMethod*
>
>
> As I was reading WeakMethod of weakref has been introduced in python 3.4, 
> and its not exist in weakref of python 3.3.
>
>
> Any suggestions on how to fix the same error with python 3.3.
>
>
>
> Regards,
>
> Asif
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/3952b48d-6bf0-40ee-a4bd-7194681a0cf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


WeakMethod import error in Django 1.9 with python 3.3

2016-02-09 Thread Mohammad Asif
Hello,

I'm using django 1.9.1 with python 3.3.
Whenever I'm running manage.py runserver, I'm getting following error.

* File 
"/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/django/dispatch/__init__.py",
 
line 9, in *

* from django.dispatch.dispatcher import Signal, receiver # NOQA*

* File 
"/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/django/dispatch/dispatcher.py",
 
line 14, in *

* from weakref import WeakMethod*

*ImportError: cannot import name WeakMethod*


As I was reading WeakMethod of weakref has been introduced in python 3.4, 
and its not exist in weakref of python 3.3.


Any suggestions on how to fix the same error with python 3.3.



Regards,

Asif

-- 
You received this message because you are subscribed to the Google Groups 
"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/c9ed00b5-a8e3-474b-b76c-37a753f653fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Timezone import error

2015-11-30 Thread ahmed . abdullah . bh
Hi kbnk, monoBOT,

Thank you both, your answers on the spot, I have tried using the filter and 
it's working, I may need to delete one of the records to get this sorted, 
thanks again.

>>> Question.objects.filter(pub_date__year=current_year)
[, ]

Best regards,
Ahmed Abdullah

On Sunday, 29 November 2015 19:38:41 UTC+3, monoBOT monoBOT wrote:
>
> Hello Ahmed
>
> you are using the get method, get can only return 1 item and its returning 
> more than 1 in your case 2, thats the second error, but there is an import 
> error also somewhere in your code, but the traceback you are sending is not 
> concluyent.
>
> 2015-11-29 15:11 GMT+00:00 <ahmed.ab...@gmail.com >:
>
>> Hi,
>>
>> I'm practicing Django v 1.8.6 (Writing your first Django app, part 1) and 
>> getting error when trying to import timezone, also I have installed pytz, 
>> when I try to use the import timezone package I'm getting ImportError. 
>>
>> My settings.py has USE_TZ set to true by default, also, I had to change 
>> the TIME_ZONE from UTC to Asia/Bahrain but still I'm getting the below 
>> error, kindly if anyone have advice on the below error?
>>
>> >>> from polls.models import Question, Choice
>> >>> Question.objects.all()
>> [, ]
>> >>> Question.objects.filter(id=1)
>> []
>> >>> Question.objects.filter(id=2)
>> []
>> >>> Question.objects.filter(id=3)
>> []
>> >>> Question.objects.filter(question_text__startswith='What')
>> [, ]
>> >>> from django.utils import timezone
>> >>> current_year = timezone.now().year
>> >>> Question.objects.get(pub_date__year=current_year)
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
>>  
>> line 69, in h
>> andle
>> self.run_shell(shell=options['interface'])
>>   File 
>> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
>>  
>> line 61, in r
>> un_shell
>> raise ImportError
>> ImportError
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File 
>> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\manager.py",
>>  
>> line 127, in manager_metho
>> d
>> return getattr(self.get_queryset(), name)(*args, **kwargs)
>>   File 
>> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\query.py",
>>  
>> line 338, in get
>> (self.model._meta.object_name, num)
>> polls.models.MultipleObjectsReturned: get() returned more than one 
>> Question -- it returned 2!
>> >>>
>>
>> Best regards,
>> Ahmed Abdullah
>>
>> -- 
>> You received this message because you are subscribed 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/f6953f2e-f9a6-46c7-aec8-f337b772fc9b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/f6953f2e-f9a6-46c7-aec8-f337b772fc9b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *monoBOT*
> Visite mi sitio(Visit my site): monobotsoft.es/blog/
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/cccb90ea-cdf7-4a51-9cf0-ca9add0b4f4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Timezone import error

2015-11-29 Thread monoBOT
Hello Ahmed

you are using the get method, get can only return 1 item and its returning
more than 1 in your case 2, thats the second error, but there is an import
error also somewhere in your code, but the traceback you are sending is not
concluyent.

2015-11-29 15:11 GMT+00:00 <ahmed.abdullah...@gmail.com>:

> Hi,
>
> I'm practicing Django v 1.8.6 (Writing your first Django app, part 1) and
> getting error when trying to import timezone, also I have installed pytz,
> when I try to use the import timezone package I'm getting ImportError.
>
> My settings.py has USE_TZ set to true by default, also, I had to change
> the TIME_ZONE from UTC to Asia/Bahrain but still I'm getting the below
> error, kindly if anyone have advice on the below error?
>
> >>> from polls.models import Question, Choice
> >>> Question.objects.all()
> [, ]
> >>> Question.objects.filter(id=1)
> []
> >>> Question.objects.filter(id=2)
> []
> >>> Question.objects.filter(id=3)
> []
> >>> Question.objects.filter(question_text__startswith='What')
> [, ]
> >>> from django.utils import timezone
> >>> current_year = timezone.now().year
> >>> Question.objects.get(pub_date__year=current_year)
> Traceback (most recent call last):
>   File
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
> line 69, in h
> andle
> self.run_shell(shell=options['interface'])
>   File
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
> line 61, in r
> un_shell
> raise ImportError
> ImportError
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\manager.py",
> line 127, in manager_metho
> d
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\query.py",
> line 338, in get
> (self.model._meta.object_name, num)
> polls.models.MultipleObjectsReturned: get() returned more than one
> Question -- it returned 2!
> >>>
>
> Best regards,
> Ahmed Abdullah
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/f6953f2e-f9a6-46c7-aec8-f337b772fc9b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f6953f2e-f9a6-46c7-aec8-f337b772fc9b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
You received this message because you are subscribed to the Google Groups 
"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%2BxOsGCjDSJ_PDv8_gi8etYeFv6MxjgjCM-zJp4FkQ458YOwAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Timezone import error

2015-11-29 Thread knbk
Hi Ahmed,

When an error happens in an expect: block, python 3 shows the original 
error caught by the try/expect block, as well as the new error. In this 
case, the ImportError is the original error, and it's nothing you should 
worry about: Django catches it and handles it accordingly. Admittedly, the 
error is slightly confusing. The ImportError has nothing to do with 
timezones or pytz. 

The real error is the second one, the MultipleObjectsReturned exception. 
Question.objects.get() expects that exactly one object is returned by the 
database. If there are no objects returned, or more than one is returned, 
it will raise an expection. If you want to get all objects published in the 
current year, you can use 
Question.objects.filter(put_date__year=current_year) instead.

Marten

On Sunday, November 29, 2015 at 4:17:29 PM UTC+1, ahmed.ab...@gmail.com 
wrote:
>
> Hi,
>
> I'm practicing Django v 1.8.6 (Writing your first Django app, part 1) and 
> getting error when trying to import timezone, also I have installed pytz, 
> when I try to use the import timezone package I'm getting ImportError. 
>
> My settings.py has USE_TZ set to true by default, also, I had to change 
> the TIME_ZONE from UTC to Asia/Bahrain but still I'm getting the below 
> error, kindly if anyone have advice on the below error?
>
> >>> from polls.models import Question, Choice
> >>> Question.objects.all()
> [, ]
> >>> Question.objects.filter(id=1)
> []
> >>> Question.objects.filter(id=2)
> []
> >>> Question.objects.filter(id=3)
> []
> >>> Question.objects.filter(question_text__startswith='What')
> [, ]
> >>> from django.utils import timezone
> >>> current_year = timezone.now().year
> >>> Question.objects.get(pub_date__year=current_year)
> Traceback (most recent call last):
>   File 
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
>  
> line 69, in h
> andle
> self.run_shell(shell=options['interface'])
>   File 
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
>  
> line 61, in r
> un_shell
> raise ImportError
> ImportError
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File 
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\manager.py",
>  
> line 127, in manager_metho
> d
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File 
> "C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\query.py",
>  
> line 338, in get
> (self.model._meta.object_name, num)
> polls.models.MultipleObjectsReturned: get() returned more than one 
> Question -- it returned 2!
> >>>
>
> Best regards,
> Ahmed Abdullah
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/58d4cbd4-0cd4-46a1-b978-79d2544b7215%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Timezone import error

2015-11-29 Thread ahmed . abdullah . bh
Hi,

I'm practicing Django v 1.8.6 (Writing your first Django app, part 1) and 
getting error when trying to import timezone, also I have installed pytz, 
when I try to use the import timezone package I'm getting ImportError. 

My settings.py has USE_TZ set to true by default, also, I had to change the 
TIME_ZONE from UTC to Asia/Bahrain but still I'm getting the below error, 
kindly if anyone have advice on the below error?

>>> from polls.models import Question, Choice
>>> Question.objects.all()
[, ]
>>> Question.objects.filter(id=1)
[]
>>> Question.objects.filter(id=2)
[]
>>> Question.objects.filter(id=3)
[]
>>> Question.objects.filter(question_text__startswith='What')
[, ]
>>> from django.utils import timezone
>>> current_year = timezone.now().year
>>> Question.objects.get(pub_date__year=current_year)
Traceback (most recent call last):
  File 
"C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
 
line 69, in h
andle
self.run_shell(shell=options['interface'])
  File 
"C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\core\management\commands\shell.py",
 
line 61, in r
un_shell
raise ImportError
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\manager.py",
 
line 127, in manager_metho
d
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File 
"C:\Users\abdullaha\AppData\Local\Programs\Python\Python35\lib\site-packages\django\db\models\query.py",
 
line 338, in get
(self.model._meta.object_name, num)
polls.models.MultipleObjectsReturned: get() returned more than one Question 
-- it returned 2!
>>>

Best regards,
Ahmed Abdullah

-- 
You received this message because you are subscribed to the Google Groups 
"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/f6953f2e-f9a6-46c7-aec8-f337b772fc9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [newbie] import error after restart (virtualenv)

2015-09-20 Thread Vijay Khemlani
Aren't tests supposed to run with "python manage.py test lists"?

On Fri, Sep 18, 2015 at 8:55 PM, David  wrote:

> Dear Django experts,
>
> I am reading through Harry Percival's "Test-Driven Development with
> Python".
>
> As I finished chapter 3 yesterday, I was fully on track, perfectly
> aligned with the book.
>
> Today I restarted my computer, activated the virtualenv in question --
> and get an error message that was not there beforehand:
>
> (Percival_TDD)david@lubuntu
> :~/PycharmProjects/Percival_TDD/superlists/lists$
> python tests.py
> Traceback (most recent call last):
>   File "tests.py", line 5, in 
> from lists.views import home_page
> ImportError: No module named 'lists'
>
>
> I neither understand why he doesn't find 'lists' anymore nor do I know
> how to solve the problem.
>
> Can you please guide me towards a solution?
>
> Thank you!
>
> David
>
>
>
> The project structure looks as follows:
>
> (Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists$
> tree
> .
> ├── db.sqlite3
> ├── functional_tests.py
> ├── lists
> │   ├── admin.py
> │   ├── __init__.py
> │   ├── migrations
> │   │   └── __init__.py
> │   ├── models.py
> │   ├── tests.py
> │   └── views.py
> ├── manage.py
> └── superlists
> ├── __init__.py
> ├── __pycache__
> │   ├── __init__.cpython-34.pyc
> │   ├── settings.cpython-34.pyc
> │   ├── urls.cpython-34.pyc
> │   └── wsgi.cpython-34.pyc
> ├── settings.py
> ├── urls.py
> └── wsgi.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/55FCA478.5000609%40gmx.net.
> 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/CALn3ei0aAsUoUMpOEw7hqiLArF7e1EF15BB6kxPLtwUy%3D%3DF86g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[newbie] import error after restart (virtualenv)

2015-09-18 Thread David
Dear Django experts,

I am reading through Harry Percival's "Test-Driven Development with
Python".

As I finished chapter 3 yesterday, I was fully on track, perfectly
aligned with the book.

Today I restarted my computer, activated the virtualenv in question --
and get an error message that was not there beforehand:

(Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists/lists$
python tests.py
Traceback (most recent call last):
  File "tests.py", line 5, in 
from lists.views import home_page
ImportError: No module named 'lists'


I neither understand why he doesn't find 'lists' anymore nor do I know
how to solve the problem.

Can you please guide me towards a solution?

Thank you!

David



The project structure looks as follows:

(Percival_TDD)david@lubuntu:~/PycharmProjects/Percival_TDD/superlists$ tree
.
├── db.sqlite3
├── functional_tests.py
├── lists
│   ├── admin.py
│   ├── __init__.py
│   ├── migrations
│   │   └── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── manage.py
└── superlists
├── __init__.py
├── __pycache__
│   ├── __init__.cpython-34.pyc
│   ├── settings.cpython-34.pyc
│   ├── urls.cpython-34.pyc
│   └── wsgi.cpython-34.pyc
├── settings.py
├── urls.py
└── wsgi.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/55FCA478.5000609%40gmx.net.
For more options, visit https://groups.google.com/d/optout.
from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.
def home_page(request):
return HttpResponse('To-Do lists')

from django.core.urlresolvers import resolve
from django.test import TestCase
from django.http import HttpRequest

from lists.views import home_page

class HomePageTest(TestCase):

def test_root_url_resolves_to_home_page_view(self):
found = resolve('/')
self.assertEqual(found.func, home_page)

def test_home_page_returns_correct_html(self):
request = HttpRequest()
response = home_page(request)
self.assertTrue(response.content.startswith(b''))
self.assertIn(b'To-Do lists', response.content)
self.assertTrue(response.content.endswith(b''))



Re: Import error - No module named http

2015-03-18 Thread Mario Gudelj
And you should probably use suds for soap based apis.
On 19/03/2015 4:24 am, "Andrew Farrell"  wrote:

> Actually, please listen to Guilherme over me; He seems to have correctly
> spotted the omission.
>
> On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell 
> wrote:
>
>> So it seems like the problem is that you are doing `import http` on line
>> 24 of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
>> branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py rather
>> than `import httplib`. Python2 doesn't have a module in the standard
>> library named `http`, only `httplib`.
>>
>>
>> As an aside, if you are connecting to a SOAP service, you might consider
>> using requests.py or SUDS
>> .
>>
>>
>> On Wed, Mar 18, 2015 at 11:35 AM, Nivin Paul 
>> wrote:
>>
>>> ImportError at /cdrimport/settings/fraudsummary/disconnect/
>>>
>>> No module named http
>>>
>>>  Request Method: GET  Request URL:
>>> http://192.168.12.59:8080/cdrimport/settings/fraudsummary/disconnect/?id=3  
>>> Django
>>> Version: 1.6.4  Exception Type: ImportError  Exception Value:
>>>
>>> No module named http
>>>
>>>  Exception Location: 
>>> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py
>>> in , line 24  Python Executable: /usr/bin/python  Python
>>> Version: 2.7.6  Python Path:
>>>
>>> ['/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet',
>>>  
>>> '/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg',
>>>  
>>> '/usr/local/lib/python2.7/dist-packages/greenlet-0.4.2-py2.7-linux-x86_64.egg',
>>>  '/usr/lib/python2.7',
>>>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>>>  '/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/PILcompat',
>>>  '/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/wx-2.8-gtk2-unicode']
>>>
>>>  Server time: Wed, 18 Mar 2015 16:32:22 +
>>>  Traceback Switch to copy-and-paste view
>>> 
>>>
>>>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
>>>in get_response
>>>1.
>>>
>>>   resolver_match = resolver.resolve(request.path_info)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>>in resolve
>>>1.
>>>
>>>   for pattern in self.url_patterns:
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>>in url_patterns
>>>1.
>>>
>>>   patterns = getattr(self.urlconf_module, "urlpatterns", 
>>> self.urlconf_module)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>>in urlconf_module
>>>1.
>>>
>>>   self._urlconf_module = import_module(self.urlconf_name)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
>>>in import_module
>>>1.
>>>
>>>   __import__(name)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> -
>>>
>>> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/crossfraudet/urls.py
>>>in 
>>>1.
>>>
>>>   url( r'^cdrimport/', include( 'cdrimport.urls' ) ),
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> -
>>>/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py
>>>in include
>>>1.
>>>
>>>   urlconf_module = import_module(urlconf_module)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
>>>in import_module
>>>1.
>>>
>>>   __import__(name)
>>>
>>>   ...
>>> ▶ Local vars
>>>
>>> 
>>> -
>>>
>>> 

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Actually, please listen to Guilherme over me; He seems to have correctly
spotted the omission.

On Wed, Mar 18, 2015 at 11:45 AM, Andrew Farrell 
wrote:

> So it seems like the problem is that you are doing `import http` on line
> 24 of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
> branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py rather
> than `import httplib`. Python2 doesn't have a module in the standard
> library named `http`, only `httplib`.
>
>
> As an aside, if you are connecting to a SOAP service, you might consider
> using requests.py or SUDS
> .
>
>
> On Wed, Mar 18, 2015 at 11:35 AM, Nivin Paul  wrote:
>
>> ImportError at /cdrimport/settings/fraudsummary/disconnect/
>>
>> No module named http
>>
>>  Request Method: GET  Request URL:
>> http://192.168.12.59:8080/cdrimport/settings/fraudsummary/disconnect/?id=3  
>> Django
>> Version: 1.6.4  Exception Type: ImportError  Exception Value:
>>
>> No module named http
>>
>>  Exception Location: 
>> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py
>> in , line 24  Python Executable: /usr/bin/python  Python Version:
>> 2.7.6  Python Path:
>>
>> ['/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet',
>>  
>> '/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg',
>>  
>> '/usr/local/lib/python2.7/dist-packages/greenlet-0.4.2-py2.7-linux-x86_64.egg',
>>  '/usr/lib/python2.7',
>>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>>  '/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/PILcompat',
>>  '/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/wx-2.8-gtk2-unicode']
>>
>>  Server time: Wed, 18 Mar 2015 16:32:22 +
>>  Traceback Switch to copy-and-paste view
>> 
>>
>>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
>>in get_response
>>1.
>>
>>   resolver_match = resolver.resolve(request.path_info)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>in resolve
>>1.
>>
>>   for pattern in self.url_patterns:
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>in url_patterns
>>1.
>>
>>   patterns = getattr(self.urlconf_module, "urlpatterns", 
>> self.urlconf_module)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>>in urlconf_module
>>1.
>>
>>   self._urlconf_module = import_module(self.urlconf_name)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
>>in import_module
>>1.
>>
>>   __import__(name)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> -
>>
>> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/crossfraudet/urls.py
>>in 
>>1.
>>
>>   url( r'^cdrimport/', include( 'cdrimport.urls' ) ),
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py
>>in include
>>1.
>>
>>   urlconf_module = import_module(urlconf_module)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
>>in import_module
>>1.
>>
>>   __import__(name)
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> -
>>
>> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/urls.py
>>in 
>>1.
>>
>>   import views
>>
>>   ...
>> ▶ Local vars
>>
>> 
>> -
>>
>> 

Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
So it seems like the problem is that you are doing `import http` on line 24
of /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py rather
than `import httplib`. Python2 doesn't have a module in the standard
library named `http`, only `httplib`.


As an aside, if you are connecting to a SOAP service, you might consider
using requests.py or SUDS
.


On Wed, Mar 18, 2015 at 11:35 AM, Nivin Paul  wrote:

> ImportError at /cdrimport/settings/fraudsummary/disconnect/
>
> No module named http
>
>  Request Method: GET  Request URL:
> http://192.168.12.59:8080/cdrimport/settings/fraudsummary/disconnect/?id=3  
> Django
> Version: 1.6.4  Exception Type: ImportError  Exception Value:
>
> No module named http
>
>  Exception Location: 
> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py
> in , line 24  Python Executable: /usr/bin/python  Python Version:
> 2.7.6  Python Path:
>
> ['/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet',
>  '/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg',
>  
> '/usr/local/lib/python2.7/dist-packages/greenlet-0.4.2-py2.7-linux-x86_64.egg',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/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/PILcompat',
>  '/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/wx-2.8-gtk2-unicode']
>
>  Server time: Wed, 18 Mar 2015 16:32:22 +
>  Traceback Switch to copy-and-paste view
> 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
>in get_response
>1.
>
>   resolver_match = resolver.resolve(request.path_info)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in resolve
>1.
>
>   for pattern in self.url_patterns:
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in url_patterns
>1.
>
>   patterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in urlconf_module
>1.
>
>   self._urlconf_module = import_module(self.urlconf_name)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
> ▶ Local vars
>
> 
> -
>
> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/crossfraudet/urls.py
>in 
>1.
>
>   url( r'^cdrimport/', include( 'cdrimport.urls' ) ),
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py
>in include
>1.
>
>   urlconf_module = import_module(urlconf_module)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
> ▶ Local vars
>
> 
> -
>
> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/urls.py
>in 
>1.
>
>   import views
>
>   ...
> ▶ Local vars
>
> 
> -
>
> /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/__init__.py
>in 
>1.
>
>   from fraud_summary_view import FraudSummaryListView, 
> FraudDetectionListView, Fraudblock, Frauddisconnect
>
>   ...
> ▶ Local vars
>
> 

Re: Import error - No module named http

2015-03-18 Thread Guilherme Leal
Nivin and Shinto,

You are forgetting to instantiate the HTTPConnection object:

Exemple:


*import httplib*

*from xml.dom import minidom*

*http = httplib.HTTPConnection("http://mydomain.com ")*
*http.request("POST", "/path/to/my/webservice", body=xml, headers = {*
*"Host": "myservername",*
*"Content-Type": "text/xml; charset=UTF-8",*
*"Content-Length": len(xml)*
*})*

*print minidom.parseString(http.getresponse().read())*




Em qua, 18 de mar de 2015 às 13:35, Nivin Paul 
escreveu:

ImportError at /cdrimport/settings/fraudsummary/disconnect/
>
> No module named http
>
>  Request Method: GET  Request URL: http://192.168.12.59:8080/
> cdrimport/settings/fraudsummary/disconnect/?id=3  Django Version: 1.6.4  
> Exception
> Type: ImportError  Exception Value:
>
> No module named http
>
>  Exception Location: /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
> branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py in
> , line 24  Python Executable: /usr/bin/python  Python Version:
> 2.7.6  Python Path:
>
> ['/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet',
>  '/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg',
>  
> '/usr/local/lib/python2.7/dist-packages/greenlet-0.4.2-py2.7-linux-x86_64.egg',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/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/PILcompat',
>  '/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/wx-2.8-gtk2-unicode']
>
>  Server time: Wed, 18 Mar 2015 16:32:22 +
>  Traceback Switch to copy-and-paste view
> 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
>in get_response
>1.
>
>   resolver_match = resolver.resolve(request.path_info)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in resolve
>1.
>
>   for pattern in self.url_patterns:
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in url_patterns
>1.
>
>   patterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
>in urlconf_module
>1.
>
>   self._urlconf_module = import_module(self.urlconf_name)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
> ▶ Local vars
>
> 
> - /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
>branches/V2.1.0/crossfraudet/crossfraudet/urls.py in 
>1.
>
>   url( r'^cdrimport/', include( 'cdrimport.urls' ) ),
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py
>in include
>1.
>
>   urlconf_module = import_module(urlconf_module)
>
>   ...
> ▶ Local vars
>
> 
> - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
> ▶ Local vars
>
> 
> - /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
>branches/V2.1.0/crossfraudet/cdrimport/urls.py in 
>1.
>
>   import views
>
>   ...
> ▶ Local vars
>
> 
> - /home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/
>branches/V2.1.0/crossfraudet/cdrimport/views/__init__.py in 
>1.
>
>   from fraud_summary_view import FraudSummaryListView, 
> FraudDetectionListView, Fraudblock, Frauddisconnect
>
>   ...
> ▶ Local vars
>
> 
> - 

Re: Import error - No module named http

2015-03-18 Thread Nivin Paul
 ImportError at /cdrimport/settings/fraudsummary/disconnect/ 

No module named http

 Request Method: GET  Request URL: 
http://192.168.12.59:8080/cdrimport/settings/fraudsummary/disconnect/?id=3  
Django 
Version: 1.6.4  Exception Type: ImportError  Exception Value: 

No module named http

 Exception Location: 
/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py
 
in , line 24  Python Executable: /usr/bin/python  Python Version: 
2.7.6  Python Path: 

['/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet',
 '/usr/local/lib/python2.7/dist-packages/gevent-1.0.1-py2.7-linux-x86_64.egg',
 '/usr/local/lib/python2.7/dist-packages/greenlet-0.4.2-py2.7-linux-x86_64.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/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/PILcompat',
 '/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/wx-2.8-gtk2-unicode']

 Server time: Wed, 18 Mar 2015 16:32:22 +  
 Traceback Switch to copy-and-paste view 
 

   - /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in 
   get_response 
   1. 
  
  resolver_match = resolver.resolve(request.path_info)
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   resolve 
   1. 
  
  for pattern in self.url_patterns:
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   url_patterns 
   1. 
  
  patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   urlconf_module 
   1. 
  
  self._urlconf_module = import_module(self.urlconf_name)
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in 
   import_module 
   1. 
  
  __import__(name)
  
  ...
▶ Local vars 
   
 
- 
   
/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/crossfraudet/urls.py
 
   in  
   1. 
  
  url( r'^cdrimport/', include( 'cdrimport.urls' ) ),
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py 
   in include 
   1. 
  
  urlconf_module = import_module(urlconf_module)
  
  ...
▶ Local vars 
   
 
- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in 
   import_module 
   1. 
  
  __import__(name)
  
  ...
▶ Local vars 
   
 
- 
   
/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/urls.py
 
   in  
   1. 
  
  import views
  
  ...
▶ Local vars 
   
 
- 
   
/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/__init__.py
 
   in  
   1. 
  
  from fraud_summary_view import FraudSummaryListView, 
FraudDetectionListView, Fraudblock, Frauddisconnect
  
  ...
▶ Local vars 
   
 
- 
   
/home/akhil/Documents/NIVIN/NIVIN/svn/CrossFraudet/branches/V2.1.0/crossfraudet/cdrimport/views/fraud_summary_view.py
 
   in  
   1. 
  
  import http
  
  ...
▶ Local vars 
   
   

On Wednesday, March 18, 2015 at 9:54:40 PM UTC+5:30, Nivin Paul wrote:
>
> I need to call a web service that written using SOAP from a django 
> application , to do that i used the following code but i got error as in 
> the attached screenshot. Please help
>
>
> import httplib
> from xml.dom import minidom
>
> http.request("POST", 

Re: Import error - No module named http

2015-03-18 Thread SHINTO PETER
iam to getting same error 



Traceback (most recent call last):
  File "test_soap.py", line 4, in 
http.request("POST", "/path/to/my/webservice", body=xml, headers = {
NameError: name 'http' is not defined

---

On Wednesday, 18 March 2015 21:54:40 UTC+5:30, Nivin Paul wrote:
>
> I need to call a web service that written using SOAP from a django 
> application , to do that i used the following code but i got error as in 
> the attached screenshot. Please help
>
>
> import httplib
> from xml.dom import minidom
>
> http.request("POST", "/path/to/my/webservice", body=xml, headers = {
> "Host": "myservername",
> "Content-Type": "text/xml; charset=UTF-8",
> "Content-Length": len(xml)
> })
>
> print minidom.parseString(http.getresponse().read())
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/ceeb7793-d801-4022-8b9a-8bf60616248f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import error - No module named http

2015-03-18 Thread Andrew Farrell
Hello Nivin,

Could you please hit the "switch to copy-and-paste view" link at the top of
the tradeback and copy that? The bottom of a traceback is often the most
useful for debugging.
Feel free to paste it or relevant code at github gist
 and send the link if you want to preserve
formatting.

On Wed, Mar 18, 2015 at 11:23 AM, Nivin Paul  wrote:

> I need to call a web service that written using SOAP from a django
> application , to do that i used the following code but i got error as in
> the attached screenshot. Please help
>
>
> import httplib
> from xml.dom import minidom
>
> http.request("POST", "/path/to/my/webservice", body=xml, headers = {
> "Host": "myservername",
> "Content-Type": "text/xml; charset=UTF-8",
> "Content-Length": len(xml)
> })
>
> print minidom.parseString(http.getresponse().read())
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/254af2fd-3406-4b79-a45c-a7c1fffb35d3%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%2By5TLbFCcFOMkx9zfFHZNR6XkkJHBwOar%3DxtjR85HeXzxXE9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import error - No module named http

2015-03-18 Thread Guilherme Leal
you didnt instanciated the HttpConnection Object

Check the docs.

https://docs.python.org/2/library/httplib.html#httpconnection-objects

Em qua, 18 de mar de 2015 às 13:24, Nivin Paul 
escreveu:

> I need to call a web service that written using SOAP from a django
> application , to do that i used the following code but i got error as in
> the attached screenshot. Please help
>
>
> import httplib
> from xml.dom import minidom
>
> http.request("POST", "/path/to/my/webservice", body=xml, headers = {
> "Host": "myservername",
> "Content-Type": "text/xml; charset=UTF-8",
> "Content-Length": len(xml)
> })
>
> print minidom.parseString(http.getresponse().read())
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/254af2fd-3406-4b79-a45c-a7c1fffb35d3%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/CAOs3Lp6yRFDFDgA3jfYkcT8%2BuVq_1qXAVDUdZWUTcN9rTOdovg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import Error Module

2014-11-12 Thread Erik Cederstrand
> Den 12/11/2014 kl. 01.39 skrev Niall :
> 
> Hi Erik, yes it is installed but it comes up with the following error when I 
> try to run the server again.
> 
> I know that it is something simple like changing the PYTHONPATH so if you 
> could advise on why it is happening and how I should proceed that would be 
> great. 

manage.py can't find your settings.py file.

Your project layout is hopefully something like:

-manage.py
-my_project
 |
  - settings.py


In this case, manage.py should contain the line:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'my_project.settings')


Erik

-- 
You received this message because you are subscribed to the Google Groups 
"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/84EBF692-CCF8-4AB3-92A3-5E036B63F3EF%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Import Error Module

2014-11-11 Thread Niall
Hi Erik, yes it is installed but it comes up with the following error when 
I try to run the server again.

I know that it is something simple like changing the PYTHONPATH so if you 
could advise on why it is happening and how I should proceed that would be 
great. 


Nialls-MBP-2:fest-api-master niallconway$ python manage.py

Traceback (most recent call last):

  File "manage.py", line 9, in 

execute_from_command_line(sys.argv)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 385, in execute_from_command_line

utility.execute()

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 345, in execute

settings.INSTALLED_APPS

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 46, in __getattr__

self._setup(name)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 42, in _setup

self._wrapped = Settings(settings_module)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 98, in __init__

% (self.SETTINGS_MODULE, e)

ImportError: Could not import settings 'configs.settings' (Is it on 
sys.path? Is there an import error in the settings file?): No module named 
settings









On Wednesday, 12 November 2014 01:07:19 UTC+10, Erik Cederstrand wrote:
>
> > Den 11/11/2014 kl. 15.48 skrev Niall <conwa...@gmail.com >: 
>
> > 
> > Hello, I was hoping that anyone could please advise me on a very simple 
> issue which I am having regarding running the dev server (see attachments). 
> I am receiving the following import error when attempting to run. 
> > 
> > ImportError: No module named django.core.management 
>
> Do you have django installed? Try running: 
>
> python -c "import django;" 
>
> If not, run "pip install django" 
>
> Erik

-- 
You received this message because you are subscribed to the Google Groups 
"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/eb961a1c-195a-487d-a727-43290b6861e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import Error Module

2014-11-11 Thread Erik Cederstrand
> Den 11/11/2014 kl. 15.48 skrev Niall <conwayni...@gmail.com>:
> 
> Hello, I was hoping that anyone could please advise me on a very simple issue 
> which I am having regarding running the dev server (see attachments). I am 
> receiving the following import error when attempting to run.
> 
> ImportError: No module named django.core.management

Do you have django installed? Try running:

python -c "import django;"

If not, run "pip install django"

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"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/2B51C236-77EA-4724-A4C2-8A34614C39C9%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Import error in settings.py

2014-10-23 Thread Collin Anderson
You can also do this:
import importlib
module_name, name = path.rsplit('.', 1)
return getattr(importlib.import_module(module_name), name)

-- 
You received this message because you are subscribed to the Google Groups 
"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/11e9ba53-9790-42b1-8f23-250ceda86f1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Import error in settings.py

2014-10-22 Thread Felix Unchained
Just thought you might get a kick out of the fact that I just found this 
very useful – 4 years later. Thanks.

On Tuesday, February 12, 2008 7:27:45 PM UTC-8, Julien wrote:
>
> Great! Thanks a lot, it worked! 
>
> Here's a little function that I made and that is quite helpful: 
>
> def get_class(class_path): 
> i = class_path.rfind('.') 
> module_path, class_name = class_path[:i], class_path[i+1:] 
> module = __import__(module_path, globals(), locals(), 
> [class_name]) 
> return getattr(module, class_name) 
>
> Thanks again for your help. That wasn't easy, but that made me visit 
> some parts of Python and Django that I didn't know about. And it does 
> demystify a lot of things! 
>
> On Feb 13, 1:40 pm, Malcolm Tredinnick  
> wrote: 
> > On Tue, 2008-02-12 at 18:30 -0800, Julien wrote: 
> > > Hello, 
> > 
> > > The module was not compiled, because it was the __import__ function 
> > > itself that raised an exception and so didn't have the chance to do 
> > > the compilation. 
> > 
> > > As you've suggested, I tried: 
> > 
> > > klass = __import__("myapp", {}, {}, ['']) 
> > > -> Works, returns  
> > 
> > > klass = __import__("myapp.forms", {}, {}, ['']) 
> > > -> Works, returns , and compiles "forms.pyc"!! 
> > 
> > > klass = __import__("myapp.forms", {}, {}, ['MyModelForm']) 
> > > -> Works, and returns the same thing as above:  
> > 
> > > But, although the module is now compiled, the following still doesn't 
> > > work: 
> > > klass = __import__("myapp.forms.MyModelForm", {}, {}, ['']) 
> > 
> > > For info, MyModelForm is an instance of ModelFormMetaclass. I also 
> > > tried importing another model, still in vain: 
> > > klass = __import__("myapp.models.MyOtherModel", {}, {}, ['']) 
> > 
> > Oh, doh! I'm an idiot. The answer was there all along. 
> > 
> > You can't do "import myapp.models.MyOtherModel", because MyOtherModel 
> > isn't a *module*. It's something inside a module. That's just normal 
> > Python behaviour. 
> > 
> > So you have to do 
> > 
> > module = __import__("myapp.forms", {}, {}, ['MyModelForm']) 
> > 
> > (using either 'MyModelForm' or '' in the last component). Then 
> > 
> > klass = module.MyModelForm 
> > 
> > Of course, in your case, that means splitting off the last dotted piece 
> > of the string to work out the form class. This is exactly what we do in 
> > django.template.loader.find_template_source(), for example, to separate 
> > the template loader function from the model it's contained in. 
> > 
> > I'm so sorry for misleading you for a little while there. Complete brain 
> > failure on my part. But it all makes perfect sense now. 
> > 
> > Regards, 
> > Malcolm 
> > 
> > -- 
> > Depression is merely anger without enthusiasm.
> http://www.pointy-stick.com/blog/

-- 
You received this message because you are subscribed to the Google Groups 
"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/f637d7c0-65ad-4eac-bc33-b6efe2ef5c6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Strange import error with GeoIP

2013-11-18 Thread Karim
Hi all, I have one website that suddenly and often show me an import error.

Django Version: 1.5.5
Exception Type: ImportError
Exception Value
:
cannot import name GeoIP

The GeoIP works if I start a python manage.py shell and in fact the problem
is not always present, it's enough for me reload the page and get the
website working again, but after 3-4 clicks I got the ImportError error
again.

The site in on apache/ubunt 13.04 on a digitalocean server. I worked in the
same server in a virtualenv during the development, but when I deployed I
got this strange error.

The GeoIP is called on a view that is triggered when a submit button is
pressed than GeoIP isn't involved during the home page loading-

What I did until now:

   - Upgraded to django 1.5.5 (I used on the development the 1.5.1)
   - Deleted all .pyc
   - Check the module on the shell
   - Installed the geoip C libs

Anyone can help me to solve this problem? Thanks in advance

-- 
Karim Gorjux

-- 
You received this message because you are subscribed to the Google Groups 
"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/CACeuRGU%3DNpjTSt5Otk-qZSwDgX%2BhR1pk51Xz07Ax5-R-L91yBg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Import Error: cannot import name timezone

2013-08-25 Thread Robin Lery
Good to hear that!


On Sun, Aug 25, 2013 at 7:19 AM, Patrick Larmann  wrote:

> Thanks fixed it?
>
>
> On Saturday, August 24, 2013 5:45:47 PM UTC-4, Robin Lery wrote:
>
>> It should be
>> 'from django.utils import timezone'
>> and not
>> 'from django.db.utils import timezone'
>>
>>
>> On Sun, Aug 25, 2013 at 2:58 AM, Patrick Larmann 
>> wrote:
>>
>>> He Guys,
>>> I am currently completing part 1 of the django tutorial and having
>>> trouble with getting on of the modules correctly set up.
>>> I attached my output and my moduls.py file.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@**googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"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: Import Error: cannot import name timezone

2013-08-24 Thread Patrick Larmann
Thanks fixed it?

On Saturday, August 24, 2013 5:45:47 PM UTC-4, Robin Lery wrote:
>
> It should be
> 'from django.utils import timezone'
> and not 
> 'from django.db.utils import timezone'
>
>
> On Sun, Aug 25, 2013 at 2:58 AM, Patrick Larmann 
>  > wrote:
>
>> He Guys,
>> I am currently completing part 1 of the django tutorial and having 
>> trouble with getting on of the modules correctly set up.
>> I attached my output and my moduls.py file.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

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


Re: Import Error: cannot import name timezone

2013-08-24 Thread Robin Lery
It should be
'from django.utils import timezone'
and not
'from django.db.utils import timezone'


On Sun, Aug 25, 2013 at 2:58 AM, Patrick Larmann  wrote:

> He Guys,
> I am currently completing part 1 of the django tutorial and having trouble
> with getting on of the modules correctly set up.
> I attached my output and my moduls.py file.
>
> --
> You received this message because you are subscribed to the Google Groups
> "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: Django import error (Please reply soon)

2013-06-20 Thread Jacky Tian
Add 'myapp' to your INSTALLED_APPS in settings.py, right now Django doesn't 
know that myapp is an existing package.

On Thursday, June 20, 2013 3:06:12 AM UTC-4, sanju wrote:
>
>
>
> Hi I have problems with import error in django. Tried looking 
>
> into all possible solutions in Google, but in vain.I am posting my files 
>
> here.Please look into it and correct it as soon as possible.Thanks in 
> Advance!
>
> This is my hierarchy:
> c:/Users/Sanju/
>
> mysite
>-myapp
>  -> _init_.py
>  -> models.py
>  -> views.py
>  -> test.py
>-mysite 
>  -> settings.py
>  -> urls.py
>  -> wsgi.py
>-manage.py
>
> Contents of manage.py
>
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", 
>
> "mysite.settings")
>
> from django.core.management import 
>
> execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
> sys.path.insert(0,'C:\Users\Sanju\mysite' )
>
>
> Contents of settings.py
>
> # Django settings for mysite project.
>
> 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': 'mydemodb',  # Or path to database 
>
> file if using sqlite3.
> # The following settings are not used with sqlite3:
> 'USER': 'root',
> 'PASSWORD': '',
> 'HOST': '',  # Empty for localhost through 
>
> domain sockets or '127.0.0.1' for localhost through TCP.
> 'PORT': '',  # Set to empty string for default.
> }
> }
>
> # Hosts/domain names that are valid for this site; required if 
>
> DEBUG is False
> # See 
>
> https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-
>
> hosts
> ALLOWED_HOSTS = []
>
> # 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 = 'America/Chicago'
>
> # 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: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make 
>
> sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/;, 
>
> "http://media.example.com/;
> 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: "/var/www/example.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://example.com/static/;, 
>
> "http://static.example.com/;
> 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 = 'w07((nih+vm%^j1i$t3ewrrt*)!+%odi
>
> $_&4=w5'
>
&

Re: Django import error (Please reply soon)

2013-06-20 Thread abhijeet shete
Hi Sanju,

Whenever you create any app in django you need to add that app's name
under INSTALLED_APPS in settings.py file. It looks like you commented that
line on which you added the name of app(myapp) under INSTALLED_APPS in your
settings file. Uncomment that line and then try again hope it will work.


> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
>* #'mysite.myapp',*
> )
>
>

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.




Re: Django import error (Please reply soon)

2013-06-20 Thread Gabriel
What is the command you're trying to run, and where in the file tree are
you when you do it?

- Gabe


On Thu, Jun 20, 2013 at 4:06 AM, sanju <sayhellosa...@yahoo.com> wrote:

>
>
> Hi I have problems with import error in django. Tried looking
>
> into all possible solutions in Google, but in vain.I am posting my files
>
> here.Please look into it and correct it as soon as possible.Thanks in
> Advance!
>
> This is my hierarchy:
> c:/Users/Sanju/
>
> mysite
>-myapp
>  -> _init_.py
>  -> models.py
>  -> views.py
>  -> test.py
>-mysite
>  -> settings.py
>  -> urls.py
>  -> wsgi.py
>-manage.py
>
> Contents of manage.py
>
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE",
>
> "mysite.settings")
>
> from django.core.management import
>
> execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
> sys.path.insert(0,'C:\Users\Sanju\mysite' )
>
>
> Contents of settings.py
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add
>
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'mydemodb',  # Or path to database
>
> file if using sqlite3.
> # The following settings are not used with sqlite3:
> 'USER': 'root',
> 'PASSWORD': '',
> 'HOST': '',  # Empty for localhost through
>
> domain sockets or '127.0.0.1' for localhost through TCP.
> 'PORT': '',  # Set to empty string for default.
> }
> }
>
> # Hosts/domain names that are valid for this site; required if
>
> DEBUG is False
> # See
>
> https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-
>
> hosts
> ALLOWED_HOSTS = []
>
> # 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 = 'America/Chicago'
>
> # 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: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make
>
> sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/;,
>
> "http://media.example.com/;
> 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: "/var/www/example.com/static/"
> STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://example.com/static/;,
>
> "http://static.example.com/;
> 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 = 'w07((nih+vm%^j1i$t3ewrrt*)!+%odi
>
> $_&4=w5'
&g

Django import error (Please reply soon)

2013-06-20 Thread sanju


Hi I have problems with import error in django. Tried looking 

into all possible solutions in Google, but in vain.I am posting my files 

here.Please look into it and correct it as soon as possible.Thanks in 
Advance!

This is my hierarchy:
c:/Users/Sanju/

mysite
   -myapp
 -> _init_.py
 -> models.py
 -> views.py
 -> test.py
   -mysite 
 -> settings.py
 -> urls.py
 -> wsgi.py
   -manage.py

Contents of manage.py

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", 

"mysite.settings")

from django.core.management import 

execute_from_command_line

execute_from_command_line(sys.argv)

sys.path.insert(0,'C:\Users\Sanju\mysite' )


Contents of settings.py

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

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

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 

'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mydemodb',  # Or path to database 

file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'root',
'PASSWORD': '',
'HOST': '',  # Empty for localhost through 

domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '',  # Set to empty string for default.
}
}

# Hosts/domain names that are valid for this site; required if 

DEBUG is False
# See 

https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-

hosts
ALLOWED_HOSTS = []

# 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 = 'America/Chicago'

# 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: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make 

sure to use a
# trailing slash.
# Examples: "http://example.com/media/;, 

"http://media.example.com/;
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: "/var/www/example.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://example.com/static/;, 

"http://static.example.com/;
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 = 'w07((nih+vm%^j1i$t3ewrrt*)!+%odi

$_&4=w5'

# 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 = 'mysite.urls'

# Python dotted path to the WSGI application used by Django's 

runserver.
WSGI_APPLICATION = 'mysite.wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or 

"C:/www/django/templates".
# Always u

Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread Martin J. Laubach

>
> return getpass.getuser().decode(locale.getdefaultlocale()[1])
> TypeError: decode() argument 1 must be string, not None
>

  It needs a valid locale to be set in the environment. Try setting 
LC_ALL=en_US before running syncdb.

mjl

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread lucien
Hi,

I have done that:

 python ./manage.py shell
 >>> from django.contrib.auth.models import User
 >>> user = User.objects.create_user(username='foo', email="",  
password="")
 >>> user.is_superuser=True
 >>> user.save
 >>> user.get_all_permissions()

Thanks,
Lucien


Le jeudi 21 février 2013 15:45:18 UTC+1, ke1g a écrit :
>
> One workaround would be to forgo creation at syncdb time and use the 
> manage.py shell to create a user, set its superuser boolean, and save it.
>
> On Thu, Feb 21, 2013 at 9:40 AM, lucien  > wrote:
>
>> Hi,
>>
>> Thanks for your quick answer, I removed the 1.4.4 version and it works 
>> but when I answer yes to define sperusers I got an error,
>> is there any workaround to create a superuser ?
>>
>> You just installed Django's auth system, which means you don't have any 
>> superusers defined.
>> Would you like to create one now? (yes/no): yes
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
>> line 443, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
>> line 382, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
>> line 196, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
>> line 232, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
>> line 371, in handle
>> return self.handle_noargs(**options)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/commands/syncdb.py",
>>  
>> line 110, in handle_noargs
>> emit_post_sync_signal(created_models, verbosity, interactive, db)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/sql.py", 
>> line 189, in emit_post_sync_signal
>> interactive=interactive, db=db)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/dispatch/dispatcher.py", 
>> line 172, in send
>> response = receiver(signal=self, sender=sender, **named)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
>>  
>> line 73, in create_superuser
>> call_command("createsuperuser", interactive=True, database=db)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
>> line 150, in call_command
>> return klass.execute(*args, **defaults)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
>> line 232, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py",
>>  
>> line 70, in handle
>> default_username = get_default_username()
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
>>  
>> line 105, in get_default_username
>> default_username = get_system_username()
>>   File 
>> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
>>  
>> line 85, in get_system_username
>> return getpass.getuser().decode(locale.getdefaultlocale()[1])
>> TypeError: decode() argument 1 must be string, not None
>>
>>
>>
>>
>>
>> Le jeudi 21 février 2013 15:20:01 UTC+1, Karen Tracey a écrit :
>>>
>>> On Thu, Feb 21, 2013 at 9:09 AM, lucien  wrote:
>>>
 Hi,

 I tried the 1.4.5 because I got the same error with ubuntu and postgres
 Do you have any idea? 

>>>
>>> Did you remove the 1.4.4 install before installing 1.4.5? 
>>>
>>>
>>>  -- 
>> You received this message because you are subscribed 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread Bill Freeman
One workaround would be to forgo creation at syncdb time and use the
manage.py shell to create a user, set its superuser boolean, and save it.

On Thu, Feb 21, 2013 at 9:40 AM, lucien  wrote:

> Hi,
>
> Thanks for your quick answer, I removed the 1.4.4 version and it works
> but when I answer yes to define sperusers I got an error,
> is there any workaround to create a superuser ?
>
> You just installed Django's auth system, which means you don't have any
> superusers defined.
> Would you like to create one now? (yes/no): yes
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/commands/syncdb.py",
> line 110, in handle_noargs
> emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/sql.py",
> line 189, in emit_post_sync_signal
> interactive=interactive, db=db)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/dispatch/dispatcher.py",
> line 172, in send
> response = receiver(signal=self, sender=sender, **named)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
> line 73, in create_superuser
> call_command("createsuperuser", interactive=True, database=db)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py",
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py",
> line 70, in handle
> default_username = get_default_username()
>   File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
> line 105, in get_default_username
> default_username = get_system_username()
>   File
> "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/management/__init__.py",
> line 85, in get_system_username
> return getpass.getuser().decode(locale.getdefaultlocale()[1])
> TypeError: decode() argument 1 must be string, not None
>
>
>
>
>
> Le jeudi 21 février 2013 15:20:01 UTC+1, Karen Tracey a écrit :
>>
>> On Thu, Feb 21, 2013 at 9:09 AM, lucien  wrote:
>>
>>> Hi,
>>>
>>> I tried the 1.4.5 because I got the same error with ubuntu and postgres
>>> Do you have any idea?
>>>
>>
>> Did you remove the 1.4.4 install before installing 1.4.5?
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread lucien
Hi,

Thanks for your quick answer, I removed the 1.4.4 version and it works 
but when I answer yes to define sperusers I got an error,
is there any workaround to create a superuser ?

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





Le jeudi 21 février 2013 15:20:01 UTC+1, Karen Tracey a écrit :
>
> On Thu, Feb 21, 2013 at 9:09 AM, lucien  > wrote:
>
>> Hi,
>>
>> I tried the 1.4.5 because I got the same error with ubuntu and postgres
>> Do you have any idea? 
>>
>
> Did you remove the 1.4.4 install before installing 1.4.5? 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread Karen Tracey
On Thu, Feb 21, 2013 at 9:09 AM, lucien  wrote:

> Hi,
>
> I tried the 1.4.5 because I got the same error with ubuntu and postgres
> Do you have any idea?
>

Did you remove the 1.4.4 install before installing 1.4.5?

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread lucien
Hi,

I tried the 1.4.5 because I got the same error with ubuntu and postgres
Do you have any idea? 

Regards,
Lucien


python -c "import django; print(django.get_version())"
1.4.5

 python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", 
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", 
line 371, in handle
return self.handle_noargs(**options)
  File 
"/usr/local/lib/python2.6/dist-packages/django/core/management/commands/syncdb.py",
 
line 40, in handle_noargs
import_module('.management', app_name)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", 
line 35, in import_module
__import__(name)
ImportError: Bad magic number in 
/usr/local/lib/python2.6/dist-packages/django/contrib/sessions/management/__init__.pyc

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread Xavier Ordoquy
Hi,

You should consider upgrading to 1.4.5 which fixes that issue.

Best regards,
Xavier

Le 21 févr. 2013 à 09:00, Frank Bieniek  a 
écrit :

> Hi,
> we are using jenkins to build our django stack,
> we changed the django version from 1.4.3 to 1.4.4.
> this results in a
> 
> ImportError: Bad magic number in 
> /x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/contrib/sessions/management/__init__.pyc
> 
> Even deleting all pyc files does not solve the problem.
> We are using python 2.5 on solaris.
> 
> Any suggestion would help, digging the net has not shown fix, beside delete 
> pyc files.
> 
> The same problem appears on another project updating from 1.3.5 to 1.3.6
> 
> Thanks
> Frank
> 
> Traceback below
> 
> 
> Creating test database for alias 'default'...
> Traceback (most recent call last):
>  File "/x86build/dpp/opt/django-auth/authhub/manage.py", line 24, in 
>execute_manager(settings)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
>  line 459, in execute_manager
>utility.execute()
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
>  line 382, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
>  line 196, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
>  line 232, in execute
>output = self.handle(*args, **options)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django_jenkins/management/commands/__init__.py",
>  line 81, in handle
>if test_runner.run_tests(test_labels):
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/test/simple.py",
>  line 381, in run_tests
>old_config = self.setup_databases()
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django_jenkins/runner.py",
>  line 260, in setup_databases
>return super(CITestSuiteRunner, self).setup_databases()
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/test/simple.py",
>  line 317, in setup_databases
>self.verbosity, autoclobber=not self.interactive)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/db/backends/creation.py",
>  line 271, in create_test_db
>load_initial_data=False)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
>  line 150, in call_command
>return klass.execute(*args, **defaults)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
>  line 232, in execute
>output = self.handle(*args, **options)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
>  line 371, in handle
>return self.handle_noargs(**options)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/commands/syncdb.py",
>  line 40, in handle_noargs
>import_module('.management', app_name)
>  File 
> "/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/utils/importlib.py",
>  line 35, in import_module
>__import__(name)
> ImportError: Bad magic number in 
> /x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/contrib/sessions/management/__init__.pyc
> 
> Fatal error: local() encountered an error (return code 1) while executing '. 
> /x86build/dpp/opt/django-auth-venv/bin/activate && python 
> /x86build/dpp/opt/django-auth/authhub/manage.py jenkins'
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django 1.4.3 to 1.4.4 upgrade fails - Bad magic number Import Error

2013-02-21 Thread Frank Bieniek

Hi,
we are using jenkins to build our django stack,
we changed the django version from 1.4.3 to 1.4.4.
this results in a

ImportError: Bad magic number in 
/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/contrib/sessions/management/__init__.pyc

Even deleting all pyc files does not solve the problem.
We are using python 2.5 on solaris.

Any suggestion would help, digging the net has not shown fix, beside delete pyc 
files.

The same problem appears on another project updating from 1.3.5 to 1.3.6

Thanks
Frank

Traceback below


Creating test database for alias 'default'...
Traceback (most recent call last):
  File "/x86build/dpp/opt/django-auth/authhub/manage.py", line 24, in 
execute_manager(settings)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
 line 459, in execute_manager
utility.execute()
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
 line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
 line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
 line 232, in execute
output = self.handle(*args, **options)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django_jenkins/management/commands/__init__.py",
 line 81, in handle
if test_runner.run_tests(test_labels):
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/test/simple.py",
 line 381, in run_tests
old_config = self.setup_databases()
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django_jenkins/runner.py",
 line 260, in setup_databases
return super(CITestSuiteRunner, self).setup_databases()
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/test/simple.py",
 line 317, in setup_databases
self.verbosity, autoclobber=not self.interactive)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/db/backends/creation.py",
 line 271, in create_test_db
load_initial_data=False)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/__init__.py",
 line 150, in call_command
return klass.execute(*args, **defaults)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
 line 232, in execute
output = self.handle(*args, **options)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/base.py",
 line 371, in handle
return self.handle_noargs(**options)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/core/management/commands/syncdb.py",
 line 40, in handle_noargs
import_module('.management', app_name)
  File 
"/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/utils/importlib.py",
 line 35, in import_module
__import__(name)
ImportError: Bad magic number in 
/x86build/dpp/opt/django-auth-venv/lib/python2.5/site-packages/django/contrib/sessions/management/__init__.pyc

Fatal error: local() encountered an error (return code 1) while executing '. 
/x86build/dpp/opt/django-auth-venv/bin/activate && python 
/x86build/dpp/opt/django-auth/authhub/manage.py jenkins'



--
You received this message because you are subscribed to the Google Groups "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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Coffin import error while starting django

2013-01-29 Thread nickfarm
We have narrowed this issue down to supervisor.
See the updated info: http://pastebin.ca/2308575

supervisor is installed from the repositories and uses python 2.6
The django app is using a manually compiled version of python 2.7
It seems supervisor interferes with environment variables in some way, 
which confuses django.

Any ideas where to look for a solution?

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Coffin import error while starting django

2013-01-29 Thread nickfarm
We have python / django on the server, using supervisor and gunicorn. Using 
gunicorn we have an import error while starting django: from django.test 
import signals (a line in coffin). If we import from ipython or use import 
django.test.signals we have no problem. See http://pastebin.ca/2308541 for 
details.

Any ideas what might cause this?

-- 
You received this message because you are subscribed to the Google Groups 
"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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Import error

2012-06-25 Thread Derek
Emily

If you are starting a new topic, please start a new thread - and again, as 
per the guidelines for using the mailing list that Cal referred to, the 
more specific your question, the more chance of getting a reply. :)

On Friday, 22 June 2012 17:14:34 UTC+2, Emily N wrote:
>
> Kurtis, Adrian and Daniel,
>
> thank you so much for your help, it actually worked
> I have programmed in java 70% of my life
>
> Now I want to send sms to my users when they sign up
> in the website. There is some package I have seen which looks 
> like it is from an email to the phone. Does it work with messages
> from a website to a phone...
>
> Emily
>
>

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



Re: Import error

2012-06-22 Thread Emily
Kurtis, Adrian and Daniel,

thank you so much for your help, it actually worked
I have programmed in java 70% of my life

Now I want to send sms to my users when they sign up
in the website. There is some package I have seen which looks
like it is from an email to the phone. Does it work with messages
from a website to a phone...

Emily

On Fri, Jun 22, 2012 at 5:58 PM, Kurtis Mullins wrote:

> +1 on pulling the "random_password()" method out of the Class and setting
> it up as a module object.
> I'd still suggest using this sort of an import statement on it, though:
>
> from myproject.myapp.helpers import random_password
>
> Where in this example you'd substitute your Project name with "myproject",
> the app name with "myapp" and the this particular python file with
> "helpers.py".
>
>
> On Fri, Jun 22, 2012 at 10:54 AM, Daniel Roseman wrote:
>
>> On Friday, 22 June 2012 15:49:31 UTC+1, aid wrote:
>>>
>>>
>>> Hi Emily,
>>>
>>> On 22 Jun 2012, at 15:46, Emily wrote:
>>>
>>> > This is the class I created...
>>> >
>>> > import string
>>> > import random
>>> >
>>> > class Helpers:
>>> >
>>> > def random_password():
>>>
>>> Take random_password outside of the Helpers class and you should be OK.
>>>  On the import statement you need to refer to a 'top level object' within
>>> the imported file.  The only top level object you have is the class
>>>  Helpers - which it doens't look like you really need.
>>>
>>> Cheers,
>>>
>>> aid
>>>
>>>
>> +1. Python is not Java. Don't use a class unless you're encapsulating
>> data.
>> --
>> DR.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/eV6jxgDm7cgJ.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Import error

2012-06-22 Thread Kurtis Mullins
+1 on pulling the "random_password()" method out of the Class and setting
it up as a module object.
I'd still suggest using this sort of an import statement on it, though:

from myproject.myapp.helpers import random_password

Where in this example you'd substitute your Project name with "myproject",
the app name with "myapp" and the this particular python file with
"helpers.py".

On Fri, Jun 22, 2012 at 10:54 AM, Daniel Roseman wrote:

> On Friday, 22 June 2012 15:49:31 UTC+1, aid wrote:
>>
>>
>> Hi Emily,
>>
>> On 22 Jun 2012, at 15:46, Emily wrote:
>>
>> > This is the class I created...
>> >
>> > import string
>> > import random
>> >
>> > class Helpers:
>> >
>> > def random_password():
>>
>> Take random_password outside of the Helpers class and you should be OK.
>>  On the import statement you need to refer to a 'top level object' within
>> the imported file.  The only top level object you have is the class
>>  Helpers - which it doens't look like you really need.
>>
>> Cheers,
>>
>> aid
>>
>>
> +1. Python is not Java. Don't use a class unless you're encapsulating data.
> --
> DR.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/eV6jxgDm7cgJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Import error

2012-06-22 Thread Daniel Roseman
On Friday, 22 June 2012 15:49:31 UTC+1, aid wrote:
>
>
> Hi Emily, 
>
> On 22 Jun 2012, at 15:46, Emily wrote: 
>
> > This is the class I created... 
> > 
> > import string 
> > import random 
> > 
> > class Helpers: 
> > 
> > def random_password(): 
>
> Take random_password outside of the Helpers class and you should be OK. 
>  On the import statement you need to refer to a 'top level object' within 
> the imported file.  The only top level object you have is the class 
>  Helpers - which it doens't look like you really need. 
>
> Cheers, 
>
> aid 
>
>
+1. Python is not Java. Don't use a class unless you're encapsulating data.
--
DR. 

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



Re: Import error

2012-06-22 Thread Adrian Bool

Hi Emily,

On 22 Jun 2012, at 15:46, Emily wrote:

> This is the class I created...
> 
> import string
> import random
> 
> class Helpers:
> 
> def random_password():

Take random_password outside of the Helpers class and you should be OK.  On the 
import statement you need to refer to a 'top level object' within the imported 
file.  The only top level object you have is the class  Helpers - which it 
doens't look like you really need.

Cheers,

aid

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



Re: Import error

2012-06-22 Thread Emily
This is the class I created...

import string
import random

class Helpers:

def random_password():
'''a method to generate random password'''
lengthOfPassword = random.randint(6,10)
password_len = lengthOfPassword
password = []

for group in (string.ascii_letters, string.punctuation,
string.digits):
password += random.sample(group, 3)

password += random.sample(
 string.ascii_letters + string.punctuation + string.digits,
 password_len - len(password))

random.shuffle(password)
password = ''.join(password)

return password

def sendSMS():
'''a method to send sms to a user'''
pass

On Fri, Jun 22, 2012 at 5:46 PM, Emily  wrote:

> This is the views.py file
>
> from helpers import random_password
> from django.views.generic.edit import CreateView
> from django.views.generic.list import ListView
> from Prototype.forms import StudentForm, LecturerForm, PaymentForm
> from Prototype.models import Guideline, Student, Lecturer, Payment
> from Prototype.models import Course
>
> class GuidelineListView(ListView):
> model = Guideline
> template_name = 'content.html'
> context_object_name = 'guidelines'
>
> class Registration(CreateView):
> model = Student
> form_class = StudentForm
> template_name = "newAccount.html"
> success_url = "/Payment/"
> context_object_name = 'form'
>
> def send_sms(self):
> #send sms
> password = random_password()
>
> def post(self):
> '''generate password and send it to the user.'''
> return Super(Register, self).post()
>
> class NewLecturer(CreateView):
> model = Lecturer
> form_class = LecturerForm
> template_name = "newAccount.html"
> success_url = "/login/"
> context_object_name = 'lecturer_form'
>
> class CourseListView(ListView):
> model = Course
> template_name = 'index.html'
> context_object_name = 'courses'
>
> class Payment(CreateView):
> model = Payment
> form_class = PaymentForm
> template_name = 'Payment.html'
> success_url = "/login/"
> context_object_name = 'payments'
>
>
> On Fri, Jun 22, 2012 at 5:25 PM, Kurtis Mullins 
> wrote:
>
>> Hey emily,
>>
>> I think the other guys were just wanting to see your import statement
>> that's broken. It should be something along these lines if you want to give
>> it a try:
>>
>> from myproject.myapp.myhelpers import random_password
>>
>> Of course you'd substitute your project name, the application name, and
>> then the python file that your "random_password" function/class is saved in.
>>
>> Let me know if you need any more help!
>>
>> Good luck!
>> - Kurtis Mullins
>>
>>
>> On Fri, Jun 22, 2012 at 10:19 AM, Emily  wrote:
>>
>>> so your point is that I should post my code.
>>> When I did that some time, I was told that
>>> the people who were trying to help me did not
>>> want to know what is in my code so I should just
>>> explain what I want them to help me with.
>>> But thank you any way, you point has been driven home.
>>>
>>>
>>> On Fri, Jun 22, 2012 at 3:58 PM, Cal Leeming [Simplicity Media Ltd] <
>>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>>>
 Hi Emily,

 Here is a really good article (written by the very people who
 contribute to this list) on how to ask questions on the mailing list:

 https://code.djangoproject.com/wiki/UsingTheMailingList

 It tells you what you can do to try and resolve the issue yourself, and
 what sort of information you need to provide so we can assist.

 Cal


 On Fri, Jun 22, 2012 at 1:48 PM, Marcin Tustin  wrote:

> Dear Emily,
>
> Do you expect us to already have a copy of your code? If not, we need
> to have a short, self-contained, and correct example demonstrating your
> issue.
>
> Marcin
>
>
> On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:
>
>> Dear Marcin,
>>
>> I do not understand.
>> I think I have done everything right and I am trying to find
>> the source of the error where if there is someone who has
>> experienced it they might be knowing where it is coming from..
>>
>> Emily
>>
>>
>> On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin <
>> marcin.tus...@gmail.com> wrote:
>>
>>> Please take a look at: Short, Self Contained, Correct 
>>> Example
>>>
>>> There's also some good advice at: What have you tried? - Matt
>>> Gemmell 
>>>
>>>
>>> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>>>
 Hi django users,
 I seem to have gotten a problem.

 I created a helper class in my project and I have failed to import

Re: Import error

2012-06-22 Thread Emily
This is the views.py file

from helpers import random_password
from django.views.generic.edit import CreateView
from django.views.generic.list import ListView
from Prototype.forms import StudentForm, LecturerForm, PaymentForm
from Prototype.models import Guideline, Student, Lecturer, Payment
from Prototype.models import Course

class GuidelineListView(ListView):
model = Guideline
template_name = 'content.html'
context_object_name = 'guidelines'

class Registration(CreateView):
model = Student
form_class = StudentForm
template_name = "newAccount.html"
success_url = "/Payment/"
context_object_name = 'form'

def send_sms(self):
#send sms
password = random_password()

def post(self):
'''generate password and send it to the user.'''
return Super(Register, self).post()

class NewLecturer(CreateView):
model = Lecturer
form_class = LecturerForm
template_name = "newAccount.html"
success_url = "/login/"
context_object_name = 'lecturer_form'

class CourseListView(ListView):
model = Course
template_name = 'index.html'
context_object_name = 'courses'

class Payment(CreateView):
model = Payment
form_class = PaymentForm
template_name = 'Payment.html'
success_url = "/login/"
context_object_name = 'payments'

On Fri, Jun 22, 2012 at 5:25 PM, Kurtis Mullins wrote:

> Hey emily,
>
> I think the other guys were just wanting to see your import statement
> that's broken. It should be something along these lines if you want to give
> it a try:
>
> from myproject.myapp.myhelpers import random_password
>
> Of course you'd substitute your project name, the application name, and
> then the python file that your "random_password" function/class is saved in.
>
> Let me know if you need any more help!
>
> Good luck!
> - Kurtis Mullins
>
>
> On Fri, Jun 22, 2012 at 10:19 AM, Emily  wrote:
>
>> so your point is that I should post my code.
>> When I did that some time, I was told that
>> the people who were trying to help me did not
>> want to know what is in my code so I should just
>> explain what I want them to help me with.
>> But thank you any way, you point has been driven home.
>>
>>
>> On Fri, Jun 22, 2012 at 3:58 PM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>>
>>> Hi Emily,
>>>
>>> Here is a really good article (written by the very people who contribute
>>> to this list) on how to ask questions on the mailing list:
>>>
>>> https://code.djangoproject.com/wiki/UsingTheMailingList
>>>
>>> It tells you what you can do to try and resolve the issue yourself, and
>>> what sort of information you need to provide so we can assist.
>>>
>>> Cal
>>>
>>>
>>> On Fri, Jun 22, 2012 at 1:48 PM, Marcin Tustin 
>>> wrote:
>>>
 Dear Emily,

 Do you expect us to already have a copy of your code? If not, we need
 to have a short, self-contained, and correct example demonstrating your
 issue.

 Marcin


 On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:

> Dear Marcin,
>
> I do not understand.
> I think I have done everything right and I am trying to find
> the source of the error where if there is someone who has
> experienced it they might be knowing where it is coming from..
>
> Emily
>
>
> On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin <
> marcin.tus...@gmail.com> wrote:
>
>> Please take a look at: Short, Self Contained, Correct 
>> Example
>>
>> There's also some good advice at: What have you tried? - Matt 
>> Gemmell
>>
>>
>> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>>
>>> Hi django users,
>>> I seem to have gotten a problem.
>>>
>>> I created a helper class in my project and I have failed to import
>>> the methods in it. Please help...
>>>
>>> This is the error I get...
>>>
>>> ImportError at /admin/
>>>
>>> cannot import name random_password
>>>
>>>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
>>> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>>>
>>> cannot import name random_password
>>>
>>>  Exception Location: 
>>> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
>>> in , line 1  Python Executable: /usr/bin/python  Python
>>> Version: 2.7.2  Python Path:
>>>
>>> ['/home/emily/Documents/AskJarvis/Etutor',
>>>  '/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',

Re: Import error

2012-06-22 Thread Kurtis Mullins
Hey emily,

I think the other guys were just wanting to see your import statement
that's broken. It should be something along these lines if you want to give
it a try:

from myproject.myapp.myhelpers import random_password

Of course you'd substitute your project name, the application name, and
then the python file that your "random_password" function/class is saved in.

Let me know if you need any more help!

Good luck!
- Kurtis Mullins

On Fri, Jun 22, 2012 at 10:19 AM, Emily  wrote:

> so your point is that I should post my code.
> When I did that some time, I was told that
> the people who were trying to help me did not
> want to know what is in my code so I should just
> explain what I want them to help me with.
> But thank you any way, you point has been driven home.
>
>
> On Fri, Jun 22, 2012 at 3:58 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Hi Emily,
>>
>> Here is a really good article (written by the very people who contribute
>> to this list) on how to ask questions on the mailing list:
>>
>> https://code.djangoproject.com/wiki/UsingTheMailingList
>>
>> It tells you what you can do to try and resolve the issue yourself, and
>> what sort of information you need to provide so we can assist.
>>
>> Cal
>>
>>
>> On Fri, Jun 22, 2012 at 1:48 PM, Marcin Tustin 
>> wrote:
>>
>>> Dear Emily,
>>>
>>> Do you expect us to already have a copy of your code? If not, we need to
>>> have a short, self-contained, and correct example demonstrating your issue.
>>>
>>> Marcin
>>>
>>>
>>> On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:
>>>
 Dear Marcin,

 I do not understand.
 I think I have done everything right and I am trying to find
 the source of the error where if there is someone who has
 experienced it they might be knowing where it is coming from..

 Emily


 On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin  wrote:

> Please take a look at: Short, Self Contained, Correct 
> Example
>
> There's also some good advice at: What have you tried? - Matt 
> Gemmell
>
>
> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>
>> Hi django users,
>> I seem to have gotten a problem.
>>
>> I created a helper class in my project and I have failed to import
>> the methods in it. Please help...
>>
>> This is the error I get...
>>
>> ImportError at /admin/
>>
>> cannot import name random_password
>>
>>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
>> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>>
>> cannot import name random_password
>>
>>  Exception Location: 
>> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
>> in , line 1  Python Executable: /usr/bin/python  Python
>> Version: 2.7.2  Python Path:
>>
>> ['/home/emily/Documents/AskJarvis/Etutor',
>>  '/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']
>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/C1nnWqPBZkwJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Marcin Tustin
> Tel: 07773 787 105
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> 

Re: Import error

2012-06-22 Thread Emily
so your point is that I should post my code.
When I did that some time, I was told that
the people who were trying to help me did not
want to know what is in my code so I should just
explain what I want them to help me with.
But thank you any way, you point has been driven home.

On Fri, Jun 22, 2012 at 3:58 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi Emily,
>
> Here is a really good article (written by the very people who contribute
> to this list) on how to ask questions on the mailing list:
>
> https://code.djangoproject.com/wiki/UsingTheMailingList
>
> It tells you what you can do to try and resolve the issue yourself, and
> what sort of information you need to provide so we can assist.
>
> Cal
>
>
> On Fri, Jun 22, 2012 at 1:48 PM, Marcin Tustin wrote:
>
>> Dear Emily,
>>
>> Do you expect us to already have a copy of your code? If not, we need to
>> have a short, self-contained, and correct example demonstrating your issue.
>>
>> Marcin
>>
>>
>> On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:
>>
>>> Dear Marcin,
>>>
>>> I do not understand.
>>> I think I have done everything right and I am trying to find
>>> the source of the error where if there is someone who has
>>> experienced it they might be knowing where it is coming from..
>>>
>>> Emily
>>>
>>>
>>> On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin 
>>> wrote:
>>>
 Please take a look at: Short, Self Contained, Correct 
 Example

 There's also some good advice at: What have you tried? - Matt 
 Gemmell


 On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:

> Hi django users,
> I seem to have gotten a problem.
>
> I created a helper class in my project and I have failed to import
> the methods in it. Please help...
>
> This is the error I get...
>
> ImportError at /admin/
>
> cannot import name random_password
>
>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>
> cannot import name random_password
>
>  Exception Location: 
> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
> in , line 1  Python Executable: /usr/bin/python  Python
> Version: 2.7.2  Python Path:
>
> ['/home/emily/Documents/AskJarvis/Etutor',
>  '/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']
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/C1nnWqPBZkwJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



 --
 Marcin Tustin
 Tel: 07773 787 105

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

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

Re: Import error

2012-06-22 Thread Cal Leeming [Simplicity Media Ltd]
Hi Emily,

Here is a really good article (written by the very people who contribute to
this list) on how to ask questions on the mailing list:

https://code.djangoproject.com/wiki/UsingTheMailingList

It tells you what you can do to try and resolve the issue yourself, and
what sort of information you need to provide so we can assist.

Cal


On Fri, Jun 22, 2012 at 1:48 PM, Marcin Tustin wrote:

> Dear Emily,
>
> Do you expect us to already have a copy of your code? If not, we need to
> have a short, self-contained, and correct example demonstrating your issue.
>
> Marcin
>
>
> On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:
>
>> Dear Marcin,
>>
>> I do not understand.
>> I think I have done everything right and I am trying to find
>> the source of the error where if there is someone who has
>> experienced it they might be knowing where it is coming from..
>>
>> Emily
>>
>>
>> On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin 
>> wrote:
>>
>>> Please take a look at: Short, Self Contained, Correct 
>>> Example
>>>
>>> There's also some good advice at: What have you tried? - Matt 
>>> Gemmell
>>>
>>>
>>> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>>>
 Hi django users,
 I seem to have gotten a problem.

 I created a helper class in my project and I have failed to import
 the methods in it. Please help...

 This is the error I get...

 ImportError at /admin/

 cannot import name random_password

  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
 Version: 1.3.1  Exception Type: ImportError  Exception Value:

 cannot import name random_password

  Exception Location: 
 /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
 in , line 1  Python Executable: /usr/bin/python  Python
 Version: 2.7.2  Python Path:

 ['/home/emily/Documents/AskJarvis/Etutor',
  '/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']


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

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

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



Re: Import error

2012-06-22 Thread Marcin Tustin
Dear Emily,

Do you expect us to already have a copy of your code? If not, we need to
have a short, self-contained, and correct example demonstrating your issue.

Marcin

On Fri, Jun 22, 2012 at 8:43 AM, Emily  wrote:

> Dear Marcin,
>
> I do not understand.
> I think I have done everything right and I am trying to find
> the source of the error where if there is someone who has
> experienced it they might be knowing where it is coming from..
>
> Emily
>
>
> On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin wrote:
>
>> Please take a look at: Short, Self Contained, Correct 
>> Example
>>
>> There's also some good advice at: What have you tried? - Matt 
>> Gemmell
>>
>>
>> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>>
>>> Hi django users,
>>> I seem to have gotten a problem.
>>>
>>> I created a helper class in my project and I have failed to import
>>> the methods in it. Please help...
>>>
>>> This is the error I get...
>>>
>>> ImportError at /admin/
>>>
>>> cannot import name random_password
>>>
>>>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
>>> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>>>
>>> cannot import name random_password
>>>
>>>  Exception Location: 
>>> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
>>> in , line 1  Python Executable: /usr/bin/python  Python Version:
>>> 2.7.2  Python Path:
>>>
>>> ['/home/emily/Documents/AskJarvis/Etutor',
>>>  '/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']
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/C1nnWqPBZkwJ.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: 07773 787 105

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



Re: Import error

2012-06-22 Thread Emily
Dear Marcin,

I do not understand.
I think I have done everything right and I am trying to find
the source of the error where if there is someone who has
experienced it they might be knowing where it is coming from..

Emily

On Fri, Jun 22, 2012 at 3:27 PM, Marcin Tustin wrote:

> Please take a look at: Short, Self Contained, Correct 
> Example
>
> There's also some good advice at: What have you tried? - Matt 
> Gemmell
>
>
> On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:
>
>> Hi django users,
>> I seem to have gotten a problem.
>>
>> I created a helper class in my project and I have failed to import
>> the methods in it. Please help...
>>
>> This is the error I get...
>>
>> ImportError at /admin/
>>
>> cannot import name random_password
>>
>>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
>> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>>
>> cannot import name random_password
>>
>>  Exception Location: 
>> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
>> in , line 1  Python Executable: /usr/bin/python  Python Version:
>> 2.7.2  Python Path:
>>
>> ['/home/emily/Documents/AskJarvis/Etutor',
>>  '/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']
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/C1nnWqPBZkwJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Marcin Tustin
> Tel: 07773 787 105
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Import error

2012-06-22 Thread Marcin Tustin
Please take a look at: Short, Self Contained, Correct Example

There's also some good advice at: What have you tried? - Matt
Gemmell

On Fri, Jun 22, 2012 at 8:10 AM, Emily N  wrote:

> Hi django users,
> I seem to have gotten a problem.
>
> I created a helper class in my project and I have failed to import
> the methods in it. Please help...
>
> This is the error I get...
>
> ImportError at /admin/
>
> cannot import name random_password
>
>  Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django
> Version: 1.3.1  Exception Type: ImportError  Exception Value:
>
> cannot import name random_password
>
>  Exception Location: 
> /home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py
> in , line 1  Python Executable: /usr/bin/python  Python Version:
> 2.7.2  Python Path:
>
> ['/home/emily/Documents/AskJarvis/Etutor',
>  '/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']
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/C1nnWqPBZkwJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: 07773 787 105

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



Import error

2012-06-22 Thread Emily N
Hi django users,
I seem to have gotten a problem.

I created a helper class in my project and I have failed to import
the methods in it. Please help...

This is the error I get...

ImportError at /admin/ 

cannot import name random_password

 Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django 
Version: 1.3.1  Exception Type: ImportError  Exception Value: 

cannot import name random_password

 Exception Location: 
/home/emily/Documents/AskJarvis/Etutor/../Etutor/Prototype/views.py 
in , line 1  Python Executable: /usr/bin/python  Python Version: 
2.7.2  Python Path: 

['/home/emily/Documents/AskJarvis/Etutor',
 '/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']


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



Re: import error: no model named .....

2012-05-18 Thread doniyor
try this 

urlpattern = patterns(' ',
url('^hello/$,hello),
)


Am Donnerstag, 17. Mai 2012 20:58:23 UTC+2 schrieb Ali Shaikh:
>
> Hey... 
>
>
> I am practicing to implement simple examples in django... 
>
> started project with 
> 1.django-admin.py startproject wikicamp 
> 2.python manage.py startapp wiki 
> 3.editing the setting 
> 4.python manage.py syncdb 
> 5.python mange.py runserver 
>
>  till this stage its working fine:) 
>
>
> But after editing urls.py and views.py ...i run the server 
> again that time its showing this error 
>
> IMMPORTERROR at .// 
>
> NO module named views...:'( 
>
>
>
>
>
> help pls.!!! 
>
> am getting 
>
> ImoprtError at //


Am Donnerstag, 17. Mai 2012 20:58:23 UTC+2 schrieb Ali Shaikh:
>
> Hey... 
>
>
> I am practicing to implement simple examples in django... 
>
> started project with 
> 1.django-admin.py startproject wikicamp 
> 2.python manage.py startapp wiki 
> 3.editing the setting 
> 4.python manage.py syncdb 
> 5.python mange.py runserver 
>
>  till this stage its working fine:) 
>
>
> But after editing urls.py and views.py ...i run the server 
> again that time its showing this error 
>
> IMMPORTERROR at .// 
>
> NO module named views...:'( 
>
>
>
>
>
> help pls.!!! 
>
> am getting 
>
> ImoprtError at //

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



Re: import error: no model named .....

2012-05-17 Thread Apokalyptica Painkiller
Hello i'm not sure but did you edited your module.py?

I'm watching your urls.py and i found this:

('^hello/$,hello),


I'm guessing that there is a syntax mistake, it should be " ('^hello/$',
hello) why don't you try that.

See you

2012/5/17 Tanveer Ali Sha 

> Hi  Apokalyptica Painkiller ,
>
> Here is my urls.py and views.py
>
>
> *URLS.PY*
>
> from django.conf.urls.defaults import*
> from wikicamp.views import hello
>
> urlpattern = patterns(' ',
> ('^hello/$,hello),
> )
>
> *VIEWS.py*
> *
> *
> *from django.http import HttpResponse*
> *
> *
> *def hello(request):*
> * return HttpResponse("hello world")*
>
>
> On Fri, May 18, 2012 at 12:44 AM, Tanveer Ali Sha wrote:
>
>> even am getting *page not found* error
>>
>> 1.^notes/
>> the current URL,didnt match any of these
>>
>>
>>
>> for that wikicamp example which is available in showmedo.com..
>>
>> I donno why I getting these error ...??:(
>>
>>
>> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>>
>>> You should import models into views.py.
>>>
>>> For Example;
>>>
>>> from hdyazi.models import *
>>> from hdmakale.models import *
>>> from hdsayfalar.models import *
>>>
>>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>>
>>> --
>>> *www.halitalptekin.com | Halit Alptekin*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
I live each day
Like it's my last
I live for rock and roll
I never look back

I'm a rocker
Do as I feel as I say
I'm a rocker
And no one can take that away

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



Re: import error: no model named .....

2012-05-17 Thread Nick Legotte
urls.py should look like this

from django.conf.urls.defaults import*
from wikicamp.views import hello

urlpattern = patterns(' ',
('^hello/$',hello),
)


On Thu, May 17, 2012 at 12:23 PM, Tanveer Ali Sha wrote:

> Hi  Apokalyptica Painkiller ,
>
> Here is my urls.py and views.py
>
>
> *URLS.PY*
>
> from django.conf.urls.defaults import*
> from wikicamp.views import hello
>
> urlpattern = patterns(' ',
> ('^hello/$,hello),
> )
>
> *VIEWS.py*
> *
> *
> *from django.http import HttpResponse*
> *
> *
> *def hello(request):*
> * return HttpResponse("hello world")*
>
>
> On Fri, May 18, 2012 at 12:44 AM, Tanveer Ali Sha wrote:
>
>> even am getting *page not found* error
>>
>> 1.^notes/
>> the current URL,didnt match any of these
>>
>>
>>
>> for that wikicamp example which is available in showmedo.com..
>>
>> I donno why I getting these error ...??:(
>>
>>
>> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>>
>>> You should import models into views.py.
>>>
>>> For Example;
>>>
>>> from hdyazi.models import *
>>> from hdmakale.models import *
>>> from hdsayfalar.models import *
>>>
>>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>>
>>> --
>>> *www.halitalptekin.com | Halit Alptekin*
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: import error: no model named .....

2012-05-17 Thread Tanveer Ali Sha
Hi  Apokalyptica Painkiller ,

Here is my urls.py and views.py


*URLS.PY*

from django.conf.urls.defaults import*
from wikicamp.views import hello

urlpattern = patterns(' ',
('^hello/$,hello),
)

*VIEWS.py*
*
*
*from django.http import HttpResponse*
*
*
*def hello(request):*
* return HttpResponse("hello world")*


On Fri, May 18, 2012 at 12:44 AM, Tanveer Ali Sha wrote:

> even am getting *page not found* error
>
> 1.^notes/
> the current URL,didnt match any of these
>
>
>
> for that wikicamp example which is available in showmedo.com..
>
> I donno why I getting these error ...??:(
>
>
> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>
>> You should import models into views.py.
>>
>> For Example;
>>
>> from hdyazi.models import *
>> from hdmakale.models import *
>> from hdsayfalar.models import *
>>
>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>
>> --
>> *www.halitalptekin.com | Halit Alptekin*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>

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



Re: import error: no model named .....

2012-05-17 Thread Andre Terra
Everyone, please follow these guidelines before asking other questions:

https://code.djangoproject.com/wiki/UsingTheMailingList



Cheers,
AT

On Thu, May 17, 2012 at 4:14 PM, Tanveer Ali Sha wrote:

> even am getting *page not found* error
>
> 1.^notes/
> the current URL,didnt match any of these
>
>
>
> for that wikicamp example which is available in showmedo.com..
>
> I donno why I getting these error ...??:(
>
>
> On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin wrote:
>
>> You should import models into views.py.
>>
>> For Example;
>>
>> from hdyazi.models import *
>> from hdmakale.models import *
>> from hdsayfalar.models import *
>>
>> My models' names are hdyazi,mdmakale,hdsayfalar ...
>>
>> --
>> *www.halitalptekin.com | Halit Alptekin*
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: import error: no model named .....

2012-05-17 Thread Tanveer Ali Sha
even am getting *page not found* error

1.^notes/
the current URL,didnt match any of these



for that wikicamp example which is available in showmedo.com..

I donno why I getting these error ...??:(


On Fri, May 18, 2012 at 12:32 AM, Halit Alptekin  wrote:

> You should import models into views.py.
>
> For Example;
>
> from hdyazi.models import *
> from hdmakale.models import *
> from hdsayfalar.models import *
>
> My models' names are hdyazi,mdmakale,hdsayfalar ...
>
> --
> *www.halitalptekin.com | Halit Alptekin*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: import error: no model named .....

2012-05-17 Thread Halit Alptekin
You should import models into views.py.

For Example;

from hdyazi.models import *
from hdmakale.models import *
from hdsayfalar.models import *

My models' names are hdyazi,mdmakale,hdsayfalar ...

-- 
*www.halitalptekin.com | Halit Alptekin*

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



Re: import error: no model named .....

2012-05-17 Thread Apokalyptica Painkiller
Hello, can you show us your views.py and urls.py?

See you

2012/5/17 Ali Shaikh 

> Hey...
>
>
> I am practicing to implement simple examples in django...
>
> started project with
> 1.django-admin.py startproject wikicamp
> 2.python manage.py startapp wiki
> 3.editing the setting
> 4.python manage.py syncdb
> 5.python mange.py runserver
>
>  till this stage its working fine:)
>
>
> But after editing urls.py and views.py ...i run the server
> again that time its showing this error
>
> IMMPORTERROR at .//
>
> NO module named views...:'(
>
>
>
>
>
> help pls.!!!
>
> am getting
>
> ImoprtError at //
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
I live each day
Like it's my last
I live for rock and roll
I never look back

I'm a rocker
Do as I feel as I say
I'm a rocker
And no one can take that away

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



Re: import error: no model named .....

2012-05-17 Thread Nick Legotte
Copy and paste the stacktrace
On May 17, 2012 11:58 AM, "Ali Shaikh"  wrote:

> Hey...
>
>
> I am practicing to implement simple examples in django...
>
> started project with
> 1.django-admin.py startproject wikicamp
> 2.python manage.py startapp wiki
> 3.editing the setting
> 4.python manage.py syncdb
> 5.python mange.py runserver
>
>  till this stage its working fine:)
>
>
> But after editing urls.py and views.py ...i run the server
> again that time its showing this error
>
> IMMPORTERROR at .//
>
> NO module named views...:'(
>
>
>
>
>
> help pls.!!!
>
> am getting
>
> ImoprtError at //
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



import error: no model named .....

2012-05-17 Thread Ali Shaikh
Hey...


I am practicing to implement simple examples in django...

started project with
1.django-admin.py startproject wikicamp
2.python manage.py startapp wiki
3.editing the setting
4.python manage.py syncdb
5.python mange.py runserver

 till this stage its working fine:)


But after editing urls.py and views.py ...i run the server
again that time its showing this error

IMMPORTERROR at .//

NO module named views...:'(





help pls.!!!

am getting

ImoprtError at //

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



jython django install - django import error

2012-02-29 Thread andzsinszan
Hi,
I have problems installing django for jyhton.
I followed instructions on the django / django-jython site, but can't
import django from jython.

Jython 2.5.3b1
django_jython-1.3.0b2

### INSTALLATION
# after
#  - installing jython
#  - adding JYTHON_DIR/bin to path:
> jython pip install django-jython

...installs fine


### USE
> jython
Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02)
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_26
Type "help", "copyright", "credits" or "license" for more information.

>>> import doj
>>> import django
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django

***
importing 'doj' works fine though. But there is no 'django'.
I tried to put pyhon's django to JYTHONPATH:
/usr/local/lib/python2.7/dist-packages/django

Still no luck.

Do I miss something?
Otherwise django on python seems to work fine.



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



Re: import error

2012-02-22 Thread Sébastien Billion
Hi,

I didn't know this tip! Shame on me.
Thanks for this

2012/2/22 dummyman dummyman 

> Hi i fixed the error . I didnt add the parent directory of project to
> sys.path.append in the standalone script thanks
>
>
> On Wed, Feb 22, 2012 at 10:35 AM, kalyani ram wrote:
>
>> every time you import something, plz done forget to include that in
>> installed_apps. this mostly solves the import errors and
>> templatedoesnotexist errors problem
>>
>> On Feb 21, 2:28 pm, dummyman efiles and directories securely between
>> remote hosts without starting an FTP session or logging into the remote
>> systems explicitly. The scp command uses SSH to transfer data, so it
>> requires a password or passphrase for authentication. Unlike rcp or FTP,
>> scp encrypts both the file and any passwords exchanged so that anyone
>> snooping on the network can't view them.
>>
>> Warning: Be careful when copying between hosts frdummyman <
>> tempo...@gmail.com> wrote:
>> > Hi ,
>> >
>> > I have a django project and a standalone python script . From the view
>> > function, i have invoked the standalone script. I am getting the error
>> ."
>> > No module named 
>> >
>> > this is my code for standalone script
>> >
>> > import os
>> >
>> > os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>> >
>> > from django.conf import settings
>> >
>> > after that i ve imported the app inside this
>> > .
>> >
>> > from mysite.app.models import some
>> > but still i am getting the error no module  named mysite
>> > Please help in finding the reason for the error
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: import error

2012-02-21 Thread dummyman dummyman
Hi i fixed the error . I didnt add the parent directory of project to
sys.path.append in the standalone script thanks


On Wed, Feb 22, 2012 at 10:35 AM, kalyani ram wrote:

> every time you import something, plz done forget to include that in
> installed_apps. this mostly solves the import errors and
> templatedoesnotexist errors problem
>
> On Feb 21, 2:28 pm, dummyman efiles and directories securely between
> remote hosts without starting an FTP session or logging into the remote
> systems explicitly. The scp command uses SSH to transfer data, so it
> requires a password or passphrase for authentication. Unlike rcp or FTP,
> scp encrypts both the file and any passwords exchanged so that anyone
> snooping on the network can't view them.
>
> Warning: Be careful when copying between hosts frdummyman <
> tempo...@gmail.com> wrote:
> > Hi ,
> >
> > I have a django project and a standalone python script . From the view
> > function, i have invoked the standalone script. I am getting the error ."
> > No module named 
> >
> > this is my code for standalone script
> >
> > import os
> >
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
> >
> > from django.conf import settings
> >
> > after that i ve imported the app inside this
> > .
> >
> > from mysite.app.models import some
> > but still i am getting the error no module  named mysite
> > Please help in finding the reason for the error
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: import error

2012-02-21 Thread kalyani ram
every time you import something, plz done forget to include that in
installed_apps. this mostly solves the import errors and
templatedoesnotexist errors problem

On Feb 21, 2:28 pm, dummyman dummyman  wrote:
> Hi ,
>
> I have a django project and a standalone python script . From the view
> function, i have invoked the standalone script. I am getting the error ."
> No module named 
>
> this is my code for standalone script
>
> import os
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>
> from django.conf import settings
>
> after that i ve imported the app inside this
> .
>
> from mysite.app.models import some
> but still i am getting the error no module  named mysite
> Please help in finding the reason for the error

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



Re: import error

2012-02-21 Thread Sébastien Billion
Hi,

You must add 'mysite'' in your INSTALLED_APP list in settings.py

2012/2/21 dummyman dummyman 

> Hi ,
>
> I have a django project and a standalone python script . From the view
> function, i have invoked the standalone script. I am getting the error ."
> No module named 
>
>
>
> this is my code for standalone script
>
> import os
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>
> from django.conf import settings
>
> after that i ve imported the app inside this
> .
>
> from mysite.app.models import some
> but still i am getting the error no module  named mysite
> Please help in finding the reason for the error
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



import error

2012-02-21 Thread dummyman dummyman
Hi ,

I have a django project and a standalone python script . From the view
function, i have invoked the standalone script. I am getting the error ."
No module named 



this is my code for standalone script

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

from django.conf import settings

after that i ve imported the app inside this
.

from mysite.app.models import some
but still i am getting the error no module  named mysite
Please help in finding the reason for the error

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



Re: import error

2012-02-03 Thread Thorsten Sanders
Did you try to add a $ after the last slash for the login, may that 
makes a difference for the url resolver, but dunno, just a wild guess.



Am 03.02.2012 18:39, schrieb Miten:

hi guys,
I am doing simple app for learning.  I created page and then auth
protected but as I added register link to login page it errors out on
import error.  I think its some thing to do with setup since created
new app for registration.  I have shown my setup and setting and
traceback at
http://dpaste.com/697051/
http://dpaste.com/697053/
http://dpaste.com/697144/

please take a look and advice.  I am able to import login from django
shell fine.

Regards,

Miten.



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



import error

2012-02-03 Thread Miten
hi guys,
I am doing simple app for learning.  I created page and then auth
protected but as I added register link to login page it errors out on
import error.  I think its some thing to do with setup since created
new app for registration.  I have shown my setup and setting and
traceback at
http://dpaste.com/697051/
http://dpaste.com/697053/
http://dpaste.com/697144/

please take a look and advice.  I am able to import login from django
shell fine.

Regards,

Miten.

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



Re: Import error when unit testing with django.test.client on django 1.1.1

2011-11-24 Thread Erlendur Hákonarson
Thanks Xavier
I will research this better
but the path for the settings file is wrong in this error, it should be 
'bo.settings' not 'DER.settings'
but that might be because the tests do not have my project in their path

Thanks again
Erlendur

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



  1   2   >