Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-04 Thread Ryne Everett
https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY

On Thu, Sep 3, 2015 at 9:45 PM, James Lewis <
theselfbalancingscoo...@gmail.com> wrote:

> Thankyou everso much, think I've had too many hours at this and my brain
> is working at half pace :-)
>
> I got rid of that error and now I am getting this:
>
> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 44, in
> _setup
>
> self._wrapped = Settings(settings_module)
>
> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 113,
> in __init__
>
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
>
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
> not be empty.
>
>
> Do you know what this could be?
>
>
> Thanks
>
>
> James
>
> On Fri, Sep 4, 2015 at 2:11 AM, Danny  wrote:
>
>> On 4/09/2015 10:24 AM, James Lewis wrote:
>>
>> Hi Danny thanks for replying so quickly, I am not sure what the name of
>> my form is.  Would I already have an order form within cartridge or would I
>> have to build one specifically to work with stripe?
>>
>>
>> Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet you
>> don't know what the name of your form class is?
>> It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.
>>
>> As for using Stripe as your payment processor, you'll either have to find
>> any existing implementation or write one yourself.
>>
>> If you're using https://github.com/readevalprint/cartridge-stripe
>> then you can see that the name of the class is
>> "cartridge_stripe.forms.OrderForm" so that would be your reference for
>> urls.py,
>>
>> e.g
>>
>> from cartridge_stripe.forms import OrderForm
>>
>> url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
>> name="shop_checkout", kwargs=dict(form_class=OrderForm)),
>>
>> Your original email never mentioned what you'd set
>> SHOP_CHECKOUT_FORM_CLASS to, so I'd assumed you'd written your own Order
>> Form class in your own app
>> and were doing it that way...
>>
>> Seeya. Danny.
>>
>>
>> Many Thanks
>>
>> James
>>
>> On Fri, Sep 4, 2015 at 1:23 AM, Danny  wrote:
>>
>>> On 4/09/2015 9:51 AM, James Lewis wrote:
>>>
>>> Hi Danny, I have made the changes you mentioned and now I am getting the
>>> following error:
>>>
>>>
>>> File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in
>>> 
>>>
>>>   33. name="shop_checkout",
>>> kwargs=dict(form_class=MyOrderForm)),
>>>
>>>
>>> Exception Type: NameError at /
>>>
>>> Exception Value: name 'MyOrderForm' is not defined
>>>
>>>
>>>
>>> Is that the name of your Form, though? Have you done "from ... import
>>> MyOrderForm" in urls.py?
>>>
>>> I'll need some more context.
>>>
>>> I am sure it's something silly, but I've checked stackoverflow and can't
>>> find anything?
>>>
>>>
>>> Many Thanks
>>>
>>>
>>> James :-)
>>>
>>>
>>> Seeya. Danny.
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Mezzanine Users" group.
>>> To unsubscribe from this topic, visit
>>> 
>>> https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> mezzanine-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mezzanine-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Mezzanine Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> mezzanine-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-04 Thread James Lewis
Thankyou I have looked into that and found nothing that will help; I got
this response from webfaction:

Hello James,



 Sorry I should have mentioned, my key is set in
both settings and local_settings.py?

Normally, when Django generates a settings.py
file, it adds a comment at the top of the file that mentions the
Django version which was used to generate it. More generally, the
"manage.py startproject" command generates a project which
is compatible with the version of Django used when that command is
run.


 Your application is now using the Django library
located at:


 /home/jameslewis/lib/python2.7/django


 There's nothing inherently wrong with that, but
because you erased the comments in settings.py that indicate
compatibility, I haven't been able to confirm that the django library
version you're using is actually compatible with your application. I
do see that you're using Django 1.8.4:



 [jameslewis@web451 myshop]$ pwd

/home/jameslewis/webapps/myshop


 [jameslewis@web451 myshop]$ python2.7

Python 2.7.9 (default, Dec 14 2014, 05:14:54)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on
linux2

Type "help",
"copyright", "credits" or "license" for
more information.

import
django

django



django.VERSION

(1, 8, 4, 'final', 0)



 Did you actually generate your application using
Django 1.8, or are you sure that it's compatible with Django 1.8?
I've seen these types of problems arise in the past, and the solution
is as simple as installing a matching Django version for your
application.


 Can you tell us more about your application? Is
it running successfully locally or on another host? If so, which
Django version is being used there?


 Next, if you are sure that your application is
