diff --git a/Dockerfile b/Dockerfile index 1b1a3ee..0a0519a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 LABEL name='pygmy' LABEL version='1.0.0' diff --git a/README.md b/README.md index bd3c0d4..96973fc 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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": "amit@gmail.com", diff --git a/pygmyui/pygmyui/settings.py b/pygmyui/pygmyui/settings.py index 068c68d..d0d6653 100644 --- a/pygmyui/pygmyui/settings.py +++ b/pygmyui/pygmyui/settings.py @@ -137,6 +137,8 @@ os.path.join(BASE_DIR, "static"), ] +STATIC_ROOT = os.path.join(BASE_DIR, "static") + ALLOWED_HOSTS = ['*'] # Pygmy Settings diff --git a/pygmyui/pygmyui/urls.py b/pygmyui/pygmyui/urls.py index 429b9f1..f028b17 100644 --- a/pygmyui/pygmyui/urls.py +++ b/pygmyui/pygmyui/urls.py @@ -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 @@ -24,6 +25,7 @@ url(r'^contact', views.contact), url(r'', include('user_auth.urls')), url(r'', include('pygmy.urls')), + url(r'^static/(?P.*)$', serve,{'document_root': settings.STATIC_ROOT}), ] if settings.DEBUG is True: diff --git a/requirements.txt b/requirements.txt index 6b3b554..a03bc0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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