Re: Raw access to cache table

2014-12-22 Thread Erik Cederstrand
Hi Colin, > Den 21/12/2014 kl. 05.55 skrev Collin Anderson : > > If you want a nicer interface, I just ran manage.py inspecdb on one of my > databases and got this for the cache table. Not sure why django still does it > by hand. > > class Cache(models.Model): >

Re: Raw access to cache table

2014-12-19 Thread Erik Cederstrand
> Den 18/12/2014 kl. 12.20 skrev Erik Cederstrand <erik+li...@cederstrand.dk>: > > Hi list, > > I'm using Django as a hub to synchronize data between various external > systems. To do this, I have some long-running Django management commands that > are star

Raw access to cache table

2014-12-18 Thread Erik Cederstrand
Hi list, I'm using Django as a hub to synchronize data between various external systems. To do this, I have some long-running Django management commands that are started as cron jobs. To ensure that only one job is working on a data set at any one time, I have implemented a locking system

Re: Thinking about EAV database model for flexibility. How (in)compatible is it with the django model?

2014-12-15 Thread Erik Cederstrand
> Den 15/12/2014 kl. 14.42 skrev Felipe Faraggi : > > After a little digging I discovered this is called the Entity-attribute-value > model or EAV. And I am currently setting up a project in django in which my > data is very variable because we will be opening up to

Re: Issue with website migration

2014-12-11 Thread Erik Cederstrand
> Den 11/12/2014 kl. 13.13 skrev edalb1979 : > > Good day. > > I have been requested to move a site for someone from there current hosting > company to our hosting company. > > I have gotten so far that the site is up and running but none of the > stylesheets or images are

Re: Django and SSL

2014-12-11 Thread Erik Cederstrand
> Den 10/12/2014 kl. 17.55 skrev pythonista : > 1. Can Django be made hardened via ssl? "Django" is actually your WSGI server (gunicorn, uwsgi etc.). > 2. Doesn't Apache and the Proxy server provide sufficient security so that > ssl / django is not required?

Re: Open a url with user and password

2014-12-09 Thread Erik Cederstrand
> Den 09/12/2014 kl. 14.39 skrev Collin Anderson : > My first guess is that it's using NTLM authentication instead of basic auth. > If you curl -i http://portal:8080/ what "authenticate" headers do you get? > > Also, you should consider upgrading to python 2.7 if you

Re: Mysql connector python 3

2014-12-05 Thread Erik Cederstrand
> Den 05/12/2014 kl. 10.08 skrev Andreas Kuhne : > > I tried the CONN_MAX_AGE setting and it didn't work. We still get problems, > so I'll have to try changing the connector. The only thing left I think. Do you have access to the MySQL server logs? That might give

Re: How to stop testserver from within a test case?

2014-11-18 Thread Erik Cederstrand
> Den 18/11/2014 kl. 16.50 skrev Arun Marathe : > > For a somewhat obscure reason, I need to stop the testserver from within a > test case. Any ideas? > I would like a programmatic solution if possible. Finding a process and > killing it (ps -ef., then grep, > then kill)

Re: Import Error Module

2014-11-12 Thread Erik Cederstrand
> Den 12/11/2014 kl. 01.39 skrev Niall : > > Hi Erik, yes it is installed but it comes up with the following error when I > try to run the server again. > > I know that it is something simple like changing the PYTHONPATH so if you > could advise on why it is happening

Re: Import Error Module

2014-11-11 Thread Erik Cederstrand
> Den 11/11/2014 kl. 15.48 skrev Niall : > > Hello, I was hoping that anyone could please advise me on a very simple issue > which I am having regarding running the dev server (see attachments). I am > receiving the following import error when attempting to run. > >

Re: Django strange behaviour

2014-11-07 Thread Erik Cederstrand
> Den 07/11/2014 kl. 10.08 skrev termopro : > > I have a view in Django which calls external library/class. The problem is > that for some reason Django keeps caching results coming from previous calls > of that class. This is expected Python behaviour - see