compatible with Django 1.8.4, then the next step is to determine why
Django doesn't see your SECRET_KEY, since you're clearly setting it
in /home/jameslewis/webapps/myshop/myapp/myapp/settings.py . To do
that, I'd just work back from the error message, logging the value of
settings.SECRET_KEY at various points until you worked back to the
point at which you set it (with a binary search).

  Regards,


 Ryan S.



I am not sure what to make of this; I am trying to work out what is wrong;
if there is anything you could recommend I would be very grateful.



Regards


James

On Sat, Sep 5, 2015 at 1:06 AM, Ryne Everett  wrote:

> https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY
>
> On Thu, Sep 3, 2015 at 9:45 PM, James Lewis <
> theselfbalancingscoo...@gmail.com> wrote:
>
>> Thankyou everso much, think I've had too many hours at this and my brain
>> is working at half pace :-)
>>
>> I got rid of that error and now I am getting this:
>>
>> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 44,
>> in _setup
>>
>> self._wrapped = Settings(settings_module)
>>
>> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 113,
>> in __init__
>>
>> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
>>
>> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
>> not be empty.
>>
>>
>> Do you know what this could be?
>>
>>
>> Thanks
>>
>>
>> James
>>
>> On Fri, Sep 4, 2015 at 2:11 AM, Danny  wrote:
>>
>>> On 4/09/2015 10:24 AM, James Lewis wrote:
>>>
>>> Hi Danny thanks for replying so quickly, I am not sure what the name of
>>> my form is.  Would I already have an order form within cartridge or would I
>>> have to build one specifically to work with stripe?
>>>
>>>
>>> Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet
>>> you don't know what the name of your form class is?
>>> It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.
>>>
>>> As for using Stripe as your payment processor, you'll either have to
>>> find any existing implementation or write one yourself.
>>>
>>> If you're using https://github.com/readevalprint/cartridge-stripe
>>> then you can see that the name of the class is
>>> "cartridge_stripe.forms.OrderForm" so that would be your reference for
>>> urls.py,
>>>
>>> e.g
>>>
>>> from cartridge_stripe.forms import OrderForm
>>>
>>> url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
>>> name="shop_checkout", kwargs=dict(form_class=OrderForm)),
>>>
>>> Your original email never mentioned what you'd set
>>> SHOP_CHECKOUT_FORM_CLASS to, so I'd assumed you'd written your own Order
>>> Form class in your own app
>>> and were doing it that way...
>>>
>>> Seeya. Danny.
>>>
>>>
>>> Many Thanks
>>>
>>> James
>>>
>>> On Fri, Sep 4, 2015 at 1:23 AM, Danny  wrote:
>>>
 On 4/09/2015 9:51 AM, James Lewis wrote:

 Hi Danny, I have made the changes you mentioned and now I am getting
 the following error:


 File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in
 

   33. name="shop_checkout",
 kwargs=dict(form_class=MyOrderForm)),


 Exception Type: NameError at 

Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-04 Thread Ryne Everett
There aren't too many alternatives to either (a) you haven't defined
SECRET_KEY in your settings.py or (b) django isn't loading the settings.py
module you think it is.

I guess you might try throwing a debugger in django/conf/__init__.py before
that error and introspecting your settings module if you can.

Also, is this issue only in production?

On Fri, Sep 4, 2015 at 9:03 PM, James Lewis <
theselfbalancingscoo...@gmail.com> wrote:

