Re: IntegrityError

2014-03-28 Thread Lukas Nemec
You need to re-create your database. Good way is to create a script that populates your DB with some test data, and drop DB after a major change, or when something breaks, and re-create it. For now, you should try to create different DB (to preserve your data) and do python manage.py

Re: supervisor

2013-10-21 Thread Lukas Nemec
On 10/21/2013 02:51 PM, Diogene Laerce wrote: Thanks for reply. the trick is to add supervisor command that specifically tells the program to NOT daemonize [program:my_uwsgi] command = /usr/local/bin/uwsgi -i /path/to/config.ini autorestart = True user = your_user config.ini: your standard

Re: supervisor

2013-10-21 Thread Lukas Nemec
On 10/21/2013 02:35 PM, Diogene Laerce wrote: Hi, Anyone could share a good process control system software name to use with uwsgi ? Apart from supervisor, I couldn't make it work : - can't stop it only kill it - bug on supervisorctl reload.. Even when using the last version. Thank you Hi,

Re: deploy ?

2013-10-11 Thread Lukas Nemec
Why do you want apache? It is not as good as say Nginx with UWSGI or gunicorn... And there is a lot of information about this. .. http://nemec.lu/en/how-to#django-nginx-uwsgi-ssl enjoy On 10/11/2013 05:40 PM, Diogene Laerce wrote: Actually the default django server works but I can't get

Re: Can't run manage.py runserver (Django 1.5.1)

2013-08-06 Thread Lukas Nemec
+1 At least install some linux distro into VirtualBox, ... Ubuntu if you are beginner... I have W8 on my main machine, but for gaming mainly, for any serious development get linux, on dualboot or vbox ... I tried to do it on Windows, but once you smell the ease of things in linux, you'll

Re: Graph in django

2013-08-06 Thread Lukas Nemec
In that case, create a model in models.py, that represents your plot data.. add some data ... and in views filter some data from that model .. pass them to matplotlib render to image and either send back a image, or save the image and render html with path to that image.. If you don't know

Re: HttpResponse Video

2013-08-06 Thread Lukas Nemec
Well, this may not be the best idea On a production server, you'd make it differently Sure, you could do it this way, but Django should serve dynamic context, so unless you are rendering images on your machine, you should use Nginx, or apache to serve your images, aka. staticfiles/media

Re: Django for corporate web site

2013-08-06 Thread Lukas Nemec
Exactly, tell us what is required on the page.. If it is a simple informational website, with some content, you can either use django's staticpages, or some CMS few examples: https://www.django-cms.org/ https://github.com/lunemec/django-pages # I use this to run my own website On

Re: multiple templates fro single view

2013-08-01 Thread Lukas Nemec
On 08/01/2013 03:04 PM, Harjot Mann wrote: On Thu, Aug 1, 2013 at 6:10 PM, Lukas Nemec <lu.ne...@gmail.com> wrote: Well, after some consideration, result of a view is rendered HTML page which you send to browser, what do you mean by rendering multiple templates? are you talking about te

Re: How to display Chinese in django webpage

2013-08-01 Thread Lukas Nemec
Hi I'd suggest you to contact the developers of Zinnia blog, they should be able to help you easily Cheers :) Lukas On 08/01/2013 10:50 AM, zhao yan wrote: HELLOļ¼š I am a new django user I want to display Chinese in my webpage but it can't this is my settings.py:

Re: multiple templates fro single view

2013-08-01 Thread Lukas Nemec
Well, after some consideration, result of a view is rendered HTML page which you send to browser, what do you mean by rendering multiple templates? are you talking about template inheritance = one root template which all other templates use? in that case, use {% extends 'root.html' %} tag,

Re: showing the checked item alone in template

2013-07-17 Thread Lukas Nemec
I meant like this: views.py: form = PersonActionsForm() actions = form.fields['actions'] # set checked_choice to None checked_choice = None for choice in actions.choices: # if choice.selected (confirm this against request.POST) checked_choice = choice return

Re: new user having trouble displaying images stored on local disk drive

2013-07-17 Thread Lukas Nemec
Hi, You are not the first to have trouble when serving images from django's built-in server. It is not only images, but all staticfiles. I'd like to clarify your settings.py The directory you have put in STATICFILES_DIRS will be available to django as /static/ in your web app, but you need

Re: django template prints

2013-07-17 Thread Lukas Nemec
If you have some DB model where is the data saved, you can do this from project.app.models import NameOfModel # try this, but if it will not work, look at django models help filtered_data = NameOfModel.objects.filter(job_id___gt=29).filter(job_id__lt=401) for d in filtered_data: print d

Re: save data from html table

2013-07-16 Thread Lukas Nemec
uld work.. I'm sorry but I don't have enough information to tell you more ... On 07/16/2013 03:07 PM, Randa Hisham wrote: my problem not to save to database but is how to get data from template On Tue, Jul 16, 2013 at 3:03 PM, Lukas Nemec <lu.ne...@gmail.com <mailto:lu.ne

Re: save data from html table

2013-07-16 Thread Lukas Nemec
That depends, you could use django.db models to access that table, but that depends on the table - there is a ton of information on this subject here: https://docs.djangoproject.com/en/dev/topics/db/models/ Or, you could write a custom SQL that would fetch exactly the data you want, and

Re: Python 2.7 + Django 1.4 + apache 2.4

2013-07-16 Thread Lukas Nemec
Take a look here: https://nemec.lu/en/how-to/~django-nginx-uwsgi-ssl It is not apache, but nginx + uwsgi app + django wsgi.py is generated automatically by manage.py startproject example is here: https://github.com/lunemec/wysiwyg/blob/master/wysiwyg/wsgi.py Note: this is the app that runs