Re: Beginner: ManyToManyFields error creating the model / adding values by the Admin Module or the Shell

2014-11-05 Thread Erik Cederstrand
> Den 04/11/2014 kl. 23.07 skrev lnzy3...@gmx.de: > > > Hi Erik, > > the idea was, that one Author can write in more than one language (eg. en and > de), or no one at all. This was the background to use the ManyToManyField. Yes, but then you simply create multiple Interest objects, right?

Re: Beginner: ManyToManyFields error creating the model / adding values by the Admin Module or the Shell

2014-11-04 Thread Erik Cederstrand
> Den 04/11/2014 kl. 19.16 skrev lnzy3...@gmx.de: > > Hi, > Sorry, via the admin interface (Web-GUI) I have inserted the following values: > My Actions > en > Language > > mike.test // t...@test.de > User > > Dan Brown > Author > > If I now try to add an Interest (“Dan Brown” and “en”) via the

Re: Beginner: ManyToManyFields error creating the model / adding values by the Admin Module or the Shell

2014-11-04 Thread Erik Cederstrand
> Den 04/11/2014 kl. 10.57 skrev lnzy3...@gmx.de: > [...] > Now I try to add some User with an Interest using the Admin module or the > Shell to find out how to do that (real syntax and model) by the “site”. But > unfortunately both the shell and furthermore the graphical admin module give > me

Re: pycurl and SSLv3

2014-10-30 Thread Erik Cederstrand
> Den 30/10/2014 kl. 15.50 skrev john : > > On the server side of my Django website I use pycurl (version 7.20.x) to > connect to authorize.net (to send credit card info). On Nov 4 Authorize.net > will turn off SSLv3. So I'm wondering if my use pycurl will continue to >

Re: Slow SQL query

2014-10-29 Thread Erik Cederstrand
> Den 29/10/2014 kl. 18.15 skrev Collin Anderson : > > Right, in practice it should be less than 1000 returned rows. > > I've changed the code to run the query without the status != 4 clause, and > manually filtering that out using python, because, yes, 97% of the rows are

Re: Slow SQL query

2014-10-27 Thread Erik Cederstrand
> Den 27/10/2014 kl. 14.55 skrev Collin Anderson : > > Hi Erik, > > No luck... > > mysql> show indexes in order_order; >

Re: Slow SQL query

2014-10-27 Thread Erik Cederstrand
> Den 27/10/2014 kl. 13.20 skrev Collin Anderson : > > mysql> explain SELECT COUNT(*) > -> FROM `order_order` > -> WHERE `order_order`.`status` != 4 > -> AND (`order_order`.`user_id` = 12345 OR `order_order`.`account_number` > -> = 123456); >

Re: making an http request internally

2014-10-17 Thread Erik Cederstrand
> Den 17/10/2014 kl. 06.02 skrev jus...@fanout.io: > > I am writing a middleware class that needs to be able to make HTTP requests > to the application as part of it's processing. I'd like to be able to do this > internal to the Django app if possible, rather than having to make external >

Re: TemplateSyntaxError

2014-10-08 Thread Erik Cederstrand
Den 08/10/2014 kl. 06.04 skrev Petar Pilipovic : > Hi all, I am currently under going a blog tutorial from > http://matthewdaly.co.uk/blog/2014/01/02/django-blog-tutorial-the-next-generation-part-2/, > and I am stuck whit makrdown, I am aware that Django not supporting it any

Re: How to trace a page not showing up?

