Dear Django developers,
I would like to connect my dash plotly dashboard to a django model filtered
to a specific user. I was able to import the model into a standalone
script. The problem is that I can only connect the dashboard to the values
related to all the users in the database. But I want
On Fri, Jun 28, 2013 at 7:47 AM, Javier Guerra Giraldez
wrote:
> On Fri, Jun 28, 2013 at 8:21 AM, Larry Martell
> wrote:
>> I don't really understand what you mean by "create a function which is
>> be called by view and your script."
>
>
> AFAICT, your situation looks like this:
>
> you have thi
for this case you can use django shell
Many thanks,
Serge
+380 636150445
skype: skhohlov
On Fri, Jun 28, 2013 at 4:47 PM, Javier Guerra Giraldez
wrote:
> On Fri, Jun 28, 2013 at 8:21 AM, Larry Martell
> wrote:
> > I don't really understand what you mean by "create a function which is
On Fri, Jun 28, 2013 at 8:21 AM, Larry Martell wrote:
> I don't really understand what you mean by "create a function which is
> be called by view and your script."
AFAICT, your situation looks like this:
you have this:
def myview(request, maybesomeparams...):
does lots of things
nd if I
go any further down I'll have to duplicate some existing code, which
I'd rather not have to do.
> On Fri, Jun 28, 2013 at 3:41 PM, Larry Martell
> wrote:
>>
>> I am trying to write a standalone script that calls one of my views. I
>> can call the view, bu
, Jun 28, 2013 at 3:41 PM, Larry Martell wrote:
> I am trying to write a standalone script that calls one of my views. I
> can call the view, but I'm having a problem with proving what it
> wants. One of the things the view needs is request.user, and that
> looks like thi
I am trying to write a standalone script that calls one of my views. I
can call the view, but I'm having a problem with proving what it
wants. One of the things the view needs is request.user, and that
looks like this:
(Pdb) type(request.user)
(Pdb) type(request)
I'm trying to
Wow this is the coolest thing...thnx
On Tuesday, 16 September 2008 07:20:24 UTC+5:30, Steve Holden wrote:
>
> Mathieu Leplatre wrote:
> > Hi all,
> >
> > I found many post about specific errors regarding django as a
> > standalone tool.
> >
> > With a little bit of researching, I ended up with thi
There's a problem in your INSTALLED_APPS setting. You have to use:
('polls',)
Notice the trailing comma. When writing tuples with one item, you must have
a traling comma. It indicates that you are writing a tuple, and not simply
an expression enclosed in parenthesis. A workaround is to use a li
ps, and it will typically be easier to
> pull the whole thing than to tease out just enough. If your project
> is in a suitable VCS, that is a good way to make the copy.
>
> Bill
>
> On 3/12/12, H.T. Wei wrote:
> > Hi,
> >
> > If anyone can suggest what is the
elevant apps, and it will typically be easier to
pull the whole thing than to tease out just enough. If your project
is in a suitable VCS, that is a good way to make the copy.
Bill
On 3/12/12, H.T. Wei wrote:
> Hi,
>
> If anyone can suggest what is the best way to use Django ORM in standalo
Hi,
If anyone can suggest what is the best way to use Django ORM in standalone
script for accessing database? The "standalone script" is located on the
server different from Django server but access the same database server.
Thanks in advance!
Steve
--
" stay hungry, stay fo
Dears,
I am using Django 1.2.1 now.
When I use Multiple databases and routers,
It's working correctly in my web views.
But when I try to use it in standalone script, like this
###
os.sys.path.append(DJANGO_PROJECT_PATH)
from django.core.management import setup_environ
from test import set
hello kanniga,
I use correct user and password.
I can get data from database.
I read about it in an one post that described what may be due not
correct settings of connect to database, but there were no details.
On Jun 5, 2:54 pm, kanniga sivasubramanian
wrote:
> hello yakovenko sir,
> I
hello yakovenko sir,
I think your databse_user and database_password are incorrect.
I had affected by this problem. You will give correct username and
password of mysql.
On Sat, Jun 5, 2010 at 1:02 AM, tmitchell wrote:
> Holy reading comprehension, Batman. Just saw you have DEBUG off,
>
Holy reading comprehension, Batman. Just saw you have DEBUG off,
ignore previous comment.
On Jun 4, 10:34 am, Кирилл Яковенко
wrote:
> I have tried this method, but it didn't give any results.
> I suspect that this is due to incorrect settings of the database or connect
> to it.
>
> 2010/6/4 Dj
Are you running with DEBUG on? I've noticed the same memory growth in
standalone scripts when in DEBUG mode.
It may be related to this:
http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-debug
On Jun 4, 10:34 am, Кирилл Яковенко
wrote:
> I have tried this met
I have tried this method, but it didn't give any results.
I suspect that this is due to incorrect settings of the database or connect
to it.
2010/6/4 Dj Gilcrease
> On Fri, Jun 4, 2010 at 6:44 AM, yakovenko wrote:
> > import os
> > import sys
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'md.setti
On Fri, Jun 4, 2010 at 6:44 AM, yakovenko wrote:
> import os
> import sys
> os.environ['DJANGO_SETTINGS_MODULE'] = 'md.settings'
> sys.path.append('/md/lib')
> from django.db import close_connection, reset_queries
> from md.mddata.models import Info
> def test():
> for i in Info.objects.all():
>
Hello guys,
I use django ORM in standalone daemon. And It sucks more and more
memory.
I have created small script for testing:
---
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'md.settings'
sys.path.append('/md/lib')
from django.db
t;> Ok, my bad, the sequence works well, i just confused the field name...
>> But the problem is still there if the update is done by another actor than
>> Django itself.
>>
>> My standalone script is daemon which poll my DB with a XX.objects.all().
>> If i upda
On Thu, Oct 8, 2009 at 5:07 AM, Alexis MINEAUD wrote:
> Ok, my bad, the sequence works well, i just confused the field name...
> But the problem is still there if the update is done by another actor than
> Django itself.
>
> My standalone script is daemon which poll my DB with a
Ok, my bad, the sequence works well, i just confused the field name...
But the problem is still there if the update is done by another actor than
Django itself.
My standalone script is daemon which poll my DB with a XX.objects.all(). If
i updated myself a row from XX, the daemon doesn't se
]
>>> Tag.objects.create(name='tag1')
>>> Tag.objects.all()
[]
>>> tag = Tag.objects.get()
>>> tag
>>> tag.name = 'tag11'
>>> tag.save()
>>> Tag.objects.all()
[]
Is there something you've left out of your account
Hi everybody.
I'm stuck on a problem with the Django ORM.
After a basic query like select * from table where id = 1, the result
is still the same although i've update the row in the DB.
Example:
>>> Tag.objects.all()
[]
>>> tag = Tag.objects.all().get()
>>> tag
>>> tag.name = 'tag11'
>>> t
prabhu S pisze:
> Solution appears like a hack to me. Why do you close the connection in
> every process? Can you not just close once in parent? Execute commits
> alone in each process.
>
I've checked that. Unfortunately, in my case, it won't work. I have a
loop looking like this:
for job in
On Tue, 2009-08-11 at 03:12 -0700, prabhu S wrote:
[...]
> Why do you close the connection in
> every process? Can you not just close once in parent?
That would also work.
Regards,
Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscrib
0, Spajderix wrote:
>
> >> Hi!
>
> >> I've written a standalone script, which looks throught a table in db for
> >> tasks to perform. It then starts subprocesses for each task it founds
> >> using multiprocessing.Process class from python. Everything
Malcolm Tredinnick pisze:
> On Tue, 2009-08-11 at 11:06 +0200, Spajderix wrote:
>
>> Hi!
>>
>> I've written a standalone script, which looks throught a table in db for
>> tasks to perform. It then starts subprocesses for each task it founds
>> using
On Tue, 2009-08-11 at 11:06 +0200, Spajderix wrote:
> Hi!
>
> I've written a standalone script, which looks throught a table in db for
> tasks to perform. It then starts subprocesses for each task it founds
> using multiprocessing.Process class from python. Everything
Hi!
I've written a standalone script, which looks throught a table in db for
tasks to perform. It then starts subprocesses for each task it founds
using multiprocessing.Process class from python. Everything's fine when
there is one task, but when i try to start more subprocesses at
I have found where our mistake was, it was inside __init__.py of our
application.
Thanks anyway
On 4 Сер, 18:45, Michael wrote:
> > On Tue, Aug 4, 2009 at 11:29 AM, Vitaly wrote:
> > I did cut of our settings
>
> > Here it ishttp://dpaste.com/75091/
>
> > Using your method I got no error but a
It should be, but not :)
The matter is that I changed some code
from django.conf import settings
from fg import settings as app_settings
settings.configure(app_settings, **{'DATABASE_NAME': ':memory:',
'DATABASE_ENGINE':
'sqlite3',
>
> On Tue, Aug 4, 2009 at 11:29 AM, Vitaly wrote:
> I did cut of our settings
>
> Here it is http://dpaste.com/75091/
>
> Using your method I got no error but app_settings and INSTALLED_APPS
> were cleaned up and contains nothing. Strange.
>
> Thanks
> Vitaly
>
Why not just:
from django.conf
I did cut of our settings
Here it is http://dpaste.com/75091/
Using your method I got no error but app_settings and INSTALLED_APPS
were cleaned up and contains nothing. Strange.
Thanks
Vitaly
On 4 Сер, 18:11, Michael wrote:
> On Tue, Aug 4, 2009 at 11:05 AM, Vitaly wrote:
>
> > Oh, yeah, the
On Tue, Aug 4, 2009 at 11:05 AM, Vitaly wrote:
>
> Oh, yeah, there was only place, but when I removed this code nothing
> changed.
>
> I do not know about this import
>
> from django.utils.translation import ugettext_lazy as _
>
This (and anything from utils ideally) shouldn't need settings top b
For running our test script we are using standalone script.
>
> > Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
> > [GCC 4.3.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >
On Tue, Aug 4, 2009 at 10:46 AM, Vitaly wrote:
>
> Hey there
>
> For running our test script we are using standalone script.
>
> Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
> [GCC 4.3.3] on linux2
> Type "help", "copyright", "credi
or there is another way.
create custom command for manage.py
(http://docs.djangoproject.com/en/dev/howto/custom-management-commands/
#howto-custom-management-commands)
it's pretty simple.
then write bash script like this:
#!/bin/bash
export PYTHONPATH=/path/to/django
cd /path/to/project
python man
PYTHONPATH is ok, and application is working, but see that I am
running tests, and it raises exception when tries to configure custom
settings.
On 4 Сер, 17:52, krylatij wrote:
> I guess you are using SSH?
>
> so before running your script run:
> export PYTHONPATH=/path/to/django
>
> hope this h
I guess you are using SSH?
so before running your script run:
export PYTHONPATH=/path/to/django
hope this helps
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Hey there
For running our test script we are using standalone script.
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.conf im
On Mon, 2009-02-23 at 14:35 +, David Reynolds wrote:
> 2009/2/23 Konstantin S :
> >
> > Hello!
> >
> > I need to postprocess some data in my models and the most natural way
> > of doing this would be to run periodically standalone script. But on
> > the
2009/2/23 Konstantin S :
>
> Hello!
>
> I need to postprocess some data in my models and the most natural way
> of doing this would be to run periodically standalone script. But on
> the other hand I want to use framework ORM just because it would much
> more handy than r
On Mon, Feb 23, 2009 at 8:04 AM, Konstantin S wrote:
>
> Hello!
>
> I need to postprocess some data in my models and the most natural way
> of doing this would be to run periodically standalone script. But on
> the other hand I want to use framework ORM just because it would
Hello!
I need to postprocess some data in my models and the most natural way
of doing this would be to run periodically standalone script. But on
the other hand I want to use framework ORM just because it would much
more handy than raw sql. What should I import to plug in django in
standalone
hi and thanks for advice. however it doesn't seems like the problem
because i did set all my python paths correctly and called
setup_environ.
it was like.
this was the top of script before i solved the problem
>>DIR=os.path.abspath(__file__)
>>sys.path.append(imp.find_module("django")[1])
>>sys.
Hi,
You need to define the settings file on top of the python path and
the path to your settings file. Start with the xample in the post
below...
http://blog.awarelabs.com/?p=15
Once you get it to work, back out some of the paths until you find
the minimum you need. You will need to type
i added
from django.db.models.loading import get_apps
get_apps()
before calling models
and it solved the problem
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send emai
I approve it
You should just check your project's settings.py can be import
2009/1/31 Orcun Avsar
>
>
> On 31 Ocak, 03:09, Malcolm Tredinnick
> wrote:
>
> > I suspect you just haven't set
> > up your Python path correctly (which is the cause of about 98% of all
> > import-related problems on th
On 31 Ocak, 03:09, Malcolm Tredinnick
wrote:
> I suspect you just haven't set
> up your Python path correctly (which is the cause of about 98% of all
> import-related problems on this list).
>
> Regards,
> Malcolm
i checked my python path and added two path.
1)DIR=os.path.abspath(__file__)
On Fri, 2009-01-30 at 04:58 -0800, Orcun Avsar wrote:
> im trying to run a seperate script that is on my project directory.
> setup_environ seems called correctly but progmram cant import models
> properly
That likely has nothing at all to do with setup_environ() -- which is
only used to set up t
im trying to run a seperate script that is on my project directory.
setup_environ seems called correctly but progmram cant import models
properly
code:
from django.core.management import setup_environ
import settings
setup_environ(settings)
from indir.program.models import Program, Hit
output:
On Sep 17, 10:41 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
> On Sep 17, 2008, at 11:45 PM, Mathieu Leplatre wrote:
>
>
>
>
>
> > Hi all,
>
> > I am starting a new thread, the first one became off-topic (http://
> > groups.google.com/group/django-users/browse_thread/thread/
> > 34b501d2d1f8849
On Sep 17, 2008, at 11:45 PM, Mathieu Leplatre wrote:
>
> Hi all,
>
> I am starting a new thread, the first one became off-topic (http://
> groups.google.com/group/django-users/browse_thread/thread/
> 34b501d2d1f88496/f8a5d5ef5aeab62a)
>
> I want to do a simple external script that just relies o
Hi all,
I am starting a new thread, the first one became off-topic (http://
groups.google.com/group/django-users/browse_thread/thread/
34b501d2d1f88496/f8a5d5ef5aeab62a)
I want to do a simple external script that just relies on django's
ORM.
So I did a single file testdjango.py :
--
import
Ronaldo, from what I read about signals, I don't think they would help
me writing a standalone script...
On Sep 17, 8:15 am, "Ronaldo Zacarias Afonso"
<[EMAIL PROTECTED]> wrote:
> Hi, I think you can use "Django signal feature". Threre is
> documentation a
gt; Error: No module named p
>> (for polls)
>>
>> If I put my script in a module or remove Meta :
>> File "[...]/django/db/models/base.py", line 51, in __new__
>> kwargs = {"app_label": model_module.__name__.split('.')[-2]}
>> Inde
Error: No module named p
> (for polls)
>
> If I put my script in a module or remove Meta :
> File "[...]/django/db/models/base.py", line 51, in __new__
> kwargs = {"app_label": model_module.__name__.split('.')[-2]}
> IndexError: list index out of
": model_module.__name__.split('.')[-2]}
IndexError: list index out of range
I wanted a simple standalone script with basic database store /
retrieve of objects. Is it utopian ?
Thanks again
On Sep 16, 1:31 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 15
On Mon, Sep 15, 2008 at 8:50 PM, Steve Holden <[EMAIL PROTECTED]> wrote:
> This is k=nd of a wild-assed guess. Please tell me if it works.
>
> from django.core.management import call_command
> call_command('syncdb')
That is the way to do it; the whole manage.py/django-admin.py system
was refactor
Mathieu Leplatre wrote:
> Hi all,
>
> I found many post about specific errors regarding django as a
> standalone tool.
>
> With a little bit of researching, I ended up with this script below.
> Unfortunately, it fails on database initialization.
>
> ...
> ...
> File "/home/mathieu/Code/uhm/svn/uh
Hi all,
I found many post about specific errors regarding django as a
standalone tool.
With a little bit of researching, I ended up with this script below.
Unfortunately, it fails on database initialization.
...
...
File "/home/mathieu/Code/uhm/svn/uhm/django/db/backends/sqlite3/
base.py", lin
>
> Is it syntactically correct to have a views.py which is empty but
> exists? I'm not really sure of the process Django will use to validate
> the view.
Django will look for all view functions that your project's various
urls point to. So those functions need to exist. From that point of
view,
h is empty but
> exists? I'm not really sure of the process Django will use to validate
> the view.
>
> I've also pasted the stack trace to Dpaste:http://dpaste.com/64942/
>
> On Jul 14, 8:35 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
>
> > Hi Mike,
>
t really sure of the process Django will use to validate
the view.
I've also pasted the stack trace to Dpaste: http://dpaste.com/64942/
On Jul 14, 8:35 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> Hi Mike,
>
>
>
>
>
> > I'm running a standalone script
Hi Mike,
>
> I'm running a standalone script outside of the web server to do some
> maintainence tasks.
>
> In particular I need to return the absolute url from one of my models,
> however when I call the get_absolute_url() method, I'm getting a
> ViewDoesNotExist
I was wondering whether anyone can help me with a problem I'm having.
I'm running a standalone script outside of the web server to do some
maintainence tasks.
In particular I need to return the absolute url from one of my models,
however when I call the get_absolute_url() method, I
On Thu, May 1, 2008 at 9:02 PM, dcoy <[EMAIL PROTECTED]> wrote:
>
> What I want to do is to use the django test suite, or more
> specifically the test environment it can set up (with the test-db with
> pre-populated data) to test the client-server part of the system.
Have you looked into the '
Simply put I have a system like this (everything implemented as python
scripts)
* Socket server
- The server receives connections from distributed clients (over
GPRS).
- The clients send data to the server.
- The server uses django models to save the data to database.
* Test client
- Runs a
70 matches
Mail list logo