Re: Customise Session Engine to distribute session data storage

2018-08-27 Thread Web Architect
Hi Jason, Thanks for the response. Why not use Django's cache backend and setting cache alias to be redis? Thanks. On Monday, August 27, 2018 at 5:01:08 PM UTC+5:30, Jason wrote: > > there's an option to use redis as a session backend, which would be faster > than using a regular db, even a

ManyToMany relationship with through_fields and Admin

2018-08-27 Thread Vincen
Hello, I'm new to Django and i'm trying to made a simple app in which users can attend to an event. I'm trying to have this manageable through the admin site but i get the following error : : (admin.E202) fk_name 'attendees' is not a ForeignKey to 'evenement.Events'. My goal is to have an

Django development server: expect header.

2018-08-27 Thread Ayeni Adedayo
I asked this question on the #django IRC, but thought to put it here too. Over the weekend, I ran into an unexpected problem with the Django development server. It seems to either ignore or not properly handle the expect header. I understand that modern http clients will send an 100-continue

Re: django website hosting

2018-08-27 Thread victor jack
Check out the documentation on digital ocean On Sat, 25 Aug 2018 15:36 ERICK OMONDI AYARA, wrote: > I would like to host a django project onto a web domain but cant seem to > get around it. i cant also find the python setup on the SOFTWARE section of > my file manager. Is there a way to do

Re: Django database problem

2018-08-27 Thread Mikko Meronen
Yes it seems that I can influence to the 'jumps' with my management command. First my bot went through tens of items per loop, however when I changed the bot to check only 2 items per loop, the 'jumps' got smaller. So even though the table rows do not accrue (nothing is added) when no new items

Re: Printing model fields organized by category

2018-08-27 Thread Jay
Thank you so much! That worked!! On Monday, August 27, 2018 at 12:16:09 PM UTC-4, Matthew Pava wrote: > > Oh, yes. I do it all the time myself. > > > > You need to change > > > > category.model_set > > > > to > > > > category.model_set.all > > > > model_set is the manager. You need to

Re: Printing model fields organized by category

2018-08-27 Thread Jay
Error received: path('category/', views.CategoryListview.as_view(), name='categories'), AttributeError: module 'catalog.views' has no attribute 'CategoryListview' Thanks for your help I greatly appreciate it. On Monday, August 27, 2018 at 12:16:09 PM UTC-4, Matthew Pava wrote: > > Oh, yes.

Trying to replace a char field with a forgein key feild

2018-08-27 Thread mattstroud via Django users
So when we started the database, it was good enough to have a char field with choices. But as time progressed I need to convert that field to a foreign key field. The follow I'm trying to take is such: 1. rename to tmp_ 2. create a new field with 3. have a RunPython fill the data

Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-08-27 Thread Alex Kimeu
*#Import auth views* from django.contrib.auth import views as auth_views *#Use the views in the url* path('login/', auth_views.LoginView.as_view(), name='login'), Happy coding! On Mon, Aug 27, 2018 at 6:29 PM Tim Vogt (Tim Vogt) wrote: > Hi Jason, > Thank ! > > my urls.py in /users looks

RE: Printing model fields organized by category

2018-08-27 Thread Matthew Pava
Okay, your URL should point to your CategoryListView. That should have category_list in its context. And the template should in the category_list template. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Jay Sent: Monday, August 27, 2018 10:28 AM To:

Re: Printing model fields organized by category

2018-08-27 Thread Jay
Thanks Matthew, here is my views.py file: from django.shortcuts import render #generates HTML fiels using a template and data #from django.http import HttpResponse from .models import Book, Author, BookInstance, Genre, Model, ModelInstance, Category, Ownership, Manufacturer, Location #imports

Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-08-27 Thread Jason
you changed the import to something else, right? but you didn't change the actual use of the old import to the new. On Monday, August 27, 2018 at 8:05:03 AM UTC-4, Tim Vogt wrote: > > Thanks I tired bout get another error > > File "/Users/timvogt/Software_projects/learning_log/users/urls.py",

RE: Printing model fields organized by category

2018-08-27 Thread Matthew Pava
We need to see your view code. I’m assuming now that you don’t have category_list in your context variable that you submitted to the template. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Jay Sent: Monday, August 27, 2018 9:20 AM To: Django users

Re: Printing model fields organized by category

2018-08-27 Thread Jay
Thanks for the suggestions, I will change the name from Model after I can get this working. So, I've changed the code using your help to: {% if category_list %} {% for category in category_list %} {{ category }} {% for model in category.model_set %}

Base Views error importing articles.models

