Prevent site from requiring new login

2018-04-03 Thread Larry Martell
I have a site that, once a user logs in I would like them to never get logged out. I have set SESSION_COOKIE_AGE = sys.maxint but still, after some amount of time (I don't know exactly how long, but it's around 12 hours) the users get a login page. Is there a way to accomplish this? -- You receiv

Re: Django admin without Groups and Permissions. Can "groups and permissions" tables become a bottleneck?

2018-04-03 Thread Mike Dewhirst
On 4/04/2018 6:14 AM, Mateusz Kurowski wrote: I don't need groups and permissions, but i want to use django admin. Ive created this simple AbstractSuperUser that looks to solve this case. But i wonder if thats best idea. Can "groups and permissions" tables become a bottleneck in the future ev

Not Found "/lobby/" django-channels routing error

2018-04-03 Thread Mike Johnson Jr
routing.py from channels import include, route from chat import consumers from . import game_consumers channel_routing = [ #game routing route('websocket.connect', game_consumers.ws_connect_lobby, path=r"^/lobby/$"), route('websocket.receive', game_consumers.ws_re

Re: Django 1.11 and Python 3 SQLite Migration "table already exists"

2018-04-03 Thread Alex Laird
Finally found the solution. I have marked it as the answer on my Stackoverflow question here: https://stackoverflow.com/a/49641729/1128413 On Tuesday, April 3, 2018 at 2:52:55 PM UTC-7, Alex Laird wrote: > > I've recently started receiving an error that I'm having trouble > identifying with a Dj

Re: New Add-On: Django Model Lifecycle Hooks

2018-04-03 Thread Robert Singer
Hello, Thanks to Jani Tiainen, the library now supports Django 1.8 and up, and has more robust testing using tox. On Sunday, April 1, 2018 at 3:49:04 AM UTC-5, Jani Tiainen wrote: > > Hi, > > Quite interesting feature have to say. You should use tox to run tests > against different versions o

Re: Trouble deploying Django/wagtail on Ubuntu 14.04

2018-04-03 Thread drone4four
Thank you for your reply, Tom. Here it is running as intended: https://daniel496.agency/ Inside the TEMPLATES variable, the line for ‘DIRS’ now a list which now reads: [PROJECT_ROOT + '/bakerydemo/templates'] 'DIRS': [PROJECT_ROOT + '/bakerydemo/templates'], M project root directory

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread carlos
[i.fields for i in self.ingredients.objects.all()] fields is you method __str__ back, try comments __str__ method in model Ingredients or this function get_ingredient create in admin files and used obj parameter cheers On Tue, Apr 3, 2018 at 10:34 AM, Muhammad bin-haneef wrote: > kindly share

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread Muhammad bin-haneef
kindly share the code where you registered your product for admin site and you are calling "get_ ingredients()" method. As the error shows your method needs 2 arguments to pass when you call "get_ ingredients()". On Tue, Apr 3, 2018 at 12:05 PM, mansi thakkar wrote: > It is there in ProductIngr

Django 1.11 and Python 3 SQLite Migration "table already exists"

2018-04-03 Thread Alex Laird
I've recently started receiving an error that I'm having trouble identifying with a Django 1.11 project using SQLite in development. The project linked below was/is previously Python 2/3 compatible, though I primarily ran it using Python 2. Recently, I switched over most of my computers and pro

Creating a model instance using currently logged in user

2018-04-03 Thread 'Simon Connah' via Django users
Hi, Apologies as this is a newbie question. I have a Model, a CBV CreateView and a ModelForm. The ModelForm is set to use the model, and the model has a field called author which is a ForeignKey to default Django auth User model. I have removed the author field from the ModelForm as if I allow

Django admin without Groups and Permissions. Can "groups and permissions" tables become a bottleneck?

2018-04-03 Thread Mateusz Kurowski
I don't need groups and permissions, but i want to use django admin. Ive created this simple AbstractSuperUser that looks to solve this case. But i wonder if thats best idea. Can "groups and permissions" tables become a bottleneck in the future even if i dont use any groups and permissions on a

Re: Templates and URL Mappings

2018-04-03 Thread Will Burchell
Daniel, thank you so much! I had been eyeing my regex with suspicion by was looking at the wrong pattern. Many thanks again, all appeas to be working fine now :) On Monday, 2 April 2018 12:27:56 UTC+1, Daniel Roseman wrote: > > On Monday, 2 April 2018 12:00:31 UTC+1, Will Burchell wrote: > > >

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread mansi thakkar
Yes I have. But it didn't work. Basically my product has many ingredients and on ingredient is contained in many products so all I need is just display product with all the ingredients it contains on admin site. On Tuesday, April 3, 2018 at 12:48:34 PM UTC-4, Julio Biason wrote: > > It seems you

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread Julio Biason
It seems your `get_ingredients()` is expecting the Product itself and another object (for some reason). Have you tried to remove `obj` from the parameters and use `self` in that function? On Tue, Apr 3, 2018 at 12:22 PM, mansi thakkar wrote: > Hello , > > In my database, there is one table name

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread mansi thakkar
It is there in ProductIngredient.png. On Tuesday, April 3, 2018 at 11:57:38 AM UTC-4, squal poreover wrote: > > I need to see get_ingredients() . To guess what's happening? > > On Tue, 3 Apr 2018, 21:22 mansi thakkar, > wrote: > >> Hello , >> >> In my database, there is one table named Product an

Re: Display Many to Many Field in Django admin site

2018-04-03 Thread squal poreover
I need to see get_ingredients() . To guess what's happening? On Tue, 3 Apr 2018, 21:22 mansi thakkar, wrote: > Hello , > > In my database, there is one table named Product and the other table is > Ingredient. Both are related with ManyToMany Relationship using bridge > entity (table) named Produ

Re: Django CORS not working.

2018-04-03 Thread Elorm Koku
Which browsers are you using.. it could probably be that cors is disabled in your browser. Try switching on cors in your browser ...if you don't have it as an extension just add it up On Tue, 3 Apr 2018, 11:08 , wrote: > Response in Console:- > > Cross-Origin Request Blocked: The Same Origin Po

Re: How to run an external command that must run with the server

2018-04-03 Thread 'Alex' via Django users
Yes, it runs constantly, whenever the server is up. Ok, I'll stick with the management command as a supervisor process, thank you! On Tuesday, 3 April 2018 14:09:40 UTC+1, Ken Whitesell wrote: > > There's an aspect of your situation which isn't entirely clear to me - is > this management command

Re: How to run an external command that must run with the server

2018-04-03 Thread Ken Whitesell
There's an aspect of your situation which isn't entirely clear to me - is this management command one that remains running all the time, like a Celery task would be; or is it one that starts, runs a process for a period of time, and then ends - only to be restarted at a later time? If the former

Django CORS not working.

2018-04-03 Thread contact
Response in Console:- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://blissedmaths.sgp1.digitaloceanspaces.com/media/topics/4276769703/4276769703.svg. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). I have user django-cors

Re: How to run an external command that must run with the server

2018-04-03 Thread 'Alex' via Django users
That makes sense. So leave the source as a management command (as it is now), and just run python manage.py source through supervisor? On Sunday, 1 April 2018 13:16:38 UTC+1, Ken Whitesell wrote: > > We set up all our Django-related processes as a group under supervisor. > This includes our cel

my django dsahbord css link not working

2018-04-03 Thread arvind yadav
my setting.py file code please help me """ Django settings for mytestmoody project. Generated by 'django-admin startproject' using Django 2.0.3. For more informat