Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Updatedjango #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ ENV/

# SQLite3
db.sqlite3

.venv
24 changes: 24 additions & 0 deletions conduit/apps/articles/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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)
2 changes: 1 addition & 1 deletion conduit/apps/articles/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_favorited(self, instance):
if request is None:
return False

if not request.user.is_authenticated():
if not request.user.is_authenticated:
return False

return request.user.profile.has_favorited(instance)
Expand Down
2 changes: 1 addition & 1 deletion conduit/apps/profiles/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions conduit/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
]
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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==3.3.4
django-cors-middleware==3.3.4
django-extensions==3.3.4
djangorestframework==3.3.4
PyJWT==3.3.4
six==3.3.4