These are chat archives for django/django

Jul 2017
Michele Gatti
Jul 04 2017 07:12
i need to schedulate a custom command inside a docker image there is any tips?
Joseph Christopher
Jul 04 2017 12:03
@mikeleg Have you tried
Nishant Suman
Jul 04 2017 12:56
@Dexter_Deter_twitter You are including your project Instaed you have to include your app file. url(r'^$', include(app.urls)). You have create a in your app and then add urls for that app there.
Michele Gatti
Jul 04 2017 14:21
@josephcs thanks i'll try it
Jul 04 2017 14:55
In django rest framework , how we can implement pagination , my api respond with array of objects in json, how i can implement a count and offset based pagination?
Hassen ben tanfous
Jul 04 2017 14:57
Jul 04 2017 15:07
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
    'PAGE_SIZE': 100
i added this to my , doesn't seem to be working
do i need to make some changes to my , i am using function based views
Jul 04 2017 15:22
@HassenPy thanks
Hassen ben tanfous
Jul 04 2017 15:22
welcome :)
Jul 04 2017 15:46
hey guys, how would I go about adding a like functionality to my app ?
one user can make infinite likes if he has time to theoretically in my app as it stands now .. because i dont check anything except the authentication
and the user is able to like
and just spam
how would I go about making the functionality that way that you like once, and its acknowledged that the post is liked and when you click the button again, it will be unliked
Anish Shrestha
Jul 04 2017 16:59
post_user_liked flag may be.
Job Matheka
Jul 04 2017 17:51

Hey guys,
I have deployed a django app to an ec2 instance running ubuntu and am using apache2 to load my site.
but for some reason my app wont find the templates, i get TemplateDoesNotExist exception.
here is my TEMPLATES in

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR, 'templates'),
            os.path.join(BASE_DIR, '../templates'),
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [

my main urls:

urlpatterns = [
    # core application urls
    url(r'^', include('core.urls', namespace="core")),

    # user login n logout
    url(r'^accounts/login/$', django.contrib.auth.views.login, name="login"),
    url(r'^logout/$', django.contrib.auth.views.logout, {'next_page': '/'}, name='logout'),

    # admin

and my app urls:

urlpatterns = [
    url(r'^$', IndexView.as_view(), name="index"),
    url(r'^save_data$', SaveDataToDBView.as_view(), name="save_data"),
    url(r'^export_data$', ExportDataView.as_view(), name="export_data"),
    url(r'^oauth-redirect$', OAuthView.as_view(), name="oauth_redirect"),

templates tree:

└── templates
    ├── base.html
    ├── core
    │   └── Index.html
    └── registration
        └── login.html

template_name = ‘core/index.html’ in my TemplateView.
What could be the problem.