Re: Dynamic CSS

2014-08-13 Thread Avraham Serour
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 19:53:34 -0400 > François Schiettecatte wrote: > > > You could certainly render the CSS either in-line in the

Warnings instead of only errors in Django Forms

2014-08-13 Thread Thomas Güttler
Is there a solution to this? I want to display additional text next to a form field. There is a four years old question on stackoverflow[1], but the solution to use the message framework does not help me, since I want to see the additional text next to the form field. Message at the top of the p

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

2014-08-13 Thread Russell Keith-Magee
As it says on the ticket you reference, you shouldn't be thinking of .pyc files as "compiled" python. It's an internal cache of the runtime state of a particular interpreter. And even if you are able to avoid any cross machine architecture problems, you're really not providing that much protection,

Re: Model not appearing in django admin

2014-08-13 Thread Collin Anderson
Wow. Is the admin.py file actually getting run? (try a print statement or try throwing an exception) -- 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-user

Re: Warnings instead of only errors in Django Forms

2014-08-13 Thread Collin Anderson
Can you override the render() method of a form field widget? -- 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: Model not appearing in django admin

2014-08-13 Thread Thomas Brightwell
Collin, Thanks for the help. I updated my admin.py with this (also been trying other variations of the register): from django.contrib import admin from .models import Retailer @admin.register(Retailer) class RetailerAdmin(admin.ModelAdmin): pass print 'foo' raise Exception() Restarted my

Re: Model not appearing in django admin

2014-08-13 Thread Collin Anderson
Do you have a webapp/__init__.py file? Can you import webapp.admin in ./manage.py shell? -- 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...

Re: Model not appearing in django admin

2014-08-13 Thread Thomas Brightwell
Yes, have an __init__.py file. And yes, works fine importing. bash-3.2$ ./manage.py shell Python 2.7.5 (default, Mar 9 2014, 22:15:05) In [1]: import webapp.admin In [2]: webapp directory listing: bash-3.2$ ls __init__.py admin admin.pyc item migrations models.pyc templates tests view

Re: Model not appearing in django admin

2014-08-13 Thread Thomas Brightwell
Ok, figured it. I have an admin folder as well as admin.py so they're conflicting. Removing it solved the issue and Retailer now appears in the admin interface. Thanks for the debugging steps! Cheers, Tom On Wednesday, 13 August 2014 14:38:51 UTC+1, Thomas Brightwell wrote: > > Yes, have a

My form filed values are not sent to server

2014-08-13 Thread Mahdi Rahimi
Hi all I've a template which includes a form. When my form is submitted to the server all of my field values are empty!! I was working. I changed my template. I transferred any required thing. What's the reason? Does it regard to JS or CSS? Is any one to help me? Thanks -- You received this

How to run Python script? (configure settings error)

2014-08-13 Thread Daniel Grace
I have a Python script as follows: from django.db import transaction from django.contrib.auth.models import User from flow.models import States, Types, Docs, Logs if __name__ == '__main__': with transaction.atomic(): models.Logs.objects.all().delete() models.Docs.objects.all()

Re: My form filed values are not sent to server

2014-08-13 Thread Collin Anderson
Are your form fields actually in the tag? Is there any data at all in request.POST? -- 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...@go

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Tom Evans
You cannot use django before configuring it. https://docs.djangoproject.com/en/1.6/topics/settings/#designating-the-settings Django provides several entry points, manage.py and wsgi.py, which perform this configuration steo. If you choose not to use those entry points, you are required to config

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Andrew Farrell
Note: this is much better documented at https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ You want to move this file to the management.commands module. I don't know what the equivalent commands are on windows, but on linux this would be. 1) `cd myapp; mkdir management`: Withi

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Collin Anderson
set: os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings' (or see how it's done in manage.py) On 1.7 call django.setup() first before using models. On 1.6 or lower, you may need to call models.get_models() before using your models. -- You received this message because you are subscrib

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Andrew Farrell
oh, and you should then be able to run the command by doing python manage.py myapp mycommand and see the 'mycommand' in the list of commands printed by `python manage.py help` On Wed, Aug 13, 2014 at 10:36 AM, Andrew Farrell wrote: > Note: this is much better documented at > https://docs.django

Re: How to run Python script? (configure settings error)

2014-08-13 Thread Daniel Grace
I used this method and got my script working OK. On Wednesday, 13 August 2014 15:37:30 UTC+1, Andrew Farrell wrote: > > Note: this is much better documented at > https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ > > You want to move this file to the management.commands modul

