tutorial install guide updated

pull/211/head
JamesRamm 2018-12-29 22:35:40 +01:00
rodzic 4a5c11a1f8
commit 5469c0496a
8 zmienionych plików z 58 dodań i 72 usunięć

Wyświetl plik

@ -3,79 +3,88 @@ title: Setup
sidebar_label: Setup
---
Setting Up
==========
Topics covered:
1. Longclaw installation
2. Scaffolding a project
3. Settings
4. Database migration and initial data
Installation
------------
Start off by creating a virtual environment for your project:
.. code-block:: bash
```bash
$ cd my_project_folder
$ virtualenv my_project
$ source my_project/bin/activate
```
Install Longclaw into it:
.. code-block:: bash
(my_project) $ pip install longclaw
```bash
(my_project) $ pip install longclaw
```
We also need to install the client library for our payment gateway integration. We are going to
use Braintree as our payment gateway in this walkthrough.
.. code-block:: bash
(my_project) $ pip install braintree
```bash
(my_project) $ pip install braintree
```
Finally, use the longclaw CLI to setup your django project:
.. code-block:: bash
```bash
(my_project) $ longclaw start bakery
```
(my_project) $ longclaw start my_shop
Settings
--------
## Settings
Now we have a django project which looks like this::
my_shop/
home/
my_shop/
products/
search/
manage.py
requirements.txt
```
my_shop/
home/
bakery/
catalog/
search/
manage.py
requirements.txt
```
The ``home`` and ``search`` folders are default folders used in Wagtail projects. Users of Wagtail
The `home` and `search` folders are default folders used in Wagtail projects. Users of Wagtail
will be familiar with these.
The ``products`` folder contains a skeleton model for our product `variants` which we will come to later.
The `catalog` folder contains a skeleton model for our product `variants` which we will come to later.
Before proceeding, we need to setup our ``settings`` file, in ``my_shop/settings/base.py``.
Before proceeding, we need to setup our ``settings`` file, in ``bakery/settings/base.py``.
We need to configure which payment gateway we are using. Change the entry for ``PAYMENT_GATEWAY`` from
``'longclaw.checkout.gateways.BasePayment'`` to ``'longclaw.checkout.gateways.braintree.BraintreePayment'``
We need to configure which payment gateway we are using. Change the entry for `PAYMENT_GATEWAY` from
`'longclaw.checkout.gateways.BasePayment'` to `'longclaw.checkout.gateways.braintree.BraintreePayment'`
We also need to set the access tokens for the braintree backend. Add the following settings:
.. codeblock:: python
```python
BRAINTREE_SANDBOX = False
BRAINTREE_MERCHANT_ID = os.environ['BRAINTREE_MERCHANT_ID']
BRAINTREE_PUBLIC_KEY = os.environ['BRAINTREE_PUBLIC_KEY']
BRAINTREE_PRIVATE_KEY = os.environ['BRAINTREE_PRIVATE_KEY']
```
BRAINTREE_SANDBOX = False
BRAINTREE_MERCHANT_ID = os.environ['BRAINTREE_MERCHANT_ID']
BRAINTREE_PUBLIC_KEY = os.environ['BRAINTREE_PUBLIC_KEY']
BRAINTREE_PRIVATE_KEY = os.environ['BRAINTREE_PRIVATE_KEY']
For development/testing, you will probably want to set ``BRAINTREE_SANDBOX`` to ``True``. The above settings assume that
For development/testing, you will probably want to set `BRAINTREE_SANDBOX` to `True`. The above settings assume that
you have set environment variables on your OS with the access tokens.
.. note: Don't forget that Longclaw is a Wagtail project. You may need to configure additional settings
for wagtail.
## Migration
.. note: If you have a problem with the initial migration (`python manage.py migrate`) relating to `InvalidBasesError`, try commenting out all longclaw apps
Now we can run the initial migration and create an admin user:
```bash
python manage.py makemigrations catalog home
python manage.py migrate
python manage.py createsuperuser
python manage.py loadcountries
```
> If you have a problem with the initial migration (`python manage.py migrate`) relating to `InvalidBasesError`, try commenting out all longclaw apps
(and your shop apps, `home`, `search` and the project name app), plus the `ROOT_URLCONF` line and run the migrations again. Next, add back the apps and `ROOT_URLCONF` and
run the migrations one more time. If you encounter problems at runtime, such as `OperationalError: no such table`, try running `migrate` again with the `--run-syncdb` option.
Great! Now we are setup, we can start :ref:`adding products <tutorial_products>`
Great! Now we are setup, we can start [adding products](/docs/tutorial/products)