2018-08-27 Thread Sandy Leon
Hello everyone, I am trying to add another simple 'home' page to my website which is at this point just the basic site after you finish the tutorial. I am following the 'Base Views' documentation but keep getting an error when trying to import 'from articles.models import Articles' the error

RE: "to" argument must be a list or tuple

2018-08-27 Thread Matthew Pava
Make it a list or tuple by surrounding it in brackets or parentheses. [user.email] or (user.email, ) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Damandeep Singh Sent: Monday, August 27, 2018 6:08 AM To: Django users Subject: "to" argument must be a

Re: Help.... Django : Change Backend as mysql and create sample example using django ORM

2018-08-27 Thread Andréas Kühne
Hi, Check out this tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-a-django-app-and-connect-it-to-a-database It's hard to know what you need help with without any more detailed descriptions. Regards, Andréas Den mån 27 aug. 2018 kl 14:08 skrev Sonali Vighne : > Hi,

Help.... Django : Change Backend as mysql and create sample example using django ORM

2018-08-27 Thread Sonali Vighne
Hi, I have tried a lot to change Django back-end as MySQL but not able to achieve this. please help for the same. thanks in advance. :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-08-27 Thread Tim Vogt (Tim Vogt)
Thanks I tired bout get another error File "/Users/timvogt/Software_projects/learning_log/users/urls.py", line 15, in url('login/', login, {'template_name': 'users/login.html'}, name='login'), NameError: name 'login' is not defined """Defines URL patterns for users""" from

Re: Django database problem

2018-08-27 Thread Andréas Kühne
I have looked at this several times myself. :-) Regards, Andréas Den mån 27 aug. 2018 kl 13:33 skrev Jason : > oh, good catch. I didn't think of that, but you're right. > > > https://stackoverflow.com/questions/449346/mysql-auto-increment-does-not-rollback > > On Monday, August 27, 2018 at

Re: Django database problem

2018-08-27 Thread Jason
oh, good catch. I didn't think of that, but you're right. https://stackoverflow.com/questions/449346/mysql-auto-increment-does-not-rollback On Monday, August 27, 2018 at 3:50:28 AM UTC-4, Andréas Kühne wrote: > > The management command could be wrapped within a transaction, this would > then

Re: Customise Session Engine to distribute session data storage

2018-08-27 Thread Jason
there's an option to use redis as a session backend, which would be faster than using a regular db, even a well tuned mysql/postgres instance https://github.com/martinrusev/django-redis-sessions On Monday, August 27, 2018 at 3:52:06 AM UTC-4, Web Architect wrote: > > Hi, > > Right now we are

Re: TypeError at /users/login/ login() got an unexpected keyword argument 'template_name'

2018-08-27 Thread Jason
you're importing the wrong login. you need to import the login view. almost there, just from django.contrib.auth.views import LoginView -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

"to" argument must be a list or tuple

2018-08-27 Thread Damandeep Singh
from templated_email import send_templated_mail from django.contrib.auth.tokens import default_token_generator def send_activation_mail(user): token = default_token_generator.make_token(user) print('token >', token) send_templated_mail( template_name='welcome',

Re: Help me with this, plz

2018-08-27 Thread Sonali Vighne
hey , have you get any solutions for mysql? On Friday, August 17, 2018 at 11:46:31 AM UTC+5:30, Vikrant Gupta wrote: > > sick of this error... what to do? > > antuptasMBP:New_Django vikrantgupta$ python manage.py migrate > Traceback (most recent call last): > File "manage.py", line 15, in >

Customise Session Engine to distribute session data storage

2018-08-27 Thread Web Architect
Hi, Right now we are using the Django cache_db session engine for persistent sessions and also for some speed. Is it possible to customise this where I can store some session data in cache and some in DB? For example, I want to store all login sessions in DB and rest like some user specific

Re: Django database problem

2018-08-27 Thread Andréas Kühne
The management command could be wrapped within a transaction, this would then in the database create a lot of models, but if the transaction fails - the rollback will not reset the database id. Regards, Andréas Den sön 26 aug. 2018 kl 12:29 skrev Mikko Meronen < mikkovillemero...@gmail.com>:

Re: Problem: django url Admin/ is autmatically coverted to admin/

2018-08-27 Thread Andréas Kühne
Please remember that url's are not case sensitive - even though python is. So /admin/ and /Admin/ are the same path Regards, Andréas Den lör 25 aug. 2018 kl 20:27 skrev Devender Kumar : > i have separate Admin app and using admin also but when I am accessing > Admin/trips is accessed and

Re: What determines where manage.py is created

2018-08-27 Thread Andréas Kühne
Hi, When you say that you created a DO droplet and can't find manage.py - what exactly do you mean? If you want to run django on a DO server you should follow the installation instructions here: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-local-django-app-to-a-vps It's an