Re: My form filed values are not sent to server

2014-08-13 Thread Babatunde Akinyanmi
Also, if you are manually adding the form to your template you should make sure you add a name attribute to all the input tags On 13 Aug 2014 15:33, "Collin Anderson" wrote: > Are your form fields actually in the tag? Is there any data at all > in request.POST? > > -- > You received this message

Re: Django migrations and DateTimeField defaults

2014-08-13 Thread Andy Roxby
Thanks, that's what I did. In my humble opinion, the ValueError should be removed and the timezone serialized in the form UTC offset (eg: -0400). On Tuesday, August 12, 2014 9:43:11 PM UTC-4, Collin Anderson wrote: > > Wow. That almost sounds like a bug, though you can however use a callable. >

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

2014-08-13 Thread Javier Guerra Giraldez
On Wed, Aug 13, 2014 at 3:59 AM, Russell Keith-Magee wrote: > As I see it, you have four options: there's also option #2.5: * distribute .pyc files as required, but include a call to uncompyle2 (or any alternative .pyc to .py decoder) at setup time, so Django finds the .py files as usual. it

Re: school website

2014-08-13 Thread Scot Hacker
On Tuesday, August 12, 2014 6:46:40 AM UTC-7, ngangsia akumbo wrote: > > PLease i have a small question. I just need some guidance > Django is a great choice for school portals/intranets, and can accomplish everything you describe (I've built several of them, but can't make the source available,

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

2014-08-13 Thread Collin Anderson
> > * distribute .pyc files as required, but include a call to uncompyle2 > (or any alternative .pyc to .py decoder) at setup time, so Django > finds the .py files as usual. > Brilliant! Or, even just have setup write out the stub .py files without needing another dependency. -- You received

Trying to migrate data and not getting correct data out of a field 1.7c2

2014-08-13 Thread Matthew Meyer
I've attached an example project that recreated the error. Basically I created a profile and then setup some relations to it. When I change the relation from the profile to the User model and try to access the data after the models.py file has been changed but before the migration has been comp

Re: multiple projects on same database

2014-08-13 Thread Camilo Torres
Hello Hector, It seems that using 2 different databases will cause duplicate schema (tables) and duplicate data. So in your case I prefer to change my mind and recomend you to use a single database. In general I don't see any problem with that. Regards, Camilo. -- You received this message be

Tango with Django Tutorial

2014-08-13 Thread darkman237
This is one of the tutorials I'm going through. I checked everything and it all to have been entered properly. The initial populate database app didn't work, so I entered the items in manually. While it shows in recent activity that the categories were entered, I do not see the name of the categ

Django app deployment step-by-step

2014-08-13 Thread darkman237
I'm a newbie to the whole Python/Django world so I've been working my way through tutorials and trying to learn. What I have not yet encountered, not can I find anything with the searches I've made for the topic of deployment. I checked with my host and they do have python set up on the Apache

Re: Django app deployment step-by-step

2014-08-13 Thread Andrew Farrell
I've tried to get django running without shell access and it was a headache. You can get a good server with shell access for $10. Unless you are far smarter than I, you will almost certainly waste more than hours trying to get django to work without shell access. With two of those hours, you would

Re: Django app deployment step-by-step

2014-08-13 Thread Collin Anderson
digital ocean is probably the best, though linode has been around longer. with ramnode.com you can get tiny servers for as low as $15/year. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: school website

2014-08-13 Thread Lee Hinde
You might check out: https://github.com/burke-software On Tue, Aug 12, 2014 at 7:24 AM, ngangsia akumbo wrote: > i have a website to build > > it will consist of 4 groups > students, staff, parents and courses > > students will have the following > profile > update > delete > access courses >

Re: Python Brasil [10] - Call for papers

2014-08-13 Thread Renato Oliveira
Hi all! We postponed the call for papers to Friday, 15th And the first batch of tickets is valid until Sunday, 17th! See you in Porto de Galinhas! Renato Oliveira @_renatooliveira Labcodes - www.labcodes.com.br On Sat, Aug 9, 2014 at 11:59 AM, Helton Alves

Re: Django app deployment step-by-step

2014-08-13 Thread Jorge Andrés Vergara Ebratt
Actually it's not that hard, I followed this tutorial from Digital Ocean to set up most of my Rackspace Cloud Servers https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn 2014-08-13 14:41 GMT-05:00 darkman237 : > I'm a newbie to t

Question about post_save

2014-08-13 Thread Neto
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 instance.save() How do I save changes without calling post_save again? -- You received this message because you are subscribed to the Go