Skip to content

Commit

Permalink
Serve static file with debug false. Ubunut20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
amitt001 committed Jul 17, 2022
1 parent 88c7c31 commit 7a9e1ce
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

LABEL name='pygmy'
LABEL version='1.0.0'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Hackernews Thread: [https://news.ycombinator.com/item?id=17690559](https://pygy.
- [Use SQLite](#use-sqlite)
- [Docker](#docker-1)
- [Using Pygmy API](#using-pygmy-api)
- [Create User:](#create-user)
- [Create User](#create-user)
- [Shell Usage](#shell-usage)
- [Development](#development)
- [Run tests:](#run-tests)
Expand Down Expand Up @@ -159,7 +159,7 @@ Docker image name: `amit19/pygmy`. Docker image can be built by running `docker

## Using Pygmy API

### Create User:
### Create User

curl -XPOST http://127.0.0.1:9119/api/user/1 -H 'Content-Type: application/json' -d '{
"email": "[email protected]",
Expand Down
2 changes: 2 additions & 0 deletions pygmyui/pygmyui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
os.path.join(BASE_DIR, "static"),
]

STATIC_ROOT = os.path.join(BASE_DIR, "static")

ALLOWED_HOSTS = ['*']

# Pygmy Settings
Expand Down
2 changes: 2 additions & 0 deletions pygmyui/pygmyui/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""
from django.conf import settings
from django.urls import re_path as url, include
from django.views.static import serve
import pygmyui.generic_views as views


Expand All @@ -24,6 +25,7 @@
url(r'^contact', views.contact),
url(r'', include('user_auth.urls')),
url(r'', include('pygmy.urls')),
url(r'^static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}),
]

if settings.DEBUG is True:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ urllib3==1.26.10
Werkzeug==2.1.2
yarl==1.7.2
zipp==3.8.0
django-cors-headers==3.13.0

0 comments on commit 7a9e1ce

Please sign in to comment.