Skip to content

Commit a5cd732

Browse files
committed
Updated contribution instructions and minor code formatting
1 parent d9ca6ca commit a5cd732

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
11
## Contributing
22

3-
Make sure your contribution isn't already a planned feature or has already been fixed by checking the issues first.
3+
Make sure your contribution isn't already a planned feature or has already
4+
been fixed by checking the issues first.
45

56
1. Fork this project.
67

7-
2. Find an issue to fix or create a new issue if you want to propose a feature. Generally speaking, everyone wants features. I'm only going to merge features that have 2 or more +1, otherwise this project will fill up with lots of random stuff.
8+
2. Find an issue to fix or create a new issue if you want to propose a feature. For
9+
the new features - check out on GitHub issues first before starting to code it.
10+
11+
3. **No changes in the current API** are accepted. Even backward-compatible ones.
12+
The only exception is extending database and fixing data issues. These are OK. For
13+
all other changes - please submit a request and we'll review the feature for v2 of API.
14+
Current version will remain the same for the sake of compatibility with all the
15+
example code that API enthusiasts created.
816

9-
3. Write your codez, make sure you add tests. Check out the "development" section below.
17+
## Development
1018

11-
4. Submit a descriptive pull request that is *up to date with the master branch*.
19+
An application was originally built with Python 2.7 and Django 1.x. This stack is outdated hence
20+
continuing with this code base is not adviced. The next version of SWAPI will likely be
21+
cloud native and serverless.
1222

13-
5. We'll accept it and add it to production!
23+
If you insist, best use Docker for building and running the project (Dockerfile is included
24+
in the root folder)
1425

26+
```shell
27+
docker build -t myswapi .
28+
docker run -p 8000:8000 myswapi
29+
```
1530

16-
## Development
31+
The same image is available as `juriy/swapi` from DockerHub.
1732

18-
Once you have downloaded the project, look at the Makefile to see a list of useful shortcut commands.
33+
# Django commands
1934

20-
In order to get started run:
35+
The commands below are already executed in Docker image, if you need to work with Django
36+
directly or from inside the docker image, the following commands may be useful
2137

22-
```
23-
make install
24-
make build
25-
make load_data
26-
```
38+
```shell
39+
# run DB migrations
40+
python manage.py migrate
2741

28-
To run the server locally run:
42+
# load data from fixtures
43+
make load_data
2944

30-
```
31-
make serve
45+
# run the server
46+
python manage.py runserver 0.0.0.0:8000
3247
```
3348

3449
If you add new data then you can dump it out using the following command:
@@ -43,15 +58,10 @@ To run tests:
4358
make test
4459
```
4560

46-
*NOTE:* pull requests will not be accepted if they do not pass tests or have no new tests for new features.
47-
48-
4961
## File structure
5062

51-
- resources
52-
63+
### /resources
5364
All API resource models, serializers and schemas are found here.
5465

55-
- swapi
56-
66+
### /swapi
5767
All Django configuration, templates and static files are found here.

resources/fixtures/films.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"created": "2014-12-10T14:23:31.880Z",
2929
"episode_id": 4,
3030
"director": "George Lucas",
31-
"release_date": "1977-05-25",
31+
"release_date": "1977-05-25",
3232
"opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....",
3333
"characters": [
3434
1,
@@ -94,7 +94,7 @@
9494
"created": "2014-12-12T11:26:24.656Z",
9595
"episode_id": 5,
9696
"director": "Irvin Kershner",
97-
"release_date": "1980-05-17",
97+
"release_date": "1980-05-17",
9898
"opening_crawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space....",
9999
"characters": [
100100
1,
@@ -164,7 +164,7 @@
164164
"created": "2014-12-18T10:39:33.255Z",
165165
"episode_id": 6,
166166
"director": "Richard Marquand",
167-
"release_date": "1983-05-25",
167+
"release_date": "1983-05-25",
168168
"opening_crawl": "Luke Skywalker has returned to\r\nhis home planet of Tatooine in\r\nan attempt to rescue his\r\nfriend Han Solo from the\r\nclutches of the vile gangster\r\nJabba the Hutt.\r\n\r\nLittle does Luke know that the\r\nGALACTIC EMPIRE has secretly\r\nbegun construction on a new\r\narmored space station even\r\nmore powerful than the first\r\ndreaded Death Star.\r\n\r\nWhen completed, this ultimate\r\nweapon will spell certain doom\r\nfor the small band of rebels\r\nstruggling to restore freedom\r\nto the galaxy...",
169169
"characters": [
170170
1,
@@ -232,7 +232,7 @@
232232
"created": "2014-12-19T16:52:55.740Z",
233233
"episode_id": 1,
234234
"director": "George Lucas",
235-
"release_date": "1999-05-19",
235+
"release_date": "1999-05-19",
236236
"opening_crawl": "Turmoil has engulfed the\r\nGalactic Republic. The taxation\r\nof trade routes to outlying star\r\nsystems is in dispute.\r\n\r\nHoping to resolve the matter\r\nwith a blockade of deadly\r\nbattleships, the greedy Trade\r\nFederation has stopped all\r\nshipping to the small planet\r\nof Naboo.\r\n\r\nWhile the Congress of the\r\nRepublic endlessly debates\r\nthis alarming chain of events,\r\nthe Supreme Chancellor has\r\nsecretly dispatched two Jedi\r\nKnights, the guardians of\r\npeace and justice in the\r\ngalaxy, to settle the conflict....",
237237
"characters": [
238238
2,
@@ -335,7 +335,7 @@
335335
"created": "2014-12-20T10:57:57.886Z",
336336
"episode_id": 2,
337337
"director": "George Lucas",
338-
"release_date": "2002-05-16",
338+
"release_date": "2002-05-16",
339339
"opening_crawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nThis separatist movement,\r\nunder the leadership of the\r\nmysterious Count Dooku, has\r\nmade it difficult for the limited\r\nnumber of Jedi Knights to maintain \r\npeace and order in the galaxy.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
340340
"characters": [
341341
2,
@@ -451,7 +451,7 @@
451451
"created": "2014-12-20T18:49:38.403Z",
452452
"episode_id": 3,
453453
"director": "George Lucas",
454-
"release_date": "2005-05-19",
454+
"release_date": "2005-05-19",
455455
"opening_crawl": "War! The Republic is crumbling\r\nunder attacks by the ruthless\r\nSith Lord, Count Dooku.\r\nThere are heroes on both sides.\r\nEvil is everywhere.\r\n\r\nIn a stunning move, the\r\nfiendish droid leader, General\r\nGrievous, has swept into the\r\nRepublic capital and kidnapped\r\nChancellor Palpatine, leader of\r\nthe Galactic Senate.\r\n\r\nAs the Separatist Droid Army\r\nattempts to flee the besieged\r\ncapital with their valuable\r\nhostage, two Jedi Knights lead a\r\ndesperate mission to rescue the\r\ncaptive Chancellor....",
456456
"characters": [
457457
1,

swapi/static/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
}
1717

1818
.subscribe_btn {
19-
margin-left: -100px!;
19+
margin-left: -100px;
2020
}

0 commit comments

Comments
 (0)