2016-02-12 12:54:46 +00:00
|
|
|
# Lengow
|
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
## How to run
|
|
|
|
|
|
|
|
To run locally, do the usual :
|
|
|
|
|
|
|
|
- Create a virtualenv
|
|
|
|
- Install dependencies :
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
```
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
- Clone the project
|
|
|
|
- Inside virtualenv, do theses commands to create the database :
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
```
|
|
|
|
python manage.py makemigrations
|
|
|
|
python manage.py migrate
|
|
|
|
```
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
- Finally, run the server :
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
```
|
|
|
|
python manage.py runserver
|
|
|
|
```
|
2016-02-14 21:13:01 +00:00
|
|
|
|
2016-02-14 20:58:42 +00:00
|
|
|
- Website will be available through [http://localhost:8000/](http://localhost:8000/)
|
|
|
|
|
|
|
|
## Grab orders from the API
|
|
|
|
|
|
|
|
Run this command insode virtualenv :
|
|
|
|
```
|
|
|
|
python manage.py sync
|
|
|
|
```
|
|
|
|
|
|
|
|
## REST API
|
|
|
|
|
|
|
|
The REST API is available on [http://localhost:8000/api/orders/](http://localhost:8000/api/orders/)
|
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
|
|
|
- Create some sub-models and their required views to support more of the XML API (like addresses, tracking or cart informations)
|
|
|
|
- Be more precise on the max-length, null and blank parameters in the order's model (XML is too flexible for real databases constraints)
|
|
|
|
- Enable authentication for altering actions on the REST API
|