-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00888c9
commit 091da77
Showing
7 changed files
with
85 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM ubuntu:trusty | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y python-software-properties software-properties-common | ||
RUN add-apt-repository -y ppa:chris-lea/node.js | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential git htop tmux pv \ | ||
postgresql libpq-dev \ | ||
python-pip python-dev libjpeg-dev zlib1g-dev \ | ||
nodejs | ||
|
||
RUN npm install -g grunt-cli bower | ||
|
||
ADD requirements.txt /src/ | ||
WORKDIR /src | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
ADD package.json bower.json .bowerrc /src/ | ||
RUN npm install | ||
|
||
RUN bower install --allow-root | ||
|
||
ADD setup.py manage.py Makefile /src/ | ||
ADD example /src/example | ||
ADD scripts /src/scripts | ||
RUN python setup.py develop | ||
|
||
ADD Gruntfile.coffee /src/ | ||
RUN grunt | ||
|
||
RUN make create_database | ||
RUN make make_fixtures | ||
|
||
EXPOSE 8000 8000 | ||
|
||
CMD ["./manage.py", "runserver", "0.0.0.0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
from django.conf.urls import patterns, url, include | ||
from django.conf.urls import url, include | ||
|
||
from .api import UserList, UserDetail | ||
from .api import PostList, PostDetail, UserPostList | ||
from .api import PhotoList, PhotoDetail, PostPhotoList | ||
|
||
user_urls = patterns('', | ||
user_urls = [ | ||
url(r'^/(?P<username>[0-9a-zA-Z_-]+)/posts$', UserPostList.as_view(), name='userpost-list'), | ||
url(r'^/(?P<username>[0-9a-zA-Z_-]+)$', UserDetail.as_view(), name='user-detail'), | ||
url(r'^$', UserList.as_view(), name='user-list') | ||
) | ||
] | ||
|
||
post_urls = patterns('', | ||
post_urls = [ | ||
url(r'^/(?P<pk>\d+)/photos$', PostPhotoList.as_view(), name='postphoto-list'), | ||
url(r'^/(?P<pk>\d+)$', PostDetail.as_view(), name='post-detail'), | ||
url(r'^$', PostList.as_view(), name='post-list') | ||
) | ||
] | ||
|
||
photo_urls = patterns('', | ||
photo_urls = [ | ||
url(r'^/(?P<pk>\d+)$', PhotoDetail.as_view(), name='photo-detail'), | ||
url(r'^$', PhotoList.as_view(), name='photo-list') | ||
) | ||
] | ||
|
||
urlpatterns = patterns('', | ||
urlpatterns = [ | ||
url(r'^users', include(user_urls)), | ||
url(r'^posts', include(post_urls)), | ||
url(r'^photos', include(photo_urls)), | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Django>=1.7 | ||
djangorestframework<3.0 | ||
Django>=1.9 | ||
djangorestframework>=3.3 | ||
pillow | ||
|
||
# Optional | ||
|