Re: Question about post_save

2014-08-14 Thread Johannes Schneider
Is there any reason why this has to happen after saving? otherwise you could use pre_save. bg, Johannes On 14.08.2014 08:12, Neto wrote: I'm using post_save but he is in loop: @receiver(models.signals.post_save, sender=Cars) def auto_num_on_save(sender, instance, **kwargs): my code

mixing python , php and django

2014-08-14 Thread ngangsia akumbo
I am working with a php guy in my office . He is asking me how can we mix php and django? Cos he want that when we have a project to do he should be able to paticipate using php in building the project can someone give me some tips -- You received this message because you are subscribed to the

Re: mixing python , php and django

2014-08-14 Thread Erik Cederstrand
Den 14/08/2014 kl. 10.24 skrev ngangsia akumbo : > I am working with a php guy in my office . > He is asking me how can we mix php and django? > Cos he want that when we have a project to do he should be able to paticipate > using php in building the project > > can someone give me some tips Th

Re: mixing python , php and django

2014-08-14 Thread ngangsia akumbo
can i have a link on how that works? On Thursday, August 14, 2014 9:38:15 AM UTC+1, Erik Cederstrand wrote: > > Den 14/08/2014 kl. 10.24 skrev ngangsia akumbo >: > > > I am working with a php guy in my office . > > He is asking me how can we mix php and django? > > Cos he want that when we hav

# in django URL

2014-08-14 Thread Domagoj Kovač
Hi Guys, I have a problem, i have url like: http://127.0.0.1:8000/get-file?file_path=/home/domagoj/pcap/#1/test.txt where file_path is path to the file both requestGET["file_path"] and request.get_full_path() ignore #1/test.txt part, how can i fix this? Is there some other way to get full ur

Re: # in django URL

2014-08-14 Thread Drew Ferguson
Hi The hash mark has a special meaning in URIs; this is not specific to Django If you must use it in an actual URL, it needs to be escaped as %23 The urlencode template tag might help https://docs.djangoproject.com/en/dev/ref/templates/builtins/#urlencode Notice that this URL uses a hash mark

How to disable application / project?

2014-08-14 Thread Daniel Grace
I have two projects "djangotest" (from the django tutorial) and "cresta". When I start the server with the "runserver" command in the cresta directory and go to http://127.0.0.1:8000/admin/ ... I see "Polls Tutorial". I can't login with any users from the cresta database. How do I disable the Po

How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
I want to parse an application URL just like Django does. url = 'http://www.example.com/path/to/myview/123' view, params = decompose(url) # now view="MyView", params=('123',) How can it be done? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: How to disable application / project?

2014-08-14 Thread Mike Dewhirst
On 14/08/2014 8:38 PM, Daniel Grace wrote: I have two projects "djangotest" (from the django tutorial) and "cresta". When I start the server with the "runserver" command in the cresta directory and go to http://127.0.0.1:8000/admin/ ... I see "Polls Tutorial". I can't login with any users from t

Extened User and have fieldsets instead of inlines