> Thankyou I have looked into that and found nothing that will help; I got
> this response from webfaction:
>
> Hello James,
>
>
>
>  Sorry I should have mentioned, my key is set in
> both settings and local_settings.py?
>
> Normally, when Django generates a settings.py
> file, it adds a comment at the top of the file that mentions the
> Django version which was used to generate it. More generally, the
> "manage.py startproject" command generates a project which
> is compatible with the version of Django used when that command is
> run.
>
>
>  Your application is now using the Django library
> located at:
>
>
>  /home/jameslewis/lib/python2.7/django
>
>
>  There's nothing inherently wrong with that, but
> because you erased the comments in settings.py that indicate
> compatibility, I haven't been able to confirm that the django library
> version you're using is actually compatible with your application. I
> do see that you're using Django 1.8.4:
>
>
>
>  [jameslewis@web451 myshop]$ pwd
>
> /home/jameslewis/webapps/myshop
>
>
>  [jameslewis@web451 myshop]$ python2.7
>
> Python 2.7.9 (default, Dec 14 2014, 05:14:54)
>
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on
> linux2
>
> Type "help",
> "copyright", "credits" or "license" for
> more information.
>
> import
> django
>
> django
>
>  from '*/home/jameslewis/lib/python2.7/django/*__init__.pyc'>
>
> django.VERSION
>
> (1, 8, 4, 'final', 0)
>
>
>
>  Did you actually generate your application using
> Django 1.8, or are you sure that it's compatible with Django 1.8?
> I've seen these types of problems arise in the past, and the solution
> is as simple as installing a matching Django version for your
> application.
>
>
>  Can you tell us more about your application? Is
> it running successfully locally or on another host? If so, which
> Django version is being used there?
>
>
>  Next, if you are sure that your application is
> compatible with Django 1.8.4, then the next step is to determine why
> Django doesn't see your SECRET_KEY, since you're clearly setting it
> in /home/jameslewis/webapps/myshop/myapp/myapp/settings.py . To do
> that, I'd just work back from the error message, logging the value of
> settings.SECRET_KEY at various points until you worked back to the
> point at which you set it (with a binary search).
>
>   Regards,
>
>
>  Ryan S.
>
>
>
> I am not sure what to make of this; I am trying to work out what is wrong;
> if there is anything you could recommend I would be very grateful.
>
>
>
> Regards
>
>
> James
>
> On Sat, Sep 5, 2015 at 1:06 AM, Ryne Everett 
> wrote:
>
>> https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY
>>
>> On Thu, Sep 3, 2015 at 9:45 PM, James Lewis <
>> theselfbalancingscoo...@gmail.com> wrote:
>>
>>> Thankyou everso much, think I've had too many hours at this and my brain
>>> is working at half pace :-)
>>>
>>> I got rid of that error and now I am getting this:
>>>
>>> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 44,
>>> in _setup
>>>
>>> self._wrapped = Settings(settings_module)
>>>
>>> File "/home/jameslewis/lib/python2.7/django/conf/__init__.py", line 113,
>>> in __init__
>>>
>>> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
>>>
>>> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
>>> not be empty.
>>>
>>>
>>> Do you know what this could be?
>>>
>>>
>>> Thanks
>>>
>>>
>>> James
>>>
>>> On Fri, Sep 4, 2015 at 2:11 AM, Danny  wrote:
>>>
 On 4/09/2015 10:24 AM, James Lewis wrote:

 Hi Danny thanks for replying so quickly, I am not sure what the name of
 my form is.  Would I already have an order form within cartridge or would I
 have to build one specifically to work with stripe?


 Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet
 you don't know what the name of your form class is?
 It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.

 As for using Stripe as your payment processor, you'll either have to
 find any existing implementation or write one yourself.

 If you're using https://github.com/readevalprint/cartridge-stripe
 then you can see that the name of the class is
 "cartridge_stripe.forms.OrderForm" so that would be your reference for
 urls.py,

 e.g

 from cartridge_stripe.forms import OrderForm

 url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
 name="shop_checkout", 

Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread James Lewis
Hi Danny thanks for replying so quickly, I am not sure what the name of my
form is.  Would I already have an order form within cartridge or would I
have to build one specifically to work with stripe?

Many Thanks

James

On Fri, Sep 4, 2015 at 1:23 AM, Danny  wrote:

> On 4/09/2015 9:51 AM, James Lewis wrote:
>
> Hi Danny, I have made the changes you mentioned and now I am getting the
> following error:
>
>
> File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in 
>
>   33. name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),
>
>
> Exception Type: NameError at /
>
> Exception Value: name 'MyOrderForm' is not defined
>
>
>
> Is that the name of your Form, though? Have you done "from ... import
> MyOrderForm" in urls.py?
>
> I'll need some more context.
>
> I am sure it's something silly, but I've checked stackoverflow and can't
> find anything?
>
>
> Many Thanks
>
>
> James :-)
>
>
> Seeya. Danny.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mezzanine Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am getting 
the following error:




File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in 


33. name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ... import 
MyOrderForm" in urls.py?


I'll need some more context.

I am sure it's something silly, but I've checked stackoverflow and 
can't find anything?



Many Thanks


James :-)



Seeya. Danny.

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread James Lewis
Hi Danny, I have made the changes you mentioned and now I am getting the
following error:


Traceback:

File "/home/jameslewis/lib/python2.7/django/core/handlers/base.py" in
get_response

  119. resolver_match = resolver.resolve(request.path_info)

