Re: Trouble with STATIC_URL in v1.5.2

2013-09-16 Thread Jacky Tian
I think the standard way of including static files in templates in 1.5+ is through the staticfiles app. In particular, look at the documentation on the {% static %} template tag. Depending on how you've set up your STATIC_ROOT and

Re: Validation on creation

2013-09-16 Thread Mike Dewhirst
On 17/09/2013 2:06pm, Lachlan Musicman wrote: Hola, I'm pretty sure I get this, but I thought I'd ask. With an inventory model like: class Movement(models.Model): item = models.ForeignKey(Carrier) date = models.DateField(default=timezone.now()) user = models.ForeignKey(User)

Validation on creation

2013-09-16 Thread Lachlan Musicman
Hola, I'm pretty sure I get this, but I thought I'd ask. With an inventory model like: class Movement(models.Model): item = models.ForeignKey(Carrier) date = models.DateField(default=timezone.now()) user = models.ForeignKey(User) qty = models.IntegerField() There are three

Re: Django unittest failure

2013-09-16 Thread Kelvin Wong
You should probably open a bug on this issue. The test suite fails for me on MacOS/Python 2.7 on the stable/1.5.x branch. This is the command that fails reliably on my machine: $ PYTHONPATH=..:$PYTHONPATH python ./runtests.py --settings=test_sqlite utils formtools It might be related to this

Re: [Deployment + Apache2] difference between development server & production server

2013-09-16 Thread hung david
On Monday, September 16, 2013 2:05:56 AM UTC+7, Kakar wrote: > > I dont know what you actually mean, but I think just by passing the url > that you have created in the urls.py, which points to the function you have > defined in ur views.py should work. > > > Yes you are right Kakar. I've

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-16 Thread Rafael Durán Castañeda
Hi, Some answers inline and links at the end: 2013/9/15 Derek > I have an existing Django (1.4) project, with multiple apps and extensive > business logic, that I need to write tests for. Based on a day or two of > reading of the core Django docs and numerous blogs (each

Trouble with STATIC_URL in v1.5.2

2013-09-16 Thread Adam Stein
Maybe this is something well known. I'm using STATIC_URL in my templates. Worked perfectly in Django 1.4.x. Upgraded to v1.5.2. Now STATIC_URL ONLY works when the DEBUG setting is True. When set to False (For production), STATIC_URL is an empty string in the template. Anybody have any idea

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-16 Thread Jorge Arevalo
On Monday, September 16, 2013 7:33:49 PM UTC+2, Jorge Arevalo wrote: > > Hello, > > I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS + > OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed to > a Linode box. That box will be created with something like

Is there a tutorial for django-allauth?

2013-09-16 Thread voger
Hi, I want to use django-allauth in my project and I would like to to use it both for local registrations and registrations using Facebook. Unfortunately every tutorial I find describes how to use it with various providers but nothing is being said about local registrations. As this is my very

Re: [Deployment + Apache2] difference between development server & production server

2013-09-16 Thread hung david
Thank you Daniel. It's kind of strange every single time I post ( I only did 2 times) a question in any community, I find out the question by myself immediately after that even thought I've spent a lot of time finding the answer before. Well that's a story of my life ^^ And what you reply is

Recommended dev environment for a Django project deployed to Linode

2013-09-16 Thread Jorge Arevalo
Hello, I'm going to start a project based on (Geo)Django + PostgreSQL/PostGIS + OpenLayers/LeafLet + Bootstrap/Foundation. The project will be deployed to a Linode box. That box will be created with something like this: https://manager.linode.com/linodes/deploy/linode393074?StackScriptID=6482

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Avraham Serour
the question is what for? other than the ORM what else is useful for a desktop app? if it is only the ORM you want take a look at http://www.sqlalchemy.org/ On Mon, Sep 16, 2013 at 7:17 PM, Brad Pitcher wrote: > You need to do something like this before import django

Re: How to raise exception in model?

2013-09-16 Thread C. Kirby
If you successfully get to render_to_response (or similar) the template renderer will silently swallow errors. If you want the error to stop rendering and either print an error or a 500 or something similar, test it in the view before rendering. Assuming you have an entry (or list of entries I

Upload de musicas (music upload)

2013-09-16 Thread Carlos Andre
Olá pessoal, tudo bom? Eu gostaria de uma ajuda de como fazer upload de músicas no banco de dados, como faço upload de arquivo. Gostaria de exemplos. Hello guys, how are you? I would like some help on how to upload songs in the database, how do I upload file. I would like examples. -- You

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Brad Pitcher
You need to do something like this before import django stuff: import os import sys sys.path.append(os.path.abspath(os.path.dirname(__file__))) os.environ['DJANGO_SETTINGS_MODULE'] = 'web.settings' - Brad Pitcher On Mon, Sep 16, 2013 at 8:19 AM, Nigel Legg

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Nigel Legg
Shouldn't it be from django.db import models ?? Cheers, Nigel 07914 740972 On 16 September 2013 15:25, DJ-Tom wrote: > For reporting purposes I want to use List & Label from Combit. The > web/online part is no big deal since the reporting module can be run >

How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread DJ-Tom
For reporting purposes I want to use List & Label from Combit. The web/online part is no big deal since the reporting module can be run without user interface (creating Excel or PDF files) But the actual form designer part that is used to define the report layout is a windows GUI application,

How to raise exception in model?

2013-09-16 Thread Ladislav P
I have some custom functions in model classes which processes some data, and add custom attribute to the model. Thing is, I do not know how could I raise an exception if this functions that are accessed when the template is generated (the error seems to be only silent, so it will process the

Re: Paginattion: How do I pass current page number around views, forms and templates?

2013-09-16 Thread DJ-Tom
I think I could use the views name as the key to the current page - that way the system "remembers" the page number for each view. Am Dienstag, 10. September 2013 18:59:19 UTC+2 schrieb ke1g: > > The remaining trick will be when to remove it from the session. You don't > want to go into

Re: How to specify what models should use what database sources?

2013-09-16 Thread Michael
Take a look at database routers . On Monday, 16 September 2013 09:28:43 UTC+1, Ladislav P wrote: > > I know how to define database source in settings, but I would like to know > how can I specify what models should use

How to specify what models should use what database sources?

2013-09-16 Thread Ladislav P
I know how to define database source in settings, but I would like to know how can I specify what models should use what sources. I know I can use .using('source') but is it possible to get rid of it so that django automatically would use appropriate database? -- You received this message