From 226ec2a7c8763fceacb26ac1e0a5118f9e3b2a2b Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 12:52:42 +0430 Subject: [PATCH 1/8] add .veve to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b00f1b..2697a46 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ ENV/ # SQLite3 db.sqlite3 +.venv \ No newline at end of file From 82c8341ebfad364d02d968ec4b31c0d9d0aa4f61 Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 14:48:58 +0430 Subject: [PATCH 2/8] update django --- requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6eb9d54..6cebd37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Django==1.10.5 -django-cors-middleware==1.3.1 -django-extensions==1.7.1 -djangorestframework==3.4.4 -PyJWT==1.4.2 -six==1.10.0 +Django +django-cors-middleware +django-extensions +djangorestframework +PyJWT +six \ No newline at end of file From 5c7b9ba926381f38a4fc472de2f93ab877bac015 Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 14:49:17 +0430 Subject: [PATCH 3/8] update django url --- conduit/urls.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conduit/urls.py b/conduit/urls.py index 54612f9..4f33d05 100644 --- a/conduit/urls.py +++ b/conduit/urls.py @@ -19,7 +19,7 @@ urlpatterns = [ url(r'^admin/', admin.site.urls), - url(r'^api/', include('conduit.apps.articles.urls', namespace='articles')), - url(r'^api/', include('conduit.apps.authentication.urls', namespace='authentication')), - url(r'^api/', include('conduit.apps.profiles.urls', namespace='profiles')), + url(r'^api/', include(('conduit.apps.articles.urls','conduit.apps.articles'), namespace='articles')), + url(r'^api/', include(('conduit.apps.authentication.urls','conduit.apps.authentication'), namespace='authentication')), + url(r'^api/', include(('conduit.apps.profiles.urls','conduit.apps.profiles'), namespace='profiles')), ] From e1446a15eb670dedcbf0b9b6c8874065e5f350af Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 14:56:11 +0430 Subject: [PATCH 4/8] update --- requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6cebd37..1240c83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Django -django-cors-middleware -django-extensions -djangorestframework -PyJWT -six \ No newline at end of file +Django==3.2.3 +django-cors-middleware==1.5.0 +django-extensions==3.1.3 +djangorestframework==3.12.4 +PyJWT==2.1.0 +six==1.16.0 From 68f690b47d1d2476e7155d9253a26db7f78ef1ac Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 15:05:33 +0430 Subject: [PATCH 5/8] update django --- conduit/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conduit/settings.py b/conduit/settings.py index 17b2df7..6cafc93 100644 --- a/conduit/settings.py +++ b/conduit/settings.py @@ -130,8 +130,9 @@ STATIC_URL = '/static/' CORS_ORIGIN_WHITELIST = ( - '0.0.0.0:4000', - 'localhost:4000', + 'localhost:8000', + 'localhost:3000', + 'localhost:8080', ) # Tell Django about the custom `User` model we created. The string From 40066e0b56e4e519bf15d248380ec2322624e65f Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 15:50:38 +0430 Subject: [PATCH 6/8] update10 --- conduit/apps/profiles/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conduit/apps/profiles/serializers.py b/conduit/apps/profiles/serializers.py index b799082..4d2ee8c 100644 --- a/conduit/apps/profiles/serializers.py +++ b/conduit/apps/profiles/serializers.py @@ -26,7 +26,7 @@ def get_following(self, instance): if request is None: return False - if not request.user.is_authenticated(): + if not request.user.is_authenticated: return False follower = request.user.profile From b5bcf68dbfeadf5be3651c9d6e512aa53094f69b Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 15:51:17 +0430 Subject: [PATCH 7/8] update 11 --- conduit/settings.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/conduit/settings.py b/conduit/settings.py index 6cafc93..a906e0b 100644 --- a/conduit/settings.py +++ b/conduit/settings.py @@ -130,9 +130,8 @@ STATIC_URL = '/static/' CORS_ORIGIN_WHITELIST = ( - 'localhost:8000', - 'localhost:3000', - 'localhost:8080', + 'http://0.0.0.0:4000', + 'http://localhost:4000', ) # Tell Django about the custom `User` model we created. The string From c5fb4960c11b18654b403a2de6d9456e92d8e9ba Mon Sep 17 00:00:00 2001 From: mr70mr Date: Wed, 19 May 2021 15:51:26 +0430 Subject: [PATCH 8/8] update --- conduit/apps/articles/admin.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 conduit/apps/articles/admin.py diff --git a/conduit/apps/articles/admin.py b/conduit/apps/articles/admin.py new file mode 100644 index 0000000..e096146 --- /dev/null +++ b/conduit/apps/articles/admin.py @@ -0,0 +1,23 @@ +from django.contrib import admin +from .models import * + +class ArticleAdmin(admin.ModelAdmin): + list_display = ['slug', 'title', 'description'] + + +admin.site.register(Article, ArticleAdmin) + + +class CommentAdmin(admin.ModelAdmin): + search_fields = ['author', 'body'] + list_display = ['author', 'body'] + + +admin.site.register(Comment, CommentAdmin) + + +class TagAdmin(admin.ModelAdmin): + list_display = ['tag', 'slug'] + + +admin.site.register(Tag, TagAdmin) \ No newline at end of file