2014-10-07 Thread Erik Cederstrand
Den 07/10/2014 kl. 12.57 skrev Helgi Örn Helgason : > Hi! > I am quite new when it comes to Django and Python. I am responsible for a > rather disfunctional Django website package which is rather messy (I have > this confirmed by an experienced Django/Pyton developer who

Re: Cannot import models from utility script

2014-10-06 Thread Erik Cederstrand
Den 06/10/2014 kl. 04.54 skrev Sithembewena Lloyd Dube : > Hi all, > > I am using Django 1.7 and I have a package called 'utilities' next to my app > package like so: > > --> my project > --> my_app > -- __init__.py > -- models.py > --> utilities >

Re: Please help: urgent deployment problem with django post office

2014-10-02 Thread Erik Cederstrand
Den 02/10/2014 kl. 16.37 skrev Sabine Maennel : > Please help! > > I want to deploy tomorrow. The problem is that django post office logs > INTERNAL Errors into the the table "postoffice_emails". I do not know why. It > is about some broken links. I guess I can fix

Re: Force date and time formats to ISO

2014-10-02 Thread Erik Cederstrand
Den 01/10/2014 kl. 14.59 skrev Mike Dewhirst : > On 1/10/2014 10:35 PM, Collin Anderson wrote: >> I wonder if it's possible to somehow use a custom locale that will >> always show ISO dates. > > I believe some of the Scandinavian countries use ISO natively ... Except the

Re: Config: DB or git?

2014-09-29 Thread Erik Cederstrand
Den 29/09/2014 kl. 16.11 skrev Derek : > > So is it possible to store encrypted database passwords in the Django > settings (or local_settings) file? Yes. A simple solution would be to use a symmetric encryption like simple-crypt to encrypt and decrypt your passwords

Re: Config: DB or git?

2014-09-29 Thread Erik Cederstrand
Den 29/09/2014 kl. 15.04 skrev Thomas Güttler : > Hi, > > of course we separate data from code: > > - code belongs into version control (git) > - data belongs into a database (postgres) > > But where does configuration belong? Strictly speaking, configuration belongs in a

Re: How to express a seemingly straightforward upate in the ORM?

2014-09-13 Thread Erik Cederstrand
Den 12/09/2014 kl. 20.19 skrev Benjamin Scherrey : > I should assume then that this is something that the existing Django ORM > cannot model? It's a bit hard for me to grok your initial mail, but maybe you can use the new Prefetch() class in Django 1.7 to filter your

Re: Feeling some serious timezone pain

2014-08-21 Thread Erik Cederstrand
Den 21/08/2014 kl. 00.09 skrev Chris Whiten : > I can understand that sentiment... But that doesn't change the fact that > 12:00 PM on the Python side renders as 11 AM in the template, right? Your database stores the datetime as (the equivalent of) 16:00 UTC, right?

Re: Feeling some serious timezone pain

2014-08-20 Thread Erik Cederstrand
Den 20/08/2014 kl. 14.22 skrev christophw : > When the booking is stored, it comes back from a post and I store it in the > DB as such: > > dt = datetime.datetime.strptime(request.POST["date"] + " " + > request.POST["time"], "%Y-%m-%d %H:%M") > dt =

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

Re: How to cache a dynamic web page in django

2014-08-07 Thread Erik Cederstrand
Den 07/08/2014 kl. 08.22 skrev Chen Xu : > Hi Everyone, > I have a dynamic page which generates some data from the database, but the > content in the database might be the same for everyone or for a long time, so > I wonder what is the best way to cache the page so that it

Re: urlconf problem

2014-08-06 Thread Erik Cederstrand
Den 06/08/2014 kl. 01.00 skrev Joel Goldstick : > I have this: > > from django.conf.urls import patterns, include, url > > from django.contrib import admin, admindocs > import blog_app > > admin.autodiscover() > > patterns = patterns('', >url(r'^admin/doc/',

Re: Atomic request

2014-08-05 Thread Erik Cederstrand
Den 05/08/2014 kl. 13.47 skrev Akshay Mukadam : > How to set ATOMIC_REQUEST=TRUE in django In the DATABASES dict in settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(SITE_ROOT, 'test.db'),

Re: on manage.py migrate appname I get: AttributeError: 'module' object has no attribute 'Migration'

2014-06-25 Thread Erik Cederstrand
Den 25/06/2014 kl. 21.30 skrev Michael Lind Hjulskov : > Hi Erik > > Thank You > > I tried ./manage.py migrate myappname --traceback > Still the same error message and no more info available than before. Check your migrations folder and make sure you only have South

Re: on manage.py migrate appname I get: AttributeError: 'module' object has no attribute 'Migration'

2014-06-25 Thread Erik Cederstrand
Den 25/06/2014 kl. 16.19 skrev Michael Lind Hjulskov : > Hi there :) > > I'm stuck with this problem > when I run python manage.py migrate myappname i get the following error: > AttributeError: 'module' object has no attribute 'Migration' > > I remember I had this problem

Re: Database problem in Django

2014-06-18 Thread Erik Cederstrand
Den 18/06/2014 kl. 14.31 skrev Glen Jungels : > It will be different depending on the database (assuming you are asking about > the query only). You will need to do an order by on either your auto > incremented field or dat field plus something like a limit 2 (Postgres

Re: Conver sql to orm django

2014-06-17 Thread Erik Cederstrand
Den 16/06/2014 kl. 20.49 skrev jose alejandro hernandez rosales : > Hi , everyone i have a little problem, how do I convert this sql sentence to > ORM? > > SELECT * FROM CLIENTS > LEFT JOIN rutas ON > clientes.ruta_id = rutas.ID > LLEFT JOIN repartidores ON >

Re: Massive import in Django database

2014-06-12 Thread Erik Cederstrand
Den 11/06/2014 kl. 15.14 skrev John Carlo : > Hello everybody, > > I've fallen in love with Django two years ago and I've been using it for my > job projects. In the past I found very useful information in this group, so a > big thank you guys! > > I have a little

Re: Django Python roop

2014-06-11 Thread Erik Cederstrand
Den 11/06/2014 kl. 14.49 skrev hito koto : > MemoryError , Why? idon't know. > I try this have Traceback (most recent call last): > File "", line 1, in > File "", line 5, in foo > MemoryError errors: > > I'm change to this code: have the Memory Error, > > def

Re: Django Login/Session Not Sticking

2014-06-10 Thread Erik Cederstrand
Den 10/06/2014 kl. 09.08 skrev Juergen Schackmann : > I do have the same issue with django admin, and definitely no custom js > there. any other ideas??? You need to reduce the problem. Scale down to only one app server and re-run your tests. If the problem

Re: Django Login/Session Not Sticking

2014-06-05 Thread Erik Cederstrand
Den 04/06/2014 kl. 13.55 skrev Juergen Schackmann : > The production site is served via a load balancer and 8 application servers. > Even stranger: if I test the same code (with the same settings) on a test > server, that is not load balanced and basically has not

Re: editable models (db schema) for admin (no developer)

2014-06-03 Thread Erik Cederstrand
Den 03/06/2014 kl. 15.57 skrev Thomas Güttler : > I am a software developer and like the way django ORM defines the database > (via models.py) very much. > > Unfortunately for a new project, we have the constraint, that the admin must > be able > to add some columns. The

Re: Django export the CSV file of objects form databas

2014-05-21 Thread Erik Cederstrand
Den 21/05/2014 kl. 05.21 skrev hito koto : > Hello, > > I have the following errors: why append is not done? > > row = [[0 for i in range(5)] for i in range(31)] Here you are creating a list of lists of 0's (a 2-dimensional matrix of ints). > for a in

Re: What happens when secret key is lost?

2014-05-20 Thread Erik Cederstrand
Den 20/05/2014 kl. 20.40 skrev Henning Sprang : > Also, if it should be kept secret, I guess it's safe to assume that > using an online generator like > https://djskgen.herokuapp.com/ is not the smartest idea one can come > up with, right? You can use any random string,

Re: Django create userprofile

2014-05-12 Thread Erik Cederstrand
Den 12/05/2014 kl. 11.38 skrev hito koto : > Ok, Thank you! > > So, this is my the full codes; Are you sure your database is in sync with your model? The error message implies that the field is defined with unique=True, but your model doesn't define it so:

Re: Django create userprofile

2014-05-12 Thread Erik Cederstrand
Den 12/05/2014 kl. 10.53 skrev hito koto : > Hi, > > i have this error , why ? > > > (1062, "Duplicate entry '1' for key 'start_work_id'") > Exception Type: IntegrityError > Exception Value: > (1062, "Duplicate entry '1' for key 'start_work_id'" Please post

Re: problem with django, nginx and gunicorn

2014-05-01 Thread Erik Cederstrand
Den 01/05/2014 kl. 13.11 skrev 'ReneMarxis' via Django users : > Now to my problem... Doing one blocking call to my app, and having only on > worker, blocks my entire application. > In the gunicorn logs (startup) i can see, that gevent is used, but the calls >

Re: Http request with multiple files is not able to read by django server

2014-04-25 Thread Erik Cederstrand
Den 25/04/2014 kl. 14.39 skrev kousik chowdhury : > After going through all the links related to this problem, I come to know > that this problem may happen because of the **broken request** That is if > someone cancelled the request in between. > > As my request is an

Re: Reading from a file and displaying into a table on the web app.

2014-04-24 Thread Erik Cederstrand
Den 24/04/2014 kl. 16.46 skrev Ravi Hemnani : > def table(request): > with open('/home/ravi/python/temp.txt', 'r') as f: > for line in f: > context = {'line': line} Here you are ovwewriting 'content' on every iteration.

Re: Django and SSL

2014-04-24 Thread Erik Cederstrand
Den 24/04/2014 kl. 09.35 skrev Venkatraman S : > Hi, > > Am an SSL newbie and am trying to understand various facets of moving a > webapp to ssl. Are there any learnings that the group can share w.r.t moving > a django site to ssl? Any pitfalls or things to be careful

Re: settings set in stone on import?

2014-03-28 Thread Erik Cederstrand
Hello Tin, Den 27/03/2014 kl. 22.45 skrev Tin Tvrtković : > Is there a way to make Django reread DJANGO_SETTINGS_MODULE after it has been > imported? Also, it would seem django.core.management.call_command doesn't > take a 'settings' keyword argument, like django-admin.py

Re: Self referencing models initialization

2014-03-13 Thread Erik Cederstrand
Den 13/03/2014 kl. 06.34 skrev Santiago Palacio Gómez : > Hi everyone, > > I'm a Django newbie, and I was following the tutorial for 1.6, creating a new > app where one of the models is self-referencing. They ask to, in manage.py > shell, create an instance of the model.

Re: Running into Unicode Decode Error when using django-admin.py startproject.

2014-03-11 Thread Erik Cederstrand
This might be because you have non-ASCII characters somewhere in your file path. Try getting a stacktrace to see where the error comes from: django-admin.py startproject mysite --traceback Erik Den 11/03/2014 kl. 18.13 skrev Billy Garnet : > I am having the same issue.

Re: a report problem

2014-02-25 Thread Erik Cederstrand
Den 25/02/2014 kl. 17.10 skrev MikeKJ : > model: > class Dates(models.Model): > this_date = models.DateField() > > class Booking(models.Model) > seats = models.IntegerField() > date = models.ForeignKey(Dates) > > report view: > this_date = "01-01-2000" >

Re: how to make https work in django REST framework

2014-02-13 Thread Erik Cederstrand
Den 13/02/2014 kl. 06.16 skrev zhenwu he : > > Thanks for your help, Luca. > > Could you elaborate a little bit? I am kind of new to this kind of thing. > What I am doing is that, I am using django to redirect all url calls to > python API to handle something and then

Re: 'Model' object has no attribute 'replace'

2014-02-12 Thread Erik Cederstrand
Den 12/02/2014 kl. 22.31 skrev strelnikov : > did anybody solve this kind of inconsistency? > > > https://code.djangoproject.com/ticket/22033#ticket There's zero information there. Post your model code if you want help. Erik -- You received this message because

Re: Saving a large queryset to a M2M field

2014-02-12 Thread Erik Cederstrand
Den 12/02/2014 kl. 19.52 skrev Lucas Roesler : > Hi, I am currently having trouble saving a large queryset to a M2M field > (approx. 100k objects). The queryset is being generated by the admin list > view and I am passing it to the add view by storing the list of

Re: failure of auto increment in inndb (mysql)

2014-01-27 Thread Erik Cederstrand
Den 27/01/2014 kl. 20.13 skrev Tom Lockhart : >> ... >> Now Jane Smith has the same ID as John Doe had previously. This may not be a >> problem in your situation, or it might. Anyway it's good practice to never >> re-purpose an ID. > > MySQL started as a non-ACID query

Re: failure of auto increment in inndb (mysql)

2014-01-27 Thread Erik Cederstrand
Den 27/01/2014 kl. 17.22 skrev Malik Rumi : > I read this on the django project site: > Since MySQL 5.5.5, the default storage engine is InnoDB. This engine is fully > transactional and supports foreign key references. It's probably the best > choice at this point.

Re: Exiting from a management command with a given exit status

2014-01-23 Thread Erik Cederstrand
Den 23/01/2014 kl. 15.06 skrev Johannes Schneider : > Hi List, > see the question in the subject. I want to return from a management command > with a given exit code. How can this be done? class Command(BaseCommand): def handle(self, *args, **options):

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-21 Thread Erik Cederstrand
Den 21/01/2014 kl. 10.55 skrev Johannes Schneider : > yes, but the problem is that we manually give them a pk. > > Maye it's the best to reduce the question to the following: > Which (undocumented) field is better for this case? > * instance._state.db

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-21 Thread Erik Cederstrand
Den 21/01/2014 kl. 08.58 skrev Johannes Schneider : > maybe I I formulated it not precise enough. > I need to check if some instance of a model comes from some database query > (e.g. via get(..)) or is instanciated 'by hand'. and not jet written to the >

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-17 Thread Erik Cederstrand
Den 16/01/2014 kl. 17.50 skrev Johannes Schneider : > The point is, I have to distinguish between an instance which is created, but > its save method is not yet called. And an instance coming from the database > via a manager. Okay, then create an instance

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-16 Thread Erik Cederstrand
Den 16/01/2014 kl. 14.27 skrev Johannes Schneider : > Hi List, > I need to check, if a given instance of a Model already exists in the > Database. I cannot check 'instance.pk is None', because there are manually > given PKs (no discussion about this plz). >

Re: Encoding UTF 8 (añ,etc) and datetime function

2014-01-14 Thread Erik Cederstrand
Den 14/01/2014 kl. 17.04 skrev David Pineda : > Hello, i'm beginning to learn python+django and i'm doing that handbook > https://github.com/jacobian/djangobook.com/blob/master/chapter03.rst > In the example whit datetime i have a problem when i active the utf-8 > encondig

Re: Jquery Ajax Autocomplete

2014-01-14 Thread Erik Cederstrand
Den 14/01/2014 kl. 15.22 skrev Ali Hayder : > Hello > Timothy W. Cook > Thanks for your quick answere. I followed your link > "http://flaviusim.com/blog/AJAX-Autocomplete-Search-with-Django-and-jQuery/;. > It's not working. I am providing you the mozilla firefox debug

Re: New in Django

2014-01-14 Thread Erik Cederstrand
Den 14/01/2014 kl. 14.32 skrev Anu Malik : > I'm new in Django,i am not sure how pickling/caching works? There’s a description of Django caching here: https://docs.djangoproject.com/en/dev/topics/cache/ Django uses the Python pickle module internally:

Re: need django.cache advice

2014-01-09 Thread Erik Cederstrand
Den 09/01/2014 kl. 22.43 skrev Sells, Fred : > Fred: I was unclear. The initial join is 1 x 1000 x 20 x 100 ... which > gets reduced to about 1000 records. This still shouldn’t be a problem as long as the database has proper indexes. Is the reduction to (at

Re: need django.cache advice

2014-01-09 Thread Erik Cederstrand
Den 09/01/2014 kl. 21.28 skrev Sells, Fred : > I was thinking about updating the data (queryset) once a minute on a cron job > and saving that in the django.cache > > Then each terminal would access the cache and and get the subset that applies > to them. > >

Re: How to combine multiple querysets and remove duplicates?

2014-01-09 Thread Erik Cederstrand
Den 09/01/2014 kl. 08.29 skrev Rodney Lewis : > Please help with my question I posted to StackOverflow: > > http://stackoverflow.com/questions/21013973/how-to-combine-multiple-querysets-and-remove-duplicates If the answer you got there doesn’t solve your problem, then please

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 17.56 skrev Daniel Roseman : > > No, no, no. None of this is true. > > Decimals are not a differently-formatted version of floats. Decimals are not > a built-in datatype in Python, it's true, but they are provided in the > standard library in (not

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 17.11 skrev Timothy W. Cook : > But one would think that if Django calls it a decimal field, it would convert > the float to decimal. > I suppose I'll do that before writing it out to the file (an XML schema) so > it really isn't a big deal, just surprising.

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 16.18 skrev Timothy W. Cook : > I have several decimal fields defined in the model like this: > > min_inclusive = models.DecimalField(_('minimum inclusive'), max_digits=19, > decimal_places=10, help_text=_("Enter the minimum (inclusive) value for this >

Re: building multiple dynamic websites on the fly

2014-01-08 Thread Erik Cederstrand
Den 07/01/2014 kl. 14.40 skrev Mrinmoy Das : > Is there a pure django solution towards this problem? There is the Django sites framework to help you decide what to do depending on the domain name you are receiving. See

Re: building multiple dynamic websites on the fly

2014-01-07 Thread Erik Cederstrand
Den 07/01/2014 kl. 11.03 skrev Mrinmoy Das : > I am thinking of building an application which will enable users to build > their own websites on the fly. On my app you will need to sign-up and then > from their you can make your own websites from your profile (with your

Re: wait processing

2014-01-05 Thread Erik Cederstrand
Den 05/01/2014 kl. 13.44 skrev pointmuriae castro : > I am needing to display a wait message while processing perform some process > on the server anyone could help me A simple option is to run your processing via Celery or some other task queue. You then store the

Re: fire and "forget" in a view

2013-12-20 Thread Erik Cederstrand
Den 20/12/2013 kl. 12.11 skrev Christian Schulz : > in my views i have method calls which might be take some time. It is > sufficient to return a simple message and request > the result in another step. > > I explore celery , but It might be to complex , because I have

Re: Do I need to migrate pre-existing code into Django?

2013-12-18 Thread Erik Cederstrand
Den 17/12/2013 kl. 22.14 skrev Tyler Meche : > I have recently created a website, using PHP. No framework or anything else > was used, just code. > > Now, I need to make an API for this website. It was suggested that I use > Django as a framework. I was hoping to just be

Re: Succeeding with SSL

2010-12-25 Thread Erik Cederstrand
Den 22/12/2010 kl. 17.17 skrev Jakob H: > Hi, > > I have a Django site hosted on Bluehost, and I'm trying to get SSL to > work, but have some problems. I've got a dedicated IP with SSL > certificates all ready to go. > > 1. Whenever I enter a https://... I'm automatically re-directed to a >

Re: Custom SQL questions

2010-12-19 Thread Erik Cederstrand
Den 19/12/2010 kl. 22.17 skrev Andy: > On Dec 19, 3:48 pm, Maksymus007 wrote: >> you get array of arrays. >> First array contains rows. Every row is just an array of fields, order is >> the same as in your query. > > What if my query is "SELECT * FROM ..."? > > In that

Re: Django as huge image host

2010-12-17 Thread Erik Cederstrand
Den 17/12/2010 kl. 10.28 skrev Shamail Tayyab: >I have this situation.. > > - We need to serve static files(images), lots of them, probably 100s > of them per second. > > Our website is in Django and we need to support something like this: > > 1. a URL like /xyz.jpg should open an image.

Re: csrf_token not enclosed in hidden element

2010-11-04 Thread Erik Cederstrand
; -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. Med venlig hilsen, Erik Cederstrand Affect IT Tlf: 22 66 07 67 Mail: e...@affect-it.dk smime.p7s Description: S/MIME cryptographic signature

csrf_token not enclosed in hidden element

2010-11-04 Thread Erik Cederstrand
Hi, I have a view that creates a login page. I use the @csrf_protect decorator on my view and {{csrf_token}} tag in the template, and the generated response contains the csrf token. The problem is that the token is printed as-is instead of being enclosed i a hidden element, as I understand

Re: django, celery and mysql: Lost connection to MySQL server during query

2010-10-10 Thread Erik Cederstrand
Den 10/10/2010 kl. 17.55 skrev Massimiliano della Rovere: > > * Which process(es) on the server is using 100% CPU time? > directly from htop: > PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command > 544 mader 20 0 969M 953M 1444 R 96.0 47.4 50:09.85 python > ./manage.py

Re: django, celery and mysql: Lost connection to MySQL server during query

2010-10-10 Thread Erik Cederstrand
Den 10/10/2010 kl. 16.34 skrev Massimiliano della Rovere: > Using django 1.2.3 with celery 2.0.3 and django-celery 2.0.3 and mysql > 5.1.41 on kubuntu 10.04, I receive the following error: > OperationalError(2013, 'Lost connection to MySQL server during query'). > > The error occurs every time

Re: notification in python

2010-09-28 Thread Erik Cederstrand
Harryos, Den 28/09/2010 kl. 09.56 skrev harryos: > thanks Erik, > By 'update' I meant a major addition/removal of text(say 100 > characters). > Initially I thought of making hash of a page and comparing it to the > saved hash of the same page at a different moment of time..But ,this > would >

Re: notification in python

2010-09-27 Thread Erik Cederstrand
Den 27/09/2010 kl. 19.02 skrev harryos: > thanks for the pointer > I am trying to get something similar to changedetection but with > hourly updates. > I need to get updates from a number of sites..So I was wondering how > to implement an updating utility You could also try looking at the HTTP

Re: Saving File/Image in tmp. I'm in trouble ...

2010-07-13 Thread Erik Cederstrand
Den 13/07/2010 kl. 13.34 skrev The Danny Bos: > > Good point re: if I can upload it to tmp, surely I can delete it. I'll > give that another crack. > > Kenneth, > It doesn't delete it from tmp by default in my case, which is why > they're on my back. Turned out there were 40,000 files in

Re: Saving File/Image in tmp. I'm in trouble ...

2010-07-13 Thread Erik Cederstrand
Den 13/07/2010 kl. 13.06 skrev The Danny Bos: > I can't get access to the servers own tmp path, only my own "/home/ > 72999/data/tmp" which the file isn't saving to. If you can't get access to /tmp, how did the files get there in the first place? Erik smime.p7s Description: S/MIME

Re: Managing the balance between SSL and impact on the server

2010-07-01 Thread Erik Cederstrand
Den 01/07/2010 kl. 11.02 skrev ALJ: > I have an extranet for staff and known partners. It has absolutely no > public content. I've installed SSL so it should be secure, but I also > heard that SSL can have a big impact on the server. Just measure it instead of guessing. Enable system monitoring

<    1   2