2014-08-14 Thread Elliot
Is it possible to have a exteneded user profile in the 'User' part of the admin. I have tried the following with a form (UserProfileForm(forms.ModelForm)) with 2 fields 'something' and 'something else' class UserAdminCustom(UserAdmin): form = UserProfileForm fieldsets = ( (Non

Re: Extened User and have fieldsets instead of inlines

2014-08-14 Thread Andrea
I've personally used your approach with the following Inline: class UserProfile2Inline(admin.StackedInline): model = UserProfile2 can_delete = False fk_name = 'user' max_num = 1 Andrea 2014-08-14 5:57 GMT+02:00 Elliot : > Is it possible to have a exteneded user profile in the '

Re: Custom management commands provided as only .pyc files?

2014-08-14 Thread Stodge
Thanks - there are some great suggestions here. Much appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To p

Re: post_save doesn't work

2014-08-14 Thread Stodge
I've had good success with placing the import at the end of the models file. On Tuesday, 12 August 2014 20:06:41 UTC-4, chedi toueiti wrote: > > Hi Neto, > > Just make sure that your callback is loaded, the most easy way to do it is > to import the function in models.py if you have a single model

Crispy form Change default text shown for ImageField when not empty

2014-08-14 Thread Subodh Nijsure
Hello, I have following field in my model. photo = models.ImageField(null=True,blank=True,upload_to="product_images") I have defined the following layout in forms.py for this field, while using crispy-form self.fields['photo'].label = "Asset Image" self.helper.layout = Layout( 'photo',

Re: mixing python , php and django

2014-08-14 Thread Derek
It can work any way you need it to. It really depends on what aspects he needs to handle and which are yours. If, for example, you create the back-end with the DB and models, then he can communicate from the front-end, using JSON data via GET/PUT requests. One way for you to handle this on th

Re: mixing python , php and django

2014-08-14 Thread Anderson
Say to him to learn django. On Thu, Aug 14, 2014 at 10:35 AM, Derek wrote: > It can work any way you need it to. It really depends on what aspects he > needs to handle and which are yours. > > If, for example, you create the back-end with the DB and models, then he > can communicate from the f

Re: mixing python , php and django

2014-08-14 Thread Lee
If its just the two of you creating small web site projects then I doubt its worth the cost in time, effort and money for the added complexity that would be present with using two different server side languages. I'd suggest working out some common ground personally, rather than going that rout

Re: Question about post_save

2014-08-14 Thread Collin Anderson
@receiver(models.signals.post_save, sender=Cars) def auto_num_on_save(sender, instance, **kwargs): if hasattr(instance, '_already_ran'): return my code instance._already_ran = True instance.save() -- You received this message because you are subscribed to the Google

Re: How to decompose URL into model and parameters

2014-08-14 Thread Collin Anderson
from django.core import urlresolvers match = urlresolvers.resolve(urlsplit(url).path) view = match.func params = math.args https://docs.djangoproject.com/en/dev/ref/urlresolvers/#resolve -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: How to disable application / project?

2014-08-14 Thread Collin Anderson
Do you have DJANGO_SETTINGS_MODULE="djangotest.settings" in your environment? in manage.py you could change the os.environ.setdefault() line to: os.environ['DJANGO_SETTINGS_MODULE'] = 'cresta.settings' -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Dynamic CSS

2014-08-14 Thread Drew Ferguson
Hi Avraham Thanks for the heads-up On Wed, 13 Aug 2014 11:25:09 +0300 Avraham Serour wrote: > just remember to change the headers of the response to reflect that you > are serving a css file and not html > > > On Wed, Aug 13, 2014 at 3:37 AM, Drew Ferguson > wrote: > > > On Tue, 12 Aug 2014

Re: How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
Line match = urlresolvers.resolve(urlsplit(url).path) stops executing the script and redirects me to given URL. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: How to decompose URL into model and parameters

2014-08-14 Thread Collin Anderson
It raises an Http404 if it doesn't exist. Is that what's going on? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: How to decompose URL into model and parameters

2014-08-14 Thread 9devmail
Yes, I figured it out. Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: mixing python , php and django

2014-08-14 Thread Nikolas Stevenson-Molnar
Well, there's always: http://animuchan.net/django_php/ _Nik On 8/14/2014 1:24 AM, ngangsia akumbo wrote: > I am working with a php guy in my office . > He is asking me how can we mix php and django? > Cos he want that when we have a project to do he should be able to > paticipate using php in bui

Strange behavior with defer and select_related

2014-08-14 Thread Zach Snow
Hi there. I'm running into some strange behavior when using `defer` with `select_related` and I wanted to find out if I'm simply misunderstanding what should be going on, or if indeed I have stumbled onto a bug. Summary: Using `defer` on a table that has been re-included in a query via `select_rel

I can't load fixtures

2014-08-14 Thread Daniel Grace
I created a fixtures file called testdata.xml in a fixtures folder, but I can't load the fixtures file into the database. I placed an __init__.py file in the fixtures folder (not sure about this step, is it needed?) I put the fixtures directory in settings.py: FIXTURE_DIRS = ( '/myapp/fixtur

Cannot import in admin.py

2014-08-14 Thread Daniel Grace
I get an error after editing my admin.py file as follows: from django.contrib import admin from flow.models import Flow admin.site.register(Flow) ... here is the error: ImportError at / cannot import name 'Flow' Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.6.5 Excepti

Re: Tango with Django Tutorial

2014-08-14 Thread Mando
Hi, you really didn't give good information as to why it failed and why you had to populate it manually, perhaps you missed a step in the tutorial? What is the specific error you are getting when you run the command to initially populate the database. On Wednesday, August 13, 2014 2:47:37 PM U

Re: mixing python , php and django

2014-08-14 Thread m1chael
I recently met a business man in my community that was looking to hire me to put together some school intranets.. long story short, I told him no because he would not allow me to develop in Django/Python. I don't need that in my life. :) Mike On Thu, Aug 14, 2014 at 12:28 PM, Nikolas Stevenson-Mo

Template in parent folder

2014-08-14 Thread Cayla Shaver
For some reason we are having trouble with Django's templates and parent folders. We uploaded a sitebase.html file into the parent folder but none of the children folders can find the sitebase.html file. Is there a trick for setting this up that we haven't been able to find? -- You received

TypeError : Unable to save m2m relation modelform

2014-08-14 Thread kevin
Type Error : 'ExtendedTag' instance expected, got I had created m2m field (required false). When I tried to save form with parent select (from multiple choice field), It rises type error. When I tried to save it without selecting parent and category, it work fine. I couldn't able to figure out

Re: Template in parent folder

2014-08-14 Thread Collin Anderson
Are you saying you have templates/sitebase.html and tempaltes/child/template.html, and you can't {% extends "sitebase.html" %} in your child/template.html? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: TypeError : Unable to save m2m relation modelform

2014-08-14 Thread Collin Anderson
Could it be the issue with clashing id fields? https://docs.djangoproject.com/en/dev/topics/db/models/#multiple-inheritance -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send a

Authenticating against django auth db from apache

2014-08-14 Thread Héctor Urbina
Hello, I'm following intructions in https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/apache-auth/, but the wsgi.py script is giving the following error: ImportError: Could not import settings 'uddo.settings' (Is it on sys.path? Is there an import error in the settings file?): cannot

Re: Authenticating against django auth db from apache

2014-08-14 Thread Collin Anderson
Does commenting out the check_password line in wsgi.py actually fix the problem? Are you importing "auth" somewhere in your settings? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Re: Strange behavior with defer and select_related

2014-08-14 Thread Zach Snow
Upon reviewing the code in `django/db/models/sql/compiler.py` it seems clear that the list of deferred fields is per-table instead of per-table alias -- see `deferred_column_names`, https://github.com/django/django/blob/f0b358880a6825d667c037757caac470bc526a1f/django/db/models/sql/compiler.py#L

Django app runs with DEBUG=True but gives "Bad Request (400)" error with DEBUG=False (Using Apache and WSGI). Why?

2014-08-14 Thread Chris Seberino
If I set DEBUG=True this Django app runs fine. If I remove DEBUG=True I get a "Bad Request (400)" and apache error logs show lots of this.. [Fri Aug 15 03:04:27.400567 2014] [core:warn] [pid 2011:tid 140575764432768] AH00045: child process 2015 still did not exit, sending a SIGTERM [Fri Aug 15

Re: Django app runs with DEBUG=True but gives "Bad Request (400)" error with DEBUG=False (Using Apache and WSGI). Why?

2014-08-14 Thread Collin Anderson
a quick thing to check: is your ALLOWED_HOSTS set correctly? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post t

Re: Django app runs with DEBUG=True but gives "Bad Request (400)" error with DEBUG=False (Using Apache and WSGI). Why?

2014-08-14 Thread Chris Seberino
Ug!! That was it!! THanks!!! cs On Thursday, August 14, 2014 10:14:34 PM UTC-5, Collin Anderson wrote: > > a quick thing to check: is your ALLOWED_HOSTS set correctly? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

dba designer consulting needed

2014-08-14 Thread Mike Dewhirst
I'm looking for a DBA designer in Melbourne for some paid consulting. I have a Django 1.6 prototype system working nicely with Postgres 9.1. But it was designed as a proof-of-concept rather than a production system. I figured the project wouldn't actually get off the ground without funding and

Re: I can't load fixtures

2014-08-14 Thread eprikazc
'/myapps/fixtures' is treated as absolute path. Try removing leading slash to make it relative. Either you can write full absolute path to the directory. thanks, Eugene On Thursday, August 14, 2014 9:05:30 PM UTC+4, Daniel Grace wrote: > > I created a fixtures file called testdata.xml in a fix