FileField - not stored to disk when using mod_wsgi?

2017-11-27 Thread Joakim Hove
I ave django file upload application. I have a model looking like this: class BaseFile(Model): input_name = CharField( max_length = 132 ) content = FileField( upload_to = "%Y/%m/%d" ) upload_time = DateTimeField( auto_now_add=True ) owner_group = CharField( max_length = 32 ,

Re: Error on execute migration (create index) when set db_name with quoted string

2017-11-27 Thread Simon Charette
Hey Carlos, I believe the trailing quote truncation issue might be solved in the yet to be released 1.11.8[0][1] version. Could you confirm whether or not it's the case? You'll have to regenerate your migration. Best, Simon [0]

Re: Error on execute migration (create index) when set db_name with quoted string

2017-11-27 Thread Carlos Leite
ooops in the migration 0007 the index name seems badly formed ```python ... migrations.AddIndex( model_name='publisher', index=models.Index(fields=['name'], name='"big_name-w_name_cd0539_idx'), # <<< there is a " in plus. and its never closed. ), ``` On Tuesday,

Error on execute migration (create index) when set db_name with quoted string

2017-11-27 Thread Carlos Leite
I was making some introspections on meta attributes from a Model class jsut to check what changes when we set some attributes on Meta class and etc... TO check the Meta.db_name I read the docs and saw that I could use quoted strings as told .. " ... o prevent such transformations, use a

Help login() session always expire on new migrated apache server

2017-11-27 Thread dk . dannykurniawan
Hello, I used django login() in some code and it worked now in current server. Odd enough that in new server (migrated), the login session gone when i check with @login_required. Keep asking to login. The server have the same apache config with old server. Please help. Thank you -- You

Re: django-allauth facebook doesn't collect more information other than "name" and "id"

2017-11-27 Thread Shahab Emami
hello i have the same problem but for the google. this is my settings: SOCIALACCOUNT_PROVIDERS = { 'google': { 'SCOPE': ['email', 'https://www.googleapis.com/auth/user.birthday.read',

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-27 Thread Filbert
Sorry, yeah dig before I post :-| Can create a class-based consumer and use the message->headers->host. I'll get chest deep before ask another question. On Monday, November 27, 2017 at 6:04:48 PM UTC-5, Andrew Godwin wrote: > > That would be correct (though please be aware Origin can be faked

Re: Does django work with bootstrap 4

2017-11-27 Thread Andréas Kühne
Hi, You don't have to learn any ruby to use sass. I prefer sass when I create my css files. You do however need to know howto compile scss files into css. You should be able to find howtos on google. You could also try: https://github.com/jrief/django-sass-processor, then you don't even have to

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Matemática A3K
On Mon, Nov 27, 2017 at 7:58 PM, Kubilay Yazoğlu . wrote: > Oh, that's a life saver information. Thanks. I edited my code. > Unfortunately, only thing that has changed is the name of the error which > looks like this right now: NOT NULL constraint failed: >

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-27 Thread Andrew Godwin
That would be correct (though please be aware Origin can be faked like host headers, so don't use it as the sole point of security). Is it not available via the headers list in the connect message? Andrew On Mon, Nov 27, 2017 at 2:58 PM, Filbert wrote: > Thanks again. One

Does django work with bootstrap 4

2017-11-27 Thread Gordon Neal
Looking to start a web design projects and as a python programmer I would like to use django but it seems difficult. I am planning on using bs v 4 with Sass. This is a new project. Any solution so I don't have to learn the whole ruby stuf -- You received this message because you are subscribed

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-27 Thread Filbert
Thanks again. One last question, in order to "multi-tenant-ify" Channels I think the challenge will be trickle the websocket "orgin" into the consumer from Daphne somehow as it seems there is no way to know in a consumer which tenant (unique domain) the message originated from. Without the

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu .
Oh, that's a life saver information. Thanks. I edited my code. Unfortunately, only thing that has changed is the name of the error which looks like this right now: NOT NULL constraint failed: photo_photo.contest_id I'm going to take a break and try to solve the problem tomorrow. I appreciate your

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Matemática A3K
On Mon, Nov 27, 2017 at 7:30 PM, Matemática A3K wrote: > > > On Mon, Nov 27, 2017 at 7:18 PM, Kubilay Yazoğlu > wrote: > >> Nice try but I'm still getting this error: IntegrityError at >> /photo/create/ >> >> NOT NULL constraint failed:

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Matemática A3K
On Mon, Nov 27, 2017 at 7:18 PM, Kubilay Yazoğlu wrote: > Nice try but I'm still getting this error: IntegrityError at > /photo/create/ > > NOT NULL constraint failed: photo_photo.contest_id_id > > > I tried with both 'contest': random_item and 'contest_id': >

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Nice try but I'm still getting this error: IntegrityError at /photo/create/ NOT NULL constraint failed: photo_photo.contest_id_id I tried with both 'contest': random_item and 'contest_id': random_item.contest_id. (I don't know why you wrote contest instead of contest_id. Field name is

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Matemática A3K
> items = Contest.objects.all() > random_item = random.choice(items) > > if request.method =='POST': > data = {'contest': random_item, > 'ownername': 'SUMMERSON', > } > form=PhotoForm(request.POST, initial=data) > if form.is_valid(): > photo =

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Yes, photo_id is PK. So I shouldn't even give its value to the form in initial values I guess? Contest_id isn't PK, I want to select a random contest id from contest objects. (I decided to do this just now, my former code does not include this :) ) By the way, contest_id is foreign key in

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Matemática A3K
You shouldn't give the PK of new objects, leave that to Django. If photo_id is the PK of Photo, don't set it, Django will on save. If the same goes for Contest, then do a "contest = Contest()" - create a new contest - and assign it to the photo "photo.contest = contest", then "photo.save" On

NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Hi. I'm trying to create a form to construct an object for my Photo class. All of the objects fields except the photo itself will be invisible to the user. So, the only thing can be seen in the form is the button to select and upload the photo. There is no problem with creating the form page.

Re: AutocompleteSelect and AutocompleteSelectMultiple admin widgets.

2017-11-27 Thread Tim Graham
They're used when you use ModelAdmin.autocomplete_fields. https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields On Monday, November 27, 2017 at 3:27:30 AM UTC-5, Daniel Gola wrote: > > Hello, > > Where I can find more detailed information

NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Hi. I'm trying to create a form to construct an object for my Photo class. All of the objects fields except the photo itself will be invisible to the user. So, the only thing can be seen in the form is the button to select and upload the photo. There is no problem with creating the form page.

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
Thanks. I was talking about the composite primary keys in my second question. I've seen that there is a library for it. So, no problem now. Thank you. 27 Kasım 2017 Pazartesi 23:31:29 UTC+3 tarihinde Matemática A3K yazdı: > > > > On Mon, Nov 27, 2017 at 10:50 AM, Kubilay Yazoğlu

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
Thanks. I was talking about the composite primary keys in my second question. I've seen that there is a library for it. So, no problem now. Thank you. 27 Kasım 2017 Pazartesi 01:49:15 UTC+3 tarihinde Kubilay Yazoğlu yazdı: > > Hello. I have two models. In one of them, I declared a foreign key

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Matemática A3K
On Mon, Nov 27, 2017 at 5:30 PM, Matemática A3K wrote: > > > On Mon, Nov 27, 2017 at 10:50 AM, Kubilay Yazoğlu > wrote: > >> Thanks for your answer. I have one more question. What if there are more >> than one primary keys in that table? >> > > By

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Matemática A3K
On Mon, Nov 27, 2017 at 10:50 AM, Kubilay Yazoğlu wrote: > Thanks for your answer. I have one more question. What if there are more > than one primary keys in that table? > By definition, that won't happen, a primary key is unique. If you add a record with the same key

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Matemática A3K
Something like this should work: https://stackoverflow.com/a/20998131/8930660 and change STATIC_URL and MEDIA_URL Also, the FORCE_SCRIPT_NAME should also work, but if it doesn't, the first is the most "manual" thing you can do, I think... Then you have no need to have 2 nginx confs, just put

Re: Seeking design guidance on a Team model where a user sends invitation to other users to join the team

2017-11-27 Thread Jack
Hey Adam. I took a week to properly learn some JavaScript and jQuery and how to make ajax calls. I just got it working! It was much simpler than I thought. I created a views to catch the appropriate agent's pk and put that in a data-href attribute like this: Send Invite Then I passed

Re: Converting any Graphical Chart(pie-chart, gantt chart) into image dynamically.

2017-11-27 Thread pradam programmer
Thanks alot Derek..I will try this package. On 27-Nov-2017 7:45 PM, "Derek" wrote: > Try reportlab: > > https://docs.djangoproject.com/en/1.11/howto/outputting-pdf/ > #write-your-view > https://www.blog.pythonlibrary.org/2016/02/18/reportlab-how- > to-add-charts-graphs/ >

Re: Converting any Graphical Chart(pie-chart, gantt chart) into image dynamically.

2017-11-27 Thread Derek
Try reportlab: https://docs.djangoproject.com/en/1.11/howto/outputting-pdf/#write-your-view https://www.blog.pythonlibrary.org/2016/02/18/reportlab-how-to-add-charts-graphs/ https://www.reportlab.com/chartgallery/bar/ The actual data generation will of course be specific to your database and

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
Thanks for your answer. I have one more question. What if there are more than one primary keys in that table? I'm talking about the unique_together case. 27 Kasım 2017 Pazartesi 08:55:45 UTC+3 tarihinde Matemática A3K yazdı: > > What Django shows in that dropdown is the __str__() method of the

Converting any Graphical Chart(pie-chart, gantt chart) into image dynamically.

2017-11-27 Thread pradam programmer
Hi Guys, I want to convert an graphical chart,for an Ex: pie-chart,gantt chart into an image in a real time and display it in a PDF Document dynamically. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Luca Moiana
Googling around I found this page http://albertoconnor.ca/hosting-django-under-different-locations.html but ain't working for me Il giorno lunedì 27 novembre 2017 11:10:50 UTC+1, Etienne Robillard ha scritto: > > I have not been able to solve this problem with uWSGI. Apparently, uWSGI > is

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Luca Moiana
Thanks, I read you tutorial but I don't get where I should set my subpath? thanks a lot Il giorno domenica 26 novembre 2017 21:06:56 UTC+1, k2527806 ha scritto: > > https://jee-appy.blogspot.com/2017/01/deply-django-with-nginx.html > > On Sun, Nov 26, 2017 at 11:26 PM, Luca Moiana

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Luca Moiana
Thanks for your reply, although it sounds hard for a noob like me. Just to understand, the trick should be done on Gunicorn or on NGINX ? Il giorno lunedì 27 novembre 2017 11:29:01 UTC+1, Matemática A3K ha scritto: > > That's good to know, I tried to do it some time ago, it was an attempt of >

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Luca Moiana
Thanks for your replly, I'll look into the link you suggested. As for the routing / urls adding FORCE_SCRIPT_NAME = '/pmapp' to settings.py isnt' enough? Il giorno domenica 26 novembre 2017 21:42:41 UTC+1, Matemática A3K ha scritto: > > I don't know / remember how to do it in Gunicorn, but

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Matemática A3K
That's good to know, I tried to do it some time ago, it was an attempt of a "sort-of-tennats" which at the didn't go so I stop doing it. At that moment, I remember trying with gunicorn without success and I was near success with uWSGi but didn't make it at that time. I supposed that know would be

Re: How to configure NGINX to run Django app in a subpath?

2017-11-27 Thread Etienne Robillard
I have not been able to solve this problem with uWSGI. Apparently, uWSGI is not using the same internal routing semantics than FastCGI. See: https://forum.nginx.org/read.php?2,275684,275706 Etienne Le 2017-11-26 à 15:41, Matemática A3K a écrit : I don't know / remember how to do it in

Re: Skip upload of existing S3 Object

2017-11-27 Thread palansh agarwal
Hi Chris, Were you able to solve this? I am in a similar situation. On Sunday, January 1, 2012 at 4:55:07 PM UTC+5:30, Chris Hasenpflug wrote: > > I have a model with an ImageField and am using django-storages > S3BotoStorage backend. To reduce load on the server, I'm using > Amazon's S3

AutocompleteSelect and AutocompleteSelectMultiple admin widgets.

2017-11-27 Thread Daniel Gola
Hello, Where I can find more detailed information about AutocompleteSelect and AutocompleteSelectMultiple admin widgets? I have not been able to find any information in the documentation. I will be grateful for your help. Best regards Daniel -- You received this message because you are