Skip to content
This repository was archived by the owner on Oct 6, 2020. It is now read-only.

Commit ae671ea

Browse files
author
Sebastian Vetter
committed
Add documentation for sandbox setup
1 parent b59e7ea commit ae671ea

File tree

2 files changed

+92
-2
lines changed

2 files changed

+92
-2
lines changed

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: tests docs
2+
3+
docs:
4+
${MAKE} -C docs html
5+
6+
7+
tests:
8+
py.test --pep8 --cov oscar_mws
9+
py.test -m integration

docs/source/getting_started.rst

+83-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Getting Started
55
Basic Concepts
66
--------------
77

8-
*django-oscar-mws* provides a few models that represent data retrieved from or
9-
sent to Amazon's MWS API.
8+
*django-oscar-mws* (OMWS) provides a few models that represent data retrieved
9+
from or sent to Amazon's MWS API.
1010

1111

1212
Merchant Account
@@ -61,3 +61,84 @@ of assumptions that we have to make based on the way MWS works.
6161
is marked as shipped if the stock record is tracking MWS stock. This
6262
functionality is encapsulated in ``AmazonStockRecordMixin`` which you should
6363
add to your projects ``StockRecord``.
64+
65+
66+
Setting Up The Sandbox
67+
----------------------
68+
69+
*django-oscar-mws* comes with a sandbox site that shows how MWS can be
70+
integrated with Oscar. It resembles a basic set up of Oscar with an
71+
out-of-the-box integration of MWS. This section will walk you through setting
72+
the sandbox up locally and how to make it interact with the MWS API.
73+
74+
.. note:: Oscar itself has quite a few dependencies and settings that might
75+
cause some problems when you are setting up the MWS sandbox. In addition to
76+
this documentation you might also want to check out the `Oscar docs on
77+
setting up a project`_.
78+
79+
The first thing to do is cloning the repository and installing it's
80+
requirements which will includes setting up Oscar. It also creates a new
81+
database (if it doesn't exist) creates the required tables:
82+
83+
.. code-block:: bash
84+
85+
$ git clone [email protected]:tangentlabs/django-oscar-mws.git
86+
$ cd django-oscar-mws
87+
$ mkvirtualenv mws # requires virtualenvwrapper to be installed
88+
$ make sandbox
89+
90+
By default, the sandbox is using Oscar's precompiled *CSS* files by setting
91+
``USE_LESS = False``. If you want to use *LESS* to generate the CSS yourself,
92+
take a look at the documentation on `how to use LESS with Oscar`_.
93+
94+
Create Admin User
95+
~~~~~~~~~~~~~~~~~
96+
97+
The main interface for MWS lives in Oscar's dashboard and therefore requires an
98+
admin user to login. Create a new admin account using Django's
99+
``createsuperuser`` command and follow the instruction:
100+
101+
.. code-block:: bash
102+
103+
$ ./sandbox/manage.py createsuperuser
104+
105+
You should now be able to run the sandbox locally using Django's builtin
106+
HTTP server:
107+
108+
.. code-block:: bash
109+
110+
$ ./sandbox/manage.py runserver
111+
112+
You now have a sample shop up and running and should be able to `navigate to
113+
the dashboard`_ to continue the setup of your MWS credentials.
114+
115+
116+
Setting Up MWS
117+
--------------
118+
119+
The API endpoints provided by Amazon MWS differ based on the MWS region. The
120+
different `regions and endpoints`_ are detailed in the Amazon docs. Each region
121+
requires separate MWS credentials for each account. In OMWS, these accounts are
122+
called *merchant accounts* and are used to identify the endpoints to use when
123+
communication with MWS.
124+
125+
You have to create a merchant account and provide your MWS credentials to be
126+
able to connect to MWS. Head to the *Amazon MWS > Merchants & Marketplaces* in
127+
the Oscar dashboard and select 'Add merchant account'. A corresponding partner
128+
account in Oscar is required for a MWS merchant account, however, if no partner
129+
is selected explicitly, a new one will be created automatically with the same
130+
name as the MWS merchant account.
131+
132+
With your merchant account(s) added, you can update the corresponding
133+
marketplaces in the drop-down menu on the right-hand side. This will pull the
134+
MWS marketplaces that you are able to trade in from MWS. This will also
135+
indicate that communicating with the MWS API is successful.
136+
137+
138+
.. _`navigate to the dashboard`: http://localhost:8000/dashboard/merchants/
139+
140+
.. _`regions and endpoints`: http://docs.developer.amazonservices.com/en_US/dev_guide/DG_Registering.html
141+
142+
.. _`Oscar docs on setting up a project`: http://django-oscar.readthedocs.org/en/latest/internals/sandbox.html#sample-oscar-projects
143+
144+
.. _`how to use LESS with Oscar`: http://django-oscar.readthedocs.org/en/latest/howto/how_to_handle_statics.html?highlight=less#less-css

0 commit comments

Comments
 (0)