Wyświetl plik

@ -3,9 +3,6 @@ title: Adding Products
sidebar_label: Adding Products
---
Modelling Your Catalogue
========================
Longclaw makes as few assumptions as possible when it comes to modelling your products, since the
requirements of different shops can be wide and varied.

Wyświetl plik

@ -59,17 +59,11 @@ class Footer extends React.Component {
Stack Overflow
</a>
<a href="https://discordapp.com/">Project Chat</a>
<a
href="https://twitter.com/"
target="_blank"
rel="noreferrer noopener">
Twitter
</a>
</div>
<div>
<h5>More</h5>
<a href={`${this.props.config.baseUrl}blog`}>Blog</a>
<a href="https://github.com/">GitHub</a>
<a href="https://github.com/JamesRamm/longclaw">GitHub</a>
<a
className="github-button"
href={this.props.config.repoUrl}
@ -82,19 +76,6 @@ class Footer extends React.Component {
</a>
</div>
</section>
<a
href="https://code.facebook.com/projects/"
target="_blank"
rel="noreferrer noopener"
className="fbOpenSource">
<img
src={`${this.props.config.baseUrl}img/oss_logo.png`}
alt="Facebook Open Source"
width="170"
height="45"
/>
</a>
<section className="copyright">{this.props.config.copyright}</section>
</footer>
);

Wyświetl plik

@ -14,7 +14,7 @@ const users = [
caption: 'Ramshackle Audio',
// You will need to prepend the image path witxh your baseUrl
// if it is not '/', like: '/test-site/img/docusaurus.svg'.
image: '/img/docusaurus.svg',
image: 'https://assets.bigcartel.com/theme_images/37144084/logo_128.png',
infoLink: 'https://www.ramshackleaudio.com',
pinned: true,
},
@ -23,7 +23,7 @@ const users = [
const siteConfig = {
title: 'Longclaw', // Title for your website.
tagline: 'E-commerce extension for Wagtail CMS',
url: 'https://your-docusaurus-test-site.com', // Your website URL
url: 'https://JamesRamm.github.io', // Your website URL
baseUrl: '/', // Base URL for your project */
// For github.io type URLs, you would set the url and baseUrl like:
// url: 'https://facebook.github.io',
@ -48,9 +48,9 @@ const siteConfig = {
//users,
/* path to images for header/footer */
headerIcon: 'img/docusaurus.svg',
footerIcon: 'img/docusaurus.svg',
favicon: 'img/favicon.png',
headerIcon: 'img/shop.png',
footerIcon: 'img/shop.png',
favicon: 'img/favicon/favicon.ico',
/* Colors for website */
colors: {
@ -100,7 +100,7 @@ const siteConfig = {
// You may provide arbitrary config keys to be used as needed by your
// template. For example, if you need your repo's URL...
// repoUrl: 'https://github.com/facebook/test-site',
repoUrl: 'https://github.com/JamesRamm/longclaw',
};
module.exports = siteConfig;

File diff suppressed because one or more lines are too long

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 76 KiB

BIN
website/static/img/favicon.png 100755 → 100644

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 984 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.9 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 9.4 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 7.7 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 1.7 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.9 KiB