Re: Reverse for 'password_reset_complete' not found

2017-08-24 Thread James Schneider
On Aug 20, 2017 4:47 PM, "ah bor"  wrote:

Hello friends,

I will appreciate it if you can help me resolve the following issue.
I am trying to use the Django built-in views for resetting passwords but
get an error in the very end. I have done the following steps:
1. in URLs.py:

url(r'^password_reset/$', auth_views.password_reset,{'
email_template_name':'registration/password_reset_
email.html','subject_template_name':'registration/password_
reset_subject.txt','post_reset_redirect':'main:password_reset_done','from_
email':'someth...@gmail.com',},name='password_reset'),
url(r'^reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P<
token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',auth_views.
PasswordResetConfirmView.as_view(),{'success_url':'passwordresetcomplete'},


I doubt this success_url will work given the names you show here.




Now here is what happens: when I go to http://127.0.0.1:8000/password_reset/
it asks for an email address. after entering an email for a user it says we
have sent you a link and I see the link in email. when I click on the link,
a page opens and ask for a new password and a password confirmation. When I
hit the submit button, I can see that the password is really changed but
instead of being directed to an html page I get an error. Here it is

NoReverseMatch at /reset/confirm/MQ/set-password/
Reverse for 'password_reset_complete' not found.
'password_reset_complete' is not a valid view function or pattern name.
Request Method: POST
Request URL: http://127.0.0.1:8000/reset/confirm/MQ/set-password/
Django Version: 1.11.2
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'password_reset_complete' not found.
'password_reset_complete' is not a valid view function or pattern name.
Python Version: 2.7.12

Thanks for your help,


Is this your main urls.py file? Can you post up the main one?

I would suspect the success_url issue I pointed out above, but the
erroneous URL name contains underscores. I'm not sure if the built in view
will fall back to the default name (which does contain underscores) if the
given success_url didn't resolve. But even if that were the case, you have
a view with the proper name.

I almost feel like these URL's are not being used at all. The error doesn't
make sense given your listing of URL's.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWV%2BMpWGPBkpqz8yDkb5pB-gx%3DxuCm9GP5%2BOyr-1DwLPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Django with Ingres DB

2017-08-24 Thread James Schneider
On Aug 15, 2017 8:34 AM,  wrote:

Hi

Does anyone know if it's possible to easily use an Ingres database with
Django?

Many thanks

Jim


I don't know/doubt if the Postgres bindings in Python will handle Ingres,
nor am I aware of any 3rd party app that provides support. It isn't
specifically supported by Django, so "easy use" is probably not possible.
More than likely, "use" isn't even possible. Looks like there was work
started for a driver, but that was 10 years ago and appears long dead.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVaXqFcbEfC_i9hsnVtJ6PBP40WMC_jiy%3Dm2hUaQWc-vQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retrieving objects created in trasaction

2017-08-24 Thread Christian Ledermann
On 16 August 2017 at 19:27, roboslone -  wrote:
> Hi,
>
> I have some function (fetcher) that runs in transaction (it has to) and it 
> creates a bunch if new objects that are written to database after transaction 
> is commited. Those objects are added to a many-to-many relation. And on that 
> relation change a signal is fired and handled by my signal handler, that 
> collects objects from relation and writes them into some cache.
>
> The problem is that during signal handling newly created objects do have PKs, 
> but are not in database yet. So signal_handler in code below always gets 
> empty queryset.
>
>
> def fetcher():
> with transaction.atomic():
> foo = Foo.objects.create(...)
> foo.bars.add(
> Bar.objects.create(...),
> Bar.objects.create(...),
> Bar.objects.create(...),
> ...
> )
>
> @receiver(m2m_changed, sender=Foo.bars.through)
> def signal_handler(pk_set=None, **kwargs):
> # signal_handler is being called inside of a transaction block
> Bar.objects.filter(pk__in=pk_set)  # <-- returns empty QuerySet!
>
>
> Is there a way to delay signal handling until transaction is committed or to 
> get newly created objects by PKs?

https://docs.djangoproject.com/en/1.9/topics/db/transactions/#performing-actions-after-commit

>
> --
> You received this message because you are subscribed to the Google Groups 
> "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/F1A382BE-8C18-4D5B-8758-C42C18A7FC94%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

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


Re: Retrieving objects created in trasaction

2017-08-24 Thread Daniel Hepper
I cannot reproduce this behavior with Django 1.11 and PostgreSQL 9.6. What 
database are you using?

Does your Bar model maybe use non-standard Manager? Can you actually fetch 
to objects after the transaction has finished?


On Wednesday, August 16, 2017 at 8:29:09 PM UTC+2, Александр Христюхин 
wrote:
>
> Hi, 
>
> I have some function (fetcher) that runs in transaction (it has to) and it 
> creates a bunch if new objects that are written to database after 
> transaction is commited. Those objects are added to a many-to-many 
> relation. And on that relation change a signal is fired and handled by my 
> signal handler, that collects objects from relation and writes them into 
> some cache. 
>
> The problem is that during signal handling newly created objects do have 
> PKs, but are not in database yet. So signal_handler in code below always 
> gets empty queryset. 
>
>
> def fetcher(): 
> with transaction.atomic(): 
> foo = Foo.objects.create(...) 
> foo.bars.add( 
> Bar.objects.create(...), 
> Bar.objects.create(...), 
> Bar.objects.create(...), 
> ... 
> ) 
>
> @receiver(m2m_changed, sender=Foo.bars.through) 
> def signal_handler(pk_set=None, **kwargs): 
> # signal_handler is being called inside of a transaction block 
> Bar.objects.filter(pk__in=pk_set)  # <-- returns empty QuerySet! 
>
>
> Is there a way to delay signal handling until transaction is committed or 
> to get newly created objects by PKs? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/e9c89d82-e92b-4de0-bf6a-52f4e505d6fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django hosting / Email Account

2017-08-24 Thread ADEWALE ADISA
Good day friends;
Please help me to clarify this issue:

I just purchase a domain name , let say abc.com.
I want to host my django application on pythonanywhere.com using my domain
name abc.com.
Now i want to create up to three email accout for my clients using my
domain name e.g 1...@abc.com, 4...@abc.com.
Please where would i create this mail account ? Is it from my domain
registrant  where i purchase abc.com or pythonanywhere.com ?

Thanks .

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMGzuy-m%3DH5evUgvzDKRoX2mOOik82TOsUNU8_%2BZ1xpbX1PKog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django hosting / Email Account

2017-08-24 Thread Gerardo Palazuelos Guerrero
hi,
For sure not from pythonanywhere.com

Your domain registrar may have some free emails accounts (like godaddy
which allows you to create email accounts for your domain purchased with
them).

Otherwise, you will have to buy the service (like in gmail for business or
in fastmail.com)



--
Gerardo Palazuelos Guerrero


On Thu, Aug 24, 2017 at 10:12 AM, ADEWALE ADISA 
wrote:

> Good day friends;
> Please help me to clarify this issue:
>
> I just purchase a domain name , let say abc.com.
> I want to host my django application on pythonanywhere.com using my
> domain name abc.com.
> Now i want to create up to three email accout for my clients using my
> domain name e.g 1...@abc.com, 4...@abc.com.
> Please where would i create this mail account ? Is it from my domain
> registrant  where i purchase abc.com or pythonanywhere.com ?
>
> Thanks .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAMGzuy-m%3DH5evUgvzDKRoX2mOOik82TOsUNU8
> _%2BZ1xpbX1PKog%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Need help: webrtc signalling with django app

2017-08-24 Thread OM555
Thanks Andrew. 

On Wednesday, 23 August 2017 21:46:50 UTC+5:30, Andrew Godwin wrote:
>
> My impression was that RTC signalling was not specified or defined so apps 
> could do it how they wish - so you could use normal AJAX, or WebSockets, 
> etc. Channels doesn't have RTC support as, as far as I could tell, the 
> specified parts are all browser-to-browser.
>
> Andrew
>
> On Wed, Aug 23, 2017 at 7:16 AM, OM555 
> > wrote:
>
>> Hi all,
>>
>>  Is there any way of integrating webrtc signaling with django apps? From 
>> what I understand django channels do not support this. I need user 
>> authentication from django app to be used along with the webrtc feature. 
>> Thanks...
>> OM
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/dca802bc-331d-4e6c-8e9e-82f7db5dc4c8%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/bbef2db3-6f0d-4657-8909-5148513fd524%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Capture fk

2017-08-24 Thread Elias Coutinho
Good afternoon people.
.
.
I have two models: Person and Address
Address has a Person fk
I would like to register the addresses of people without the need to 
manually point to which person's given address will belong.
.
.
I was directed to use inlines but I hate the admin of django because if I 
use only the admin I will get fond and I will never have the courage to 
make out of the admin.
.
.
I'm also no fan of the solutions they use out there like inlines.
I do not think they look good for users.
So I thought the following:

I fill in the data of the people form and when doing the submit and the 
django record I enter in the url of editing the person, there I will use 
another html displaying the data that I recorded and a table with the 
addresses that the person could have.
Next to this table I would put a button that would call the address 
register url where the person's fk would be invisible to the user, ie I 
would pass the id person to be used in the address book.
.
.
And finally after recording the address I would go back to the person 
editing form and that address would be displayed on the table along with 
the person's data.
You see?

Can someone help me?

-- 
You received this message because you are subscribed to the Google Groups 
"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/e7b65480-2f74-443b-98ee-6d8237cdcdcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django hosting / Email Account

2017-08-24 Thread ADEWALE ADISA
thanks Guerrero,
i too taught so, i have sent mail to my registrar but they have not reply.
before when am hosting php site, i use to host the site with the registrar,
so the will give me link to cpanel where i can create email account.
but now this registrar the not give me link to cpanel, that what is not
clear to me
On Aug 24, 2017 5:23 PM, "Gerardo Palazuelos Guerrero" <
gerardo.palazue...@gmail.com> wrote:

> hi,
> For sure not from pythonanywhere.com
>
> Your domain registrar may have some free emails accounts (like godaddy
> which allows you to create email accounts for your domain purchased with
> them).
>
> Otherwise, you will have to buy the service (like in gmail for business or
> in fastmail.com)
>
>
>
> --
> Gerardo Palazuelos Guerrero
>
>
> On Thu, Aug 24, 2017 at 10:12 AM, ADEWALE ADISA 
> wrote:
>
>> Good day friends;
>> Please help me to clarify this issue:
>>
>> I just purchase a domain name , let say abc.com.
>> I want to host my django application on pythonanywhere.com using my
>> domain name abc.com.
>> Now i want to create up to three email accout for my clients using my
>> domain name e.g 1...@abc.com, 4...@abc.com.
>> Please where would i create this mail account ? Is it from my domain
>> registrant  where i purchase abc.com or pythonanywhere.com ?
>>
>> Thanks .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAMGzuy-m%3DH5evUgvzDKRoX2mOOik82TOsUNU8_%
>> 2BZ1xpbX1PKog%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAJ8iCyMM%3DdS%3DwwpWjvmG7f7Yp6EQ_tv4o_
> w9djc8Ec3O1FA5Jg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMGzuy-Lw%3DtumtdFaRwnbpAeVrLg0X9%2Bp1KG%2B5zJhEveGNJhiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How rewrite query in Django ORM?

2017-08-24 Thread Николай Инкогнито


SELECT * FROM T WHERE REPLACE(T.field, '-', ' ') = REPLACE(VALUE,'-', ' ')

-- 
You received this message because you are subscribed to the Google Groups 
"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/c0f10848-ac43-43ad-87a5-1a24e902cbe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django hosting / Email Account

2017-08-24 Thread wang sheng
I recommend to use  some "email cloud service " such as "mailgun" or "
sendcloude.com "

2017-08-25 4:24 GMT+08:00 ADEWALE ADISA :

> thanks Guerrero,
> i too taught so, i have sent mail to my registrar but they have not reply.
> before when am hosting php site, i use to host the site with the registrar,
> so the will give me link to cpanel where i can create email account.
> but now this registrar the not give me link to cpanel, that what is not
> clear to me
> On Aug 24, 2017 5:23 PM, "Gerardo Palazuelos Guerrero" <
> gerardo.palazue...@gmail.com> wrote:
>
>> hi,
>> For sure not from pythonanywhere.com
>>
>> Your domain registrar may have some free emails accounts (like godaddy
>> which allows you to create email accounts for your domain purchased with
>> them).
>>
>> Otherwise, you will have to buy the service (like in gmail for business
>> or in fastmail.com)
>>
>>
>>
>> --
>> Gerardo Palazuelos Guerrero
>>
>>
>> On Thu, Aug 24, 2017 at 10:12 AM, ADEWALE ADISA 
>> wrote:
>>
>>> Good day friends;
>>> Please help me to clarify this issue:
>>>
>>> I just purchase a domain name , let say abc.com.
>>> I want to host my django application on pythonanywhere.com using my
>>> domain name abc.com.
>>> Now i want to create up to three email accout for my clients using my
>>> domain name e.g 1...@abc.com, 4...@abc.com.
>>> Please where would i create this mail account ? Is it from my domain
>>> registrant  where i purchase abc.com or pythonanywhere.com ?
>>>
>>> Thanks .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/CAMGzuy-m%3DH5evUgvzDKRoX2mOOik82TOsUNU8_%2
>>> BZ1xpbX1PKog%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAJ8iCyMM%3DdS%3DwwpWjvmG7f7Yp6EQ_tv4o_w9dj
>> c8Ec3O1FA5Jg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAMGzuy-Lw%3DtumtdFaRwnbpAeVrLg0X9%
> 2Bp1KG%2B5zJhEveGNJhiQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BmnDnqn_zTWNxM2Cyw8pZ-1UVRQeXXuC0fjKyx%3D0UmHmOxmeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How rewrite query in Django ORM?

2017-08-24 Thread wang sheng
why you need rewrite query in ORM

you can use "raw query" in django

https://docs.djangoproject.com/en/1.11/topics/db/sql/

2017-08-25 4:25 GMT+08:00 Николай Инкогнито :

> SELECT * FROM T WHERE REPLACE(T.field, '-', ' ') = REPLACE(VALUE,'-', ' ')
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/c0f10848-ac43-43ad-87a5-1a24e902cbe9%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%2BmnDnqoqoMaEQxv6vmJxXtWnHtSPZPw%2BEUxSvwKQZLZh6u%2BEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Cannot access imported functions in django shell by pipeline command

2017-08-24 Thread Cheng-Hung Hsueh


It is a python script `tshi3.py` :


在此輸入代碼...

import csv
def li2ho2():
print(csv)
li2ho2()


I copied this code and pasted it in `python manage.py shell`. It works.

But I ran `python manage.py shell < tshi3.py`. Got `NameError: name 'csv' 
is not defined.`

Why?


Enviroment:

在此輸入代碼...

Linux Mint 18.1
Python 3.4.1 (default, Sep  3 2014, 08:45:22) 
Django==1.11.4


-- 
You received this message because you are subscribed to the Google Groups 
"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/7466c326-0f03-4299-9239-1126daf24aaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.