File "/home/jameslewis/lib/python2.7/django/core/urlresolvers.py" in resolve

  366. for pattern in self.url_patterns:

File "/home/jameslewis/lib/python2.7/django/core/urlresolvers.py" in
url_patterns

  402. patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)

File "/home/jameslewis/lib/python2.7/django/core/urlresolvers.py" in
urlconf_module

  396. self._urlconf_module = import_module(self.urlconf_name)

File "/usr/local/lib/python2.7/importlib/__init__.py" in import_module

  37. __import__(name)

File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in 

  33. name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined



I am sure it's something silly, but I've checked stackoverflow and can't
find anything?


Many Thanks


James :-)

On Tue, Sep 1, 2015 at 11:59 PM, James Lewis <
theselfbalancingscoo...@gmail.com> wrote:

> Thankyou very much, I will look into this asap :-)
>
>
> On Tuesday, September 1, 2015 at 10:59:27 PM UTC+1, Danny S wrote:
>
>> On 2/09/2015 7:19 AM, James Lewis wrote:
>>
>> I have tried this and it is still not working, I have tried all the
>> different urls on this group and I am still getting the same errors.  What
>> else do you have to change to stop this error appearing; is there not any
>> changes I need to make in forms.py, settings or anything else?  Sorry but I
>> am really struggling on this for some reason
>>
>>
>> Have you removed SHOP_CHECKOUT_FORM_CLASS from your settings.py? The
>> urls.py changes *replace* the need for this deprecated setting.
>>
>> eg. instead of
>> SHOP_CHECKOUT_FORM_CLASS = "myapp.forms.MyOrderForm"
>> in settings.py,  you do:
>>
>> from myapp.forms import MyOrderForm
>>
>> # ...
>>
>> urlpatterns += patterns('',
>>
>> # Use your special OrderForm class
>> url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
>> name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),
>>
>> # Cartridge URLs.
>> ("^shop/", include("cartridge.shop.urls")),
>>
>> # ...
>> )
>>
>> in urls.py
>>
>> HTH. HAND.
>>
>> Seeya. Danny.
>>
>> Thanks
>>
>> James
>> On Friday, July 11, 2014 at 6:07:43 PM UTC+1, Tristan Barry wrote:
>>>
>>> Good afternoon! I am working on a project where we would like to use
>>> Cartridge for an online store. Out of the box it looks great; but I'd like
>>> to modify the checkout form. Reading through the documentation it sounded
>>> like I could sub-class the OrderForm class in 'cartridge.shops.forms'. When
>>> going through these steps I saw this message:
>>>
>>> "The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please define your
>>> own urlpattern for the checkout_steps view, passing in your own form_class
>>> argument."
>>>
>>> But I'm running into problems right off the start. Does this mean I can
>>> just write my own URL pattern for *only* the checkout form? Something like
>>> this?
>>>
>>> url("^shop/checkout/$", "myproject.views.checkout_steps", name =
>>> "checkout_steps")
>>> ?
>>>
>>> Or do I need to remove the cartridge urls pattern:
>>>   url(r"^shop/", include("cartridge.shop.urls")),
>>> and replace it with a modified version of 'cartridge.shop.urls'? This
>>> doesn't seem very DRY?
>>>
>>> Can anyone offer any hints on how to get started?  Should the OrderForm
>>> class still be sub-classed to assist with making this all 'work'? Any help??
>>>
>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mezzanine-use...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> *Danny Sag*
>> Chairperson
>> Round World Events SA, Inc
>> City of Small Gods Terry Pratchett Fan Club -
>> http://cityofsmallgods.org.au
>>
>> *Nullus Anxietas VI - The Australian Discworld Convention* -
>> http://ausdwcon.org
>> "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mezzanine Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send 

Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 10:24 AM, James Lewis wrote:
Hi Danny thanks for replying so quickly, I am not sure what the name 
of my form is.  Would I already have an order form within cartridge or 
would I have to build one specifically to work with stripe?




Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet 
you don't know what the name of your form class is?

It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.

As for using Stripe as your payment processor, you'll either have to 
find any existing implementation or write one yourself.


If you're using https://github.com/readevalprint/cartridge-stripe
then you can see that the name of the class is 
"cartridge_stripe.forms.OrderForm" so that would be your reference for 
urls.py,


e.g

from cartridge_stripe.forms import OrderForm

url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
name="shop_checkout", kwargs=dict(form_class=OrderForm)),

Your original email never mentioned what you'd set 
SHOP_CHECKOUT_FORM_CLASS to, so I'd assumed you'd written your own Order 
Form class in your own app

and were doing it that way...

Seeya. Danny.



Many Thanks

James

On Fri, Sep 4, 2015 at 1:23 AM, Danny > wrote:


On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am
getting the following error:



File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in



33.   name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ...
import MyOrderForm" in urls.py?

I'll need some more context.


I am sure it's something silly, but I've checked stackoverflow
and can't find anything?


Many Thanks


James :-)



Seeya. Danny.
-- 
You received this message because you are subscribed to a topic in

the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mezzanine-users/DQX3K3jdojE/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to mezzanine-users+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to mezzanine-users+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-01 Thread James Lewis
I have tried this and it is still not working, I have tried all the 
different urls on this group and I am still getting the same errors.  What 
else do you have to change to stop this error appearing; is there not any 
changes I need to make in forms.py, settings or anything else?  Sorry but I 
am really struggling on this for some reason

Thanks

James
On Friday, July 11, 2014 at 6:07:43 PM UTC+1, Tristan Barry wrote:
>
> Good afternoon! I am working on a project where we would like to use 
> Cartridge for an online store. Out of the box it looks great; but I'd like 
> to modify the checkout form. Reading through the documentation it sounded 
> like I could sub-class the OrderForm class in 'cartridge.shops.forms'. When 
> going through these steps I saw this message:
>
> "The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please define your 
> own urlpattern for the checkout_steps view, passing in your own form_class 
> argument."
>
> But I'm running into problems right off the start. Does this mean I can 
> just write my own URL pattern for *only* the checkout form? Something like 
> this?
>
> url("^shop/checkout/$", "myproject.views.checkout_steps", name = 
> "checkout_steps")
> ?
>
> Or do I need to remove the cartridge urls pattern:
>   url(r"^shop/", include("cartridge.shop.urls")),
> and replace it with a modified version of 'cartridge.shop.urls'? This 
> doesn't seem very DRY?
>
> Can anyone offer any hints on how to get started?  Should the OrderForm 
> class still be sub-classed to assist with making this all 'work'? Any help??
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-01 Thread Danny

On 2/09/2015 7:19 AM, James Lewis wrote:
I have tried this and it is still not working, I have tried all the 
different urls on this group and I am still getting the same errors. 
 What else do you have to change to stop this error appearing; is 
there not any changes I need to make in forms.py, settings or anything 
else?  Sorry but I am really struggling on this for some reason




Have you removed SHOP_CHECKOUT_FORM_CLASS from your settings.py? The 
urls.py changes *replace* the need for this deprecated setting.


eg. instead of
SHOP_CHECKOUT_FORM_CLASS = "myapp.forms.MyOrderForm"
in settings.py,  you do:

|from myapp.forms import MyOrderForm # ... urlpatterns += patterns('', # 
Use your special OrderForm class url("^shop/checkout/$", 
"cartridge.shop.views.checkout_steps", name="shop_checkout", 
kwargs=dict(form_class=MyOrderForm)), # Cartridge URLs. ("^shop/", 
include("cartridge.shop.urls")), # ... )|


in urls.py

HTH. HAND.

Seeya. Danny.


Thanks

James
On Friday, July 11, 2014 at 6:07:43 PM UTC+1, Tristan Barry wrote:

Good afternoon! I am working on a project where we would like to
use Cartridge for an online store. Out of the box it looks great;
but I'd like to modify the checkout form. Reading through the
documentation it sounded like I could sub-class the OrderForm
class in 'cartridge.shops.forms'. When going through these steps I
saw this message:

"The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please
define your own urlpattern for the checkout_steps view, passing in
your own form_class argument."

But I'm running into problems right off the start. Does this mean
I can just write my own URL pattern for *only* the checkout form?
Something like this?

url("^shop/checkout/$", "myproject.views.checkout_steps", name =
"checkout_steps")
?

Or do I need to remove the cartridge urls pattern:
  url(r"^shop/", include("cartridge.shop.urls")),
and replace it with a modified version of 'cartridge.shop.urls'?
This doesn't seem very DRY?

Can anyone offer any hints on how to get started?  Should the
OrderForm class still be sub-classed to assist with making this
all 'work'? Any help??


--
You received this message because you are subscribed to the Google 
Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to mezzanine-users+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.