Re: installing Django on Mac OS 10.6

2009-10-22 Thread dk

Perhaps you could post about your results.  I tried this, in setting
up a deployment server, and ran into roadblocks (which I did not
document) so I switched to sqlite.  The latter comes with the python
on snow-leopard, and the only issues I had were with permissions; I
had to make the database AND the directory holding my source code
writable by _www.

On Oct 21, 11:49 am, robin  wrote:
> Thank you very very much. I am off install the module.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~--~~~~--~~--~--~---



Re: OS X 10.6 Snow Leopard Setup Tutorial

2010-01-16 Thread dk
Thanks for posting this.  You are right -- OSX is not an easy platform
for development, because apple has nothing akin to apt-get.  (Why they
have not done this, I cannot guess.  Surely it cannot be because
people find macports and fink to be reliable and useful.)

A couple of points:

1. I found that:

sudo easy_install mysql-python

worked well, which saves a bit of editing and compiling.

2. Using this (at least with fastcgi) is problematic, because the
webserver user ("_www" on OSX) tries to write eggs to locations in
which it lacks permissions.  I guess the solution is to add the
following:

os.environ['PYTHON_EGG_CACHE'] = "..."

to the fastcgi script, in which the ... is replaced with something
that is sensible and safe.  But I'm not too sure what is sensible
(e.g. things in /tmp get erased by cron jobs) and I certainly have no
idea what is safe, so I punted and switched to sqlite3, which seems to
work well.

3. A DMG would be terrific.

Thanks much for posting this.

-- 
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.




how to do a form with elements drawn from database (not hard-wired in forms.py)?

2010-01-18 Thread dk
I have an application in which I'd like to present a form whose
elements are stored in a database.  To be specific, the database
contains a series of questions that I'd like to ask the user, via
radio buttons.

I can't do e.g.

 class thingee(forms.Form):
 q1 = forms.BooleanField()
 q2 = forms.BooleanField()

and so forth, because the code doesn't "know" how many questions will
be asked (nor, of course, the labels for the questions, not shown
above).

Is there a way to do this?  I've tried putting e.g. the following in
my template

-- 
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.




Re: how to do a form with elements drawn from database (not hard-wired in forms.py)?

2010-01-19 Thread dk
The suggestions provided in the replies have all been very helpful to
me.  I appreciate the help greatly, and I suspect that others coming
across this thread on google-groups will find the advice helpful, as
well.

I ended up doing as follows in my forms.py, and it works nicely for
me.


class MyForm(forms.Form):
def __init__(self, *args, **kwargs):
super(AddDreamForm, self).__init__(*args, **kwargs)
for tag in Tag.objects.all().filter(required=True):
self.fields[tag.content] = forms.BooleanField
(required=False,
 
label=tag.content)

-- 
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.




Re: Newbie Django Mac OS X suggestions.

2010-01-31 Thread dk
I agree with Dave.  Since we're on the anecdote topic, I'll explain
with my own.

Ignoring a bit of time with VMS, I have been a *nix user since the
1980s.  My path has been from BSD to solaris to linux to osx.  A
pleasure in moving from solaris to linux, was the tools for bulding/
install software.  Rpm, yum, apt-get, etc. are very handy when you
just want to get things done and are really not interested in patching
code, or applying patches of questionable provenance.

When I switched to OSX, I thought it would be great to have build/
install tool, and so Fink and Macports were both attractive to me.  I
started with Fink, but something (that I don't recall) annoyed me, so
I switched to Macports.  After a while, though, it too started to wear
thin.

1. Some things were not ported yet.

2. Some ports were not up-to-date.  [Confession: I had ported one of
my own packages (see gri.sf.net) and I didn't even keep that up to
date, partly because it was tiresome having to adjust to slight
changes in the port driver files.]

3. Macports suffers a bit of "dependency hell", as the linux people
call it.  An update to one package can necessitate updates to many
more packages.  (I've done "port" commands that took many hours, just
to update something trivial.)

4. The apple-supplied utilities (compilers and such) are now much more
up to date, so there's no need to use macports to get something
recent.

5. A lot of applications (gui-based software) have been ported
directly to the OSX environment, and are available as self-contained
packages.

Given all of this, I didn't even bother installing macports on the OSX
machines I bought in 2009.  There seemed to be no need at the time.
And, months in, I've not felt any need to install it.  On those rare
occasions when software was not pre-built, I just built it the old-
fashioned way, with ./configure and make.  Very rarely, a patch might
have to be applied, but I'd rather see such things explained on blogs
than trust a patch supplied in a port file.

-- 
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.



django mogilefs file backend?

2012-11-11 Thread DK
Is there any working django 1.4 file backend for MogileFS?

I've tried django-storages but it doesn't seem to work properly (stores a 
filename instead of content!?) and it does not implement open() method on 
stored file.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-EVkqvpQwmQJ.
To post to this group, send email to django-users@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.



Re: django mogilefs file backend?

2012-11-13 Thread DK
If somebody search for mogilefs django backend, I've ended up with writing 
my own:
https://github.com/cypreess/django-mogilefs-storage

it uses internally pymogile client.

On Sunday, November 11, 2012 10:23:57 PM UTC+1, DK wrote:
>
> Is there any working django 1.4 file backend for MogileFS?
>
> I've tried django-storages but it doesn't seem to work properly (stores a 
> filename instead of content!?) and it does not implement open() method on 
> stored file.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PZ0HJqKHI_4J.
To post to this group, send email to django-users@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.



Formsets and new 1.3 class based views

2011-05-11 Thread DK
What is a proper way to handle formsets with new class based views?
Should I use standard forms views like CreateView, I did not saw any
views dedicated to handle formsets.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.



Re: Formsets and new 1.3 class based views

2011-05-11 Thread DK
Fantastic piece of work. I will try to dive into.
DK

On May 11, 8:02 pm, Iván Raskovsky  wrote:
> On Wed, May 11, 2011 at 1:29 PM, DK  wrote:
> > What is a proper way to handle formsets with new class based views?
> > Should I use standard forms views like CreateView, I did not saw any
> > views dedicated to handle formsets.
>
> Hi DK. I've faced the same issue some weeks ago, and I decided to make
> my own CBV to handle formsets, modelformsets and inlines :)
>
> I haven't released them yet, cause I haven't had the proper time to
> document them, but the code is full of docstrings and commentaries and
> I'm using them in production. You can find them in my github repo[0].
>
> I think you'll find them easy enough to understand, but if you have
> any doubts you can query me on #django or email me. Of course any
> issue report or pull request is more than welcome!
>     Iván
>
> [0]https://github.com/rasca/django-enhanced-cbv

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.



How do you organize your deployment enviroment

2011-05-23 Thread DK
Hi,

I am having a django project that  is being frequently deployed on clean 
linux installation. After a few deployments I have noticed that this process 
is very time consuming for me (every time I am preparing run scripts for 
everything, configuring cronjobs, paths to log files, etc) but this could 
be easily automated.

What are a ready solutions to manage such deployments?

My typical workflow is:
1) install packages on debian/ubuntu via aptitude (like database, etc)
2) creating new virtualenv + getting pip
3) pip install -r requirements (to setup enviroment)
4) fetch django project from code repository
5) setup runtime dir (I keep there: run - for pid files, logs, conf - for 
some config variables or scritps, scripts - some starting srcipts)
6) setup crontab jobs 
7) setup webserver + django wsgi to be started 


Sure - I can write some custom made installer for that, but wondering if 
there is some generic tool for such things.

PS. I have heard about fabric, but didn't investigate this tool yet. 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.



Re: How do you organize your deployment enviroment

2011-05-23 Thread DK
What is your optimal filesystem folder scheme?

I've used to keep everything in one directory (project-enviroment, that was 
itself a virtualenv directory) and then put everything there, but now I am 
finding hard to manage this as it became a little mess. Now I think about 
something like:

/
   home/
   project_user/
 env/(<- virtual env goes here, no custom things, set up 
with pip requiremnts )
 some_project/  ( <- this is project directory easily keeping up 
to date with some versioning system)
 runmanager/ ( <- collection of generic scripts for 
running django projects etc,  versioned )
 runtime/  (<- here goes all runtime stuff, like run, logs, 
conf, this should be preconfigured by invoking a specific command from 
runmanager, this cannot be versioned, these are installation specific files)


any better idea/practices?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.



Re: How do you organize your deployment enviroment

2011-05-25 Thread DK
100% south migration :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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.



Single auth database for multiple (different) django projects

2011-06-16 Thread DK
Hi,

I need to develop several django projects (let's assume that there are 
highly different one from each other). The common thing is users/groups 
data. If a user register into one of this sites, he should be able to use 
this same account credentials for all other sites.

I really didn't find any obvious solution to this problem:

1) Keeping everything in one database (single django project) - not 
possible, every of a project is big enough to be worth keeping separate, 
also using something like SITES (not really an issue here)  would provide do 
keeping data of all separate projects in one big database, what will cause a 
problems with maintenance (backuping everything together, etc.)

2) Using django multiple database support -  this would be great to put auth 
models into seperate common database, but django does not officially support 
multidatabase foreign key relations - making this useless. Any model with 
relation to auth.User would not be supported this way (in my projects almost 
every thing is somehow conneted to the user so this is dead end for me).

3) Using several databases and keeping auth tables in sync by external tool 
- very, very error prone. Writing something that deals with coherency 
problem will be very difficult, and there also will be a delay between 
sync's of databases in several projects - not really acceptable - user data 
should be stored in one point.

4) Creating central authorization point with Profiles, and make custom 
django authorization module that would work exaclty like OpenID 
authorization. But this still do not solve problem of NOT having multiple 
accounts in several django projects (even connected to one central Profile).

Any idea?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/2m_lo5mn8sYJ.
To post to this group, send email to django-users@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.



Re: Single auth database for multiple (different) django projects

2011-06-16 Thread DK


On Thursday, June 16, 2011 2:38:52 PM UTC+2, SleepyCal wrote:
>
>
> Having a central authorization point is the way forward. I'm a bit confused 
> by this comment though:
>
> "But this still do not solve problem of NOT having multiple accounts in 
> several django projects"
>
> Could you explain what you mean?
>

As far as I know, using authorization like Google Account, Facebook or 
OpenID just makes that user has an auto generated account in Django 
connected with external account (for example Google Account). So still - you 
bypass only the fact of logging, but storing/editing user profile, some 
other additional data is complicated and involves using this auto-generated 
accounts in django.


I hope  you get my point.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/8qBkZkMn5E0J.
To post to this group, send email to django-users@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.



passing a list of list to a template

2015-02-12 Thread dk
i do have a list  of list like this
[  [apple, banana, red] ,  [orange, grape, blue] ,  [watermelon, tangerine, 
purple]   ]


then i am passing it to the template like
return render(request, "show_table.html", {"lista": lista})
inside my template html i have 



{% for i in lista %}

{{ i }}
{# > Temp  #}
{# {{ i }}#}


{% endfor %}




but how can i select i[0]   or i[2] to put then into a diferent column?
might be a better trick on how to send it?
thanks.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ec4f230b-73f0-495c-ad2d-db921ed227cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: passing a list of list to a template

2015-02-13 Thread dk
I am assuming in django  doing i.1  or i.2  will be the same as  i[1],  
i[2] right?

can I do if statements too?  like if i.2 == to somestuff? do something? or 
all that need to be set in the view function?

thanks 


On Thursday, February 12, 2015 at 12:15:50 PM UTC-6, Vijay Khemlani wrote:

> If you have a fixed number of items in each of the sublists you can do
>
> {{ i.0 }}   # First element
> {{ i.1 }}   # Second element
>
> or you can iterate over it
>
> {% for sub_element in i %}
> {{ sub_element }}
> {% endfor %}
>
> On Thu, Feb 12, 2015 at 2:55 PM, dk > 
> wrote:
>
>> i do have a list  of list like this
>> [  [apple, banana, red] ,  [orange, grape, blue] ,  [watermelon, 
>> tangerine, purple]   ]
>>
>>
>> then i am passing it to the template like
>> return render(request, "show_table.html", {"lista": lista})
>> inside my template html i have 
>>
>>
>> 
>> {% for i in lista %}
>> 
>> {{ i }}
>> {# > Temp  #}
>> {# {{ i }}#}
>> 
>>
>> {% endfor %}
>> 
>>
>>
>>
>> but how can i select i[0]   or i[2] to put then into a diferent 
>> column?might be a better trick on how to send it?
>> thanks.
>>
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/ec4f230b-73f0-495c-ad2d-db921ed227cc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/ec4f230b-73f0-495c-ad2d-db921ed227cc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63004a1d-6aad-481b-9563-26182bbd9f39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to get a link to an absolute hyperlink

2015-02-13 Thread dk
this is my template
I do have this address
http://127.0.0.1:8000/mes/show_table/
and show a table where the second colum is a link to somewhere else,  the 
problem is when I click it lunch me to
http://127.0.0.1:8000/mes/show_table/clickedLinkand doesn't work.

as an example if one of my links in the table is pointing to google
o do get 
http://127.0.0.1:8000/mes/show_table/google
instead of just
google

is there a tag or some magic in django to say  just send me here?

thanks  guys.


 
 {% for i in lista %}
 
{% for j in i %}
   {% if forloop.counter == 4 %}
   {{ j 
}}  
   {% else %}
  {{ j }}

   {% endif %}
{% endfor %}
 

 {% endfor %}

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6ccb7e1-e202-45cc-a458-02b6c9029eea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to get a link to an absolute hyperlink

2015-02-13 Thread dk
its just a string with an ip address and that's it.  

 {{ j }} 
so at the end should be something like
11.111.11. 

instead I get the hole path of my url + /11.111.11.   
I just want to go to 11.111.11.




On Friday, February 13, 2015 at 4:46:44 PM UTC-6, daniel.franca wrote:

> How's the hyperlink saved in the column? If it's a relative one this is 
> what is going to happen, to change that you need an absolute link, i.e: 
> http://google.com
> On Fri 13 Feb 2015 at 23:40 dk > wrote:
>
>> this is my template
>> I do have this address
>> http://127.0.0.1:8000/mes/show_table/
>> and show a table where the second colum is a link to somewhere else,  the 
>> problem is when I click it lunch me to
>> http://127.0.0.1:8000/mes/show_table/clickedLinkand doesn't work.
>>
>> as an example if one of my links in the table is pointing to google
>> o do get 
>> http://127.0.0.1:8000/mes/show_table/google
>> instead of just
>> google
>>
>> is there a tag or some magic in django to say  just send me here?
>>
>> thanks  guys.
>>
>>
>>  
>>  {% for i in lista %}
>>  
>> {% for j in i %}
>>{% if forloop.counter == 4 %}
>>{{ 
>> j }}  
>>{% else %}
>>   {{ j }}
>>
>>{% endif %}
>> {% endfor %}
>>  
>>
>>  {% endfor %}
>>
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c6ccb7e1-e202-45cc-a458-02b6c9029eea%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/c6ccb7e1-e202-45cc-a458-02b6c9029eea%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04c2d8ae-8ea5-4847-bbdc-0dc1e323eff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to get a link to an absolute hyperlink

2015-02-16 Thread dk
doing the http at the front did work!  thanks.

On Friday, February 13, 2015 at 5:09:15 PM UTC-6, Vijay Khemlani wrote:
>
> Try adding "http://"; at the start
>
> Also, consider that the format is 111.111.111.111: (the port is after 
> a colon, not a dot)
>
> On Fri, Feb 13, 2015 at 8:03 PM, dk > 
> wrote:
>
>> its just a string with an ip address and that's it.  
>>
>>  {{ j }} 
>> so at the end should be something like
>> 11.111.11. 
>>
>> instead I get the hole path of my url + /11.111.11.   
>> I just want to go to 11.111.11.
>>
>>
>>
>>
>> On Friday, February 13, 2015 at 4:46:44 PM UTC-6, daniel.franca wrote:
>>
>>> How's the hyperlink saved in the column? If it's a relative one this is 
>>> what is going to happen, to change that you need an absolute link, i.e: 
>>> http://google.com
>>> On Fri 13 Feb 2015 at 23:40 dk  wrote:
>>>
>>>> this is my template
>>>> I do have this address
>>>> http://127.0.0.1:8000/mes/show_table/
>>>> and show a table where the second colum is a link to somewhere else,  
>>>> the problem is when I click it lunch me to
>>>> http://127.0.0.1:8000/mes/show_table/clickedLinkand doesn't work.
>>>>
>>>> as an example if one of my links in the table is pointing to google
>>>> o do get 
>>>> http://127.0.0.1:8000/mes/show_table/google
>>>> instead of just
>>>> google
>>>>
>>>> is there a tag or some magic in django to say  just send me here?
>>>>
>>>> thanks  guys.
>>>>
>>>>
>>>>  
>>>>  {% for i in lista %}
>>>>  
>>>> {% for j in i %}
>>>>{% if forloop.counter == 4 %}
>>>>>>> >{{ j }}  
>>>>{% else %}
>>>>   {{ j }}
>>>>
>>>>{% endif %}
>>>> {% endfor %}
>>>>  
>>>>
>>>>  {% endfor %}
>>>>
>>>>  -- 
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/django-users/c6ccb7e1-e202-45cc-a458-02b6c9029eea%
>>>> 40googlegroups.com 
>>>> <https://groups.google.com/d/msgid/django-users/c6ccb7e1-e202-45cc-a458-02b6c9029eea%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/04c2d8ae-8ea5-4847-bbdc-0dc1e323eff7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/04c2d8ae-8ea5-4847-bbdc-0dc1e323eff7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2f913264-2cec-4876-b319-c8b7d3ae7f96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


matplotlib pyplot stop working

2015-02-19 Thread dk
I am using matplotlib.pyplot to generate a plot image, put it in a temp 
folder, 
and then use that to populate a webpage.

the problem is:
1) always display the same image,  I all ready deleted the image before 
creating the new one, 
I also set pyplot .close()  to close all my figures.

2) some times everything freeze and stop working.

my suspicions is since django is constantly running keeps the figure in the 
memory some how.   have any one got issues like this?
thanks.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4c7af20d-2be4-45b1-9132-be14f2ea7deb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: matplotlib pyplot stop working

2015-02-20 Thread dk
yep  I get the same issue the guy is commenting, were it happen when I run 
it more than once,  I will try to do the multiprocess that he mention and I 
will see what happen.

On Friday, February 20, 2015 at 11:22:32 AM UTC-6, Collin Anderson wrote:
>
> Hi,
>
> The freezing could be a memory leak. 
> http://stackoverflow.com/questions/7125710/matplotlib-errors-result-in-a-memory-leak-how-can-i-free-up-that-memory
>
> Could the image be cached by the browser, does shift+F5 refresh it? The 
> easiest way to fix it would be to use a different url/filename every time 
> you generate an new image.
>
> Collin
>
> On Thursday, February 19, 2015 at 4:26:16 PM UTC-5, dk wrote:
>>
>> I am using matplotlib.pyplot to generate a plot image, put it in a temp 
>> folder, 
>> and then use that to populate a webpage.
>>
>> the problem is:
>> 1) always display the same image,  I all ready deleted the image before 
>> creating the new one, 
>> I also set pyplot .close()  to close all my figures.
>>
>> 2) some times everything freeze and stop working.
>>
>> my suspicions is since django is constantly running keeps the figure in 
>> the memory some how.   have any one got issues like this?
>> thanks.
>>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cb183ead-a8b2-4f08-8f83-188c4e0f0cdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django deployment in a virtual machine.

2015-02-24 Thread dk
I got a virtual machine with Linux centos that we are going to use for our 
django webpage.  
that machine will have the html service on. so when people go to the 
computer typing the IP, will show them the webpage. is there any special 
trick to do? like make a service that lunch manage.py with the runserver 
command?
if any one can point me to a webpage I will appreciate.

thanks guys.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django deployment in a virtual machine.

2015-02-24 Thread dk
its just a website with one link =)
basicly shows one graph. and that's it.

On Tuesday, February 24, 2015 at 3:41:14 PM UTC-6, george wrote:

> not production i hope.
>
> in prod use nginx. if not on prod use runserver 0.0.0.0:8000
> Em 24/02/2015 18:37, "dk" > escreveu:
>
>> I got a virtual machine with Linux centos that we are going to use for 
>> our django webpage.  
>> that machine will have the html service on. so when people go to the 
>> computer typing the IP, will show them the webpage. is there any special 
>> trick to do? like make a service that lunch manage.py with the runserver 
>> command?
>> if any one can point me to a webpage I will appreciate.
>>
>> thanks guys.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bf9c8f15-7206-4932-95c9-d5c8bc82af9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django deployment in a virtual machine.

2015-02-25 Thread dk
thanks guys, I installed Apache and I am setting everything,  does my 
project really need to be in /etc/www/

or I can put anywhere in the computer? just making sure the apache.conf 
point to that address?



On Wednesday, February 25, 2015 at 6:29:25 AM UTC-6, Fernando Ramos wrote:

> If there's more than one person using it your site will only grow. The 
> Django web server is meant for debugging, not production.
> Go the extra step and setup ngnix or another simple http server. You will 
> thank yourself later.
>
>
> El martes, 24 de febrero de 2015, 14:49:16 (UTC-7), dk escribió:
>>
>> its just a website with one link =)
>> basicly shows one graph. and that's it.
>>
>> On Tuesday, February 24, 2015 at 3:41:14 PM UTC-6, george wrote:
>>
>>> not production i hope.
>>>
>>> in prod use nginx. if not on prod use runserver 0.0.0.0:8000
>>> Em 24/02/2015 18:37, "dk"  escreveu:
>>>
>>>> I got a virtual machine with Linux centos that we are going to use for 
>>>> our django webpage.  
>>>> that machine will have the html service on. so when people go to the 
>>>> computer typing the IP, will show them the webpage. is there any special 
>>>> trick to do? like make a service that lunch manage.py with the runserver 
>>>> command?
>>>> if any one can point me to a webpage I will appreciate.
>>>>
>>>> thanks guys.
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f1533ca-afee-4779-914e-6632931cea10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django deployment in a virtual machine.

2015-02-25 Thread dk
thanks   I am watching 
https://www.youtube.com/watch?v=hBMVVruB9Vs
but i am stuck at min 20 since it say that I need to activate the website, 
with a2ensite 
they gave me a centos7 machine that doesn't have those commands.


On Wednesday, February 25, 2015 at 11:39:01 AM UTC-6, Andrew Farrell wrote:

>  Linode 
> <https://www.linode.com/docs/websites/frameworks/django-apache-and-modwsgi-on-centos-5>
>  and Digital Ocean 
> <https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn>
>  both 
> have good tutorials on setting up a production deployment of Django on a 
> virtual private server.
>
> On Wed, Feb 25, 2015 at 11:29 AM, Rodrigo Zayit  > wrote:
>
>> anywhere
>>
>>
>> Atenciosamente,
>> Rodrigo de Oliveira
>>
>> On Wed, Feb 25, 2015 at 2:19 PM, dk > 
>> wrote:
>>
>>> thanks guys, I installed Apache and I am setting everything,  does my 
>>> project really need to be in /etc/www/
>>>
>>> or I can put anywhere in the computer? just making sure the apache.conf 
>>> point to that address?
>>>
>>>
>>>
>>> On Wednesday, February 25, 2015 at 6:29:25 AM UTC-6, Fernando Ramos 
>>> wrote:
>>>
>>>> If there's more than one person using it your site will only grow. The 
>>>> Django web server is meant for debugging, not production.
>>>> Go the extra step and setup ngnix or another simple http server. You 
>>>> will thank yourself later.
>>>>
>>>>
>>>> El martes, 24 de febrero de 2015, 14:49:16 (UTC-7), dk escribió:
>>>>>
>>>>> its just a website with one link =)
>>>>> basicly shows one graph. and that's it.
>>>>>
>>>>> On Tuesday, February 24, 2015 at 3:41:14 PM UTC-6, george wrote:
>>>>>
>>>>>> not production i hope.
>>>>>>
>>>>>> in prod use nginx. if not on prod use runserver 0.0.0.0:8000
>>>>>> Em 24/02/2015 18:37, "dk"  escreveu:
>>>>>>
>>>>>>> I got a virtual machine with Linux centos that we are going to use 
>>>>>>> for our django webpage.  
>>>>>>> that machine will have the html service on. so when people go to the 
>>>>>>> computer typing the IP, will show them the webpage. is there any 
>>>>>>> special 
>>>>>>> trick to do? like make a service that lunch manage.py with the 
>>>>>>> runserver 
>>>>>>> command?
>>>>>>> if any one can point me to a webpage I will appreciate.
>>>>>>>
>>>>>>> thanks guys.
>>>>>>>
>>>>>>> -- 
>>>>>>> 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...@googlegroups.com.
>>>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>>>> Visit this group at http://groups.google.com/group/django-users.
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/django-users/e3255fbf-
>>>>>>> 27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com 
>>>>>>> <https://groups.google.com/d/msgid/django-users/e3255fbf-27c2-4ac5-bec6-939b9a8744cd%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>  -- 
>>> 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...@googlegroups.com .
>>> To post to this group, send email to django...@googlegroups.com 
>>> .
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/5f1533ca-afee-4779-914e-6632931cea10%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/5f1533ca-afee-4779-914e-6632931cea10%40googlegroups.com?utm_medium=email&utm_source

Re: django deployment in a virtual machine.

2015-02-25 Thread dk
looks like centos7 doesn't have or need that, 
it comes with a folder call conf.d 
and if the .conf file I inside this folder,  is like if was activate it.  =)


On Wednesday, February 25, 2015 at 1:01:57 PM UTC-6, Blazor wrote:

> thanks   I am watching 
>> https://www.youtube.com/watch?v=hBMVVruB9Vs
>> but i am stuck at min 20 since it say that I need to activate the 
>> website, with a2ensite 
>> they gave me a centos7 machine that doesn't have those commands.
>>
>
>
> a2ensite is basically a shortcut for creating a symbolic link between the 
> sites-available entry you are interested into and the sites-enabled 
> directory. You can do it manually:
>
> # as an administrative user
> cd /etc/apache2/sites-enabled
> ln -s ../sites-available/
>
>
> B.
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a7702198-bc1b-4aeb-92a3-0a673979d04f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


wsgi dont have permission to access /wsgi_app on this server

2015-02-25 Thread dk
since I couldn't get my webpage to display I started from the basic, trying 
to debug and go step by step, so I am trying to see if I can get mod_wsgi 
to work, 

https://wiki.archlinux.org/index.php/Mod_wsgi
and this is the tutorial that I am following, 

but when I go to check the website and see if I display something I get.

Forbidden
You don't have permission to access /wsgi_app on this server.


so I went and chmod 777 that python file to see if that might be the issue, 
but I still get it. have any one gotten into an issue like this?   any 
tricks that I can try?

thanks guys.




-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fee6d09e-632b-4e59-88d5-bc50bc637ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: wsgi dont have permission to access /wsgi_app on this server

2015-02-25 Thread dk
found the reason!!!
is not the permission is the group
doing this to the folder put into the user and group that apache can read.

chown -R apache:apache myfolder


from here
http://stackoverflow.com/questions/21498904/forbidden-you-dont-have-permission-to-access-on-this-server-centos-6-laravel
just in case some one might need it later on.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/76525212-cbae-47d5-8e4f-c98ffdcae2d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


icons let the template or resolve in the view?

2015-03-03 Thread dk
I will be populating a table with information of computers and I would like 
to display an icon in front of each line of the table. might change 
depending of the machine,  should I let the view handle that with and if 
then and later on use static to resolve the file path?
or should I make that if then and resolve the path by myself in the view?


-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a3fb3f1-1c24-4fa0-a7ed-4b21a2c99430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: icons let the template or resolve in the view?

2015-03-03 Thread dk
right now  I am not using models, form the database,  as concept I am 
pinging the computer,  and making a list of lists with the ip and if the 
machines is up or down, like this.

this is what I am passing to the template.
[ [up, machine1],[up, machine2],[down, machine3]  ]


should I pass something like
[ [path/to/icon, machine1], [path/to/icon, machine2], [path/to/icon, 
machine3] ]

or make and if then in the loop of the template and get the icons from 
there?



On Tuesday, March 3, 2015 at 12:43:15 PM UTC-6, felix wrote:

>  El 03/03/15 13:17, dk escribió:
>  
>  I will be populating a table with information of computers and I would 
> like to display an icon in front of each line of the table. might change 
> depending of the machine,  should I let the view handle that with and if 
> then and later on use static to resolve the file path?
> or should I make that if then and resolve the path by myself in the view?
>
>  
>  I'm a newbie but here I go:
> I think that it depends on how machines and icons are related. If each 
> machine has a particular icon you should create a field in your computer 
> model to handle it, an ImageField for instance. If you have  icons 
> representing groups of computers then you could also use CHOICES in the 
> model or even use an If tag in the template.
> Views process the info you will show on templates, being the latest in 
> charge of how to display it.
>
> Cheers,
> Felix.
>  

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/adafb35e-35c6-4dc8-8952-cd2874344ee2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: icons let the template or resolve in the view?

2015-03-03 Thread dk
I didn't thing to put them as classes LOL.
thanks!


On Tuesday, March 3, 2015 at 3:17:58 PM UTC-6, felix wrote:

>  El 03/03/15 13:54, dk escribió:
>  
>  right now  I am not using models, form the database,  as concept I am 
> pinging the computer,  and making a list of lists with the ip and if the 
> machines is up or down, like this.
>
>  this is what I am passing to the template.
> [ [up, machine1],[up, machine2],[down, machine3]  ]
>
>  
>  should I pass something like
> [ [path/to/icon, machine1], [path/to/icon, machine2], [path/to/icon, 
> machine3] ]
>
>  or make and if then in the loop of the template and get the icons from 
> there?
>
>  
>  I prefer the first way, just like you are doing now and then I would 
> define a CSS class for UP and another for DOWN states to set the src 
> property of the img tag (this is HTML) showing the state of the computer.
>
>
> 

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66909157-fd08-409c-9ded-790e8b60af9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django doesnt wait for my time.sleep

2015-03-04 Thread dk
i am using matplotlib to generate a plot/graph,  even do that python is 
generating the file and saving it so I can use it later on in my web page, 
django show the page before the process finish, 
so I decided to put a time.sleep(3)  so it wait 3 sec while all this 
happen, but doesn't respect that =(

any ideas why that might happen or a workaround?   

I usually get in my web page an old plot so I have to click refresh on the 
page to get the new actual one =(.
thank.s

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/536faca6-2abb-4df6-b97d-414cc199e8d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


fake button run a view and come back to the same page.

2015-03-10 Thread dk
I been trying to find information on how to make a button to run a python 
script in the back.
I do have a table with some buttons,  and I want to click in one, and 
behind doors, will run a python script.

since I don't know to much javascript or flask, or php I decided to make a 
link (later on I can make it look like a button)  that link will run the 
view witch is my script as subprocess and then 
return back again the view of my table,   
so basicly will click the button, will run the code, and redo the view that 
I was all ready in. something like this.

views:
def main_table(request):
list_of_files= here I get my files.
return render(request, "show_table", {"list":list_of_files})



def button_do_thing(request):
file = request.GET.get(file_name)
dosomething

main_table(request) # here is where I am actually calling again to the 
main table to redraw it on the browswer.

but I get the error:

The view mes.views.test_machine didn't return an HttpResponse object. It 
returned None instead.

I tought passing the request should do it?


any tips, tricks?  or an actual way to make the button run the script?

thanks guys =)   .





-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0b79832b-d3b0-4e2f-9d66-d92628903cfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: fake button run a view and come back to the same page.

2015-03-10 Thread dk
UHH redirect sounds  easy.. yami yami.

Felix  how does the ajax works? I am assuming is a library of javascripts? 
and ajax can lunch the python code?


On Tuesday, March 10, 2015 at 1:48:56 PM UTC-5, Daniel Roseman wrote:

> On Tuesday, 10 March 2015 17:11:16 UTC, dk wrote:
>>
>> I been trying to find information on how to make a button to run a python 
>> script in the back.
>> I do have a table with some buttons,  and I want to click in one, and 
>> behind doors, will run a python script.
>>
>> since I don't know to much javascript or flask, or php I decided to make 
>> a link (later on I can make it look like a button)  that link will run the 
>> view witch is my script as subprocess and then 
>> return back again the view of my table,   
>> so basicly will click the button, will run the code, and redo the view 
>> that I was all ready in. something like this.
>>
>> views:
>> def main_table(request):
>> list_of_files= here I get my files.
>> return render(request, "show_table", {"list":list_of_files})
>> 
>>
>>
>> def button_do_thing(request):
>> file = request.GET.get(file_name)
>> dosomething
>>
>> main_table(request) # here is where I am actually calling again to 
>> the main table to redraw it on the browswer.
>>
>> but I get the error:
>>
>> The view mes.views.test_machine didn't return an HttpResponse object. It 
>> returned None instead.
>>
>> I tought passing the request should do it?
>>
>>
>> any tips, tricks?  or an actual way to make the button run the script?
>>
>> thanks guys =)   .
>>
>>
>
> You didn't return anything at all from your do_thing view, hence the error.
>
> However you shouldn't really call one view from the other. If you do that, 
> the browser will show the URL of the main view, which will be confusing. 
> Instead, after running the task, *redirect* back to the main view:
>
>  from django.shortcuts import redirect
>  ...
>  return redirect('mes.views.main_table')
>
> --
> Daniel.
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/834b2249-ac4f-44fa-950f-1befee440a9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


forms of 2 tables upload files

2015-03-17 Thread dk
i have 2 tables,   1 table contain the fields for name, email, 
and I did another table with file, and date.

and I am trying to populate the 2 tables when a user submit the form.

I follow this amazing tutorial
https://amatellanes.wordpress.com/2013/11/05/dropzonejs-django-how-to-build-a-file-upload-form/
  

but he is using the trick of using the models to do the form.   witch you 
can only use one table for that.

in the mean time we change the code and we are using just 1 table, with 
name email, file and date and then doing it exactly like the tutorial, 
and my view is like this

def request_page(request):
   if request.method == "POST":
  form = Submit_Form(request.POST, request.FILES)
  if form.is_valid():
 email = form.cleaned_data["email"]
 per = Person(email=email, date=datetime.datetime.now(), 
file=request.FILES['file'])
 per.save()

 message = "Thanks, Submission accepted:" + email
 forma = Submit_Form()
 # return redirect("request_page", {"form": forma, "message": message})
 return render(request, "submit_request.html", {"form": forma, 
"message": message})
   else:
  form = Submit_Form()

   return render(request, "submit_request.html", {"form": form, "message": ""})





I can make my own form  like this

# class NameForm(forms.Form):
# name = forms.CharField(label='Name', max_length=100, required=True, 
initial="")
# last_name = forms.CharField(label='Last Name', max_length=100, 
required=True, initial="")
# email = forms.EmailField(label="Email", required=True, initial="")


# the_file = forms.FileField(required=True)

# date = forms.DateTimeField()



will render properly but later on I don't know how to populate the 2 tables.   

any one have a little example that I can follow to .save() the person table and 
the file table?


thank you guys. =)

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/65a0f26c-9f07-499c-88eb-fd625e6d34c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


templates tags works in scripts sections of the html?

2015-03-20 Thread dk
I am trying to create an autocomplete tag with jquery UI
http://jqueryui.com/autocomplete/



in my view I got a list of commands,   in the meant time I am just testing 
it, so I have a list with ["a", "aaa", "b", "bbb"]

 $(function() {
 var avaibleTags = [
  {% for i in list_commands %}
  {{ i }}
  {% endfor %}
 ];
 $( "#tags" ).autocomplete({
  source: avaibleTags
 });
});


but it doesn't work,   does the string replacement of the template tags 
works on the script part ?  or I might be missing something?  thanks =)

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/09c05edc-dd45-4c66-bae1-e30cd3bbdbf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: templates tags works in scripts sections of the html?

2015-03-23 Thread dk
AHHH!!!...
that make scenes  that the java script did work when I did it manually.   I 
haven't use json files before, so I am not  sure how to manage that, I will 
look around for more information on that.

On Friday, March 20, 2015 at 4:59:30 PM UTC-5, dk wrote:

> I am trying to create an autocomplete tag with jquery UI
> http://jqueryui.com/autocomplete/
>
>
>
> in my view I got a list of commands,   in the meant time I am just testing 
> it, so I have a list with ["a", "aaa", "b", "bbb"]
> 
>  $(function() {
>  var avaibleTags = [
>   {% for i in list_commands %}
>   {{ i }}
>   {% endfor %}
>  ];
>  $( "#tags" ).autocomplete({
>   source: avaibleTags
>  });
> });
> 
>
> but it doesn't work,   does the string replacement of the template tags 
> works on the script part ?  or I might be missing something?  thanks =)
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35a2f15f-a406-46b7-b0d4-8087af6c67dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


subprocess behave diferent in the server than in the client.

2015-03-30 Thread dk
hi, I have a button in my webpage that lunch a subprocess and check the 
ping of the computer and save the information in a text file. that's it,  
very basic stuff.

If I am doing my click in the server computer  everything works,
the subprocess will ping the computer, make the file and save the 
information. 
and go back the corresponding view.


but if I do it from a client computer,  does all the script,  return the 
view that needs to return, but it never lunched the subprocess =(.   is 
like that line was commented or something doesn't even complain or spits 
errors =(

have any one got an issue like this?

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/558b6819-4465-475c-9177-67592f3ad054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: subprocess behave diferent in the server than in the client.

2015-03-31 Thread dk
playing a littlie bit more, I found out that does work if I am using the 
manage.py runserver.
but doesn't work using the production django =(.



On Monday, March 30, 2015 at 5:53:59 PM UTC-5, dk wrote:

> hi, I have a button in my webpage that lunch a subprocess and check the 
> ping of the computer and save the information in a text file. that's it,  
> very basic stuff.
>
> If I am doing my click in the server computer  everything works,
> the subprocess will ping the computer, make the file and save the 
> information. 
> and go back the corresponding view.
>
>
> but if I do it from a client computer,  does all the script,  return the 
> view that needs to return, but it never lunched the subprocess =(.   is 
> like that line was commented or something doesn't even complain or spits 
> errors =(
>
> have any one got an issue like this?
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb43b536-352e-4eb0-b32a-485860d19e13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


best way to pass options to django views?

2015-04-02 Thread dk
I have a option section in my webpage just display the names of some 
machines

doing this tutorial I was able to get all the lines that appear in the 
"option" tag of my html.
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_select_options
and I can get a big string that I can separate by comas.

I was going to put that big long string as the last part of the url and use 
it with a get method such:

url:   mywebsite/myapp/?options=txt

def profile_page(request):
options = request.GET.get("options", "")
#here parse the options string
 
is this something recommended? or is a better smarter way?
thanks =)


-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e6052c5-9ce9-4a13-9eba-c0eb6b9fd745%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: subprocess behave diferent in the server than in the client.

2015-04-02 Thread dk
found 2 things happening,  some one move the file, second of all the 
subprocess stdout spits a tuple of tuples =( (that was trick thing to find.)
thanks guys.


On Tuesday, March 31, 2015 at 2:03:08 PM UTC-5, JirkaV wrote:

> It's very likely that the actual user running the webserver process(es) 
> does not have "ping" on the executables path...
>
> HTH
>
> Jirka
> ------
> *From: * dk > 
> *Sender: * django...@googlegroups.com  
> *Date: *Tue, 31 Mar 2015 08:12:03 -0700 (PDT)
> *To: *>
> *ReplyTo: * django...@googlegroups.com  
> *Subject: *Re: subprocess behave diferent in the server than in the 
> client.
>
> playing a littlie bit more, I found out that does work if I am using the 
> manage.py runserver.
> but doesn't work using the production django =(.
>
>
>
> On Monday, March 30, 2015 at 5:53:59 PM UTC-5, dk wrote:
>
>> hi, I have a button in my webpage that lunch a subprocess and check the 
>> ping of the computer and save the information in a text file. that's it,  
>> very basic stuff.
>>
>> If I am doing my click in the server computer  everything works,
>> the subprocess will ping the computer, make the file and save the 
>> information. 
>> and go back the corresponding view.
>>
>>
>> but if I do it from a client computer,  does all the script,  return the 
>> view that needs to return, but it never lunched the subprocess =(.   is 
>> like that line was commented or something doesn't even complain or spits 
>> errors =(
>>
>> have any one got an issue like this?
>>
>  -- 
> 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...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/bb43b536-352e-4eb0-b32a-485860d19e13%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/bb43b536-352e-4eb0-b32a-485860d19e13%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0d7bd17-f949-4e35-9858-4ca5c5122733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: best way to pass options to django views?

2015-04-03 Thread dk
thanks,
I have 2 options and I made with java script buttons that can transfer the 
lines of one option to another 

now I want to pass all the lines of option2 to the server.



On Thursday, April 2, 2015 at 7:17:19 PM UTC-5, Ilya Kazakevich wrote:

> This tutorial is about client-side (JavaScript) while Python/Django is 
> server side:)
>
> What are you trying to do? Pass all options from HTML page to server side? 
> What for?
> In most cases you want to pass the option selected by user to server. You 
> must first read about HTML forms and how to submit them, and then read 
> Django Forms tutorial: https://docs.djangoproject.com/en/1.8/topics/forms/
>
>
>
> On Thursday, April 2, 2015 at 9:35:39 PM UTC+3, dk wrote:
>>
>> I have a option section in my webpage just display the names of some 
>> machines
>>
>> doing this tutorial I was able to get all the lines that appear in the 
>> "option" tag of my html.
>> http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_select_options
>> and I can get a big string that I can separate by comas.
>>
>> I was going to put that big long string as the last part of the url and 
>> use it with a get method such:
>>
>> url:   mywebsite/myapp/?options=txt
>>
>> def profile_page(request):
>> options = request.GET.get("options", "")
>> #here parse the options string
>>  
>> is this something recommended? or is a better smarter way?
>> thanks =)
>>
>>
>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2d2a7ad8-5ffc-465d-8fff-b8d397c72f76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MEDIA_URL doesnt work in windows but works on linux

2015-04-08 Thread dk
in my settings 
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = "/media/"


my view to accept files.
def request_page(request):
 #todo since sqlite my get stuck between 2 submittion at the same time,
 # submit, if it cant try again  and then message that ask the user to try 
in 5 mins.
 try:
  if request.method == "POST":
   form = Submit_Form(request.POST, request.FILES)
   if form.is_valid():
email = form.cleaned_data["email"]
file = request.FILES["file"]
# we make the message true or false so we can display color in the html 
template.
if file.name.endswith(".ini"):
 per = Person(email=email, date_submitted=datetime.datetime.now(), 
file=file)
 per.save()
 message = ["Thanks, we receive your file:" + email, "True"]
 forma = Submit_Form()
else:
 message = ["its not the appropriate type of file, please verify.", 
"False"]
 forma = Submit_Form()




and this is how I am making my model
def content_file_name(instance, filename):
here is where I think is the problem,  windows like \ and Linux /  but even 
using os.path.join   I wasn't able to make it work, 
I also try hard code the path using \\.join instead
 if os.name == "nt":
  # path = "\\".join(["submitted_ini_files", filename + "___" + 
str(instance.email) + "___" + str(datetime.datetime.now())])
  path = os.path.join("submitted_ini_files", filename + "___" + 
str(instance.email) + "___" + str(datetime.datetime.now()))
  print path
  print MEDIA_URL
  # path = os.path.join("submitted_ini_files", filename + "___" + 
str(instance.email) + "___" + str(datetime.datetime.now() ))
  return path
 else:
  print "other than nt"
  return "/".join(["submitted_ini_files", filename + "___" + 
str(instance.email) + "___" + str(datetime.datetime.now())])


class Person(models.Model):
 email = models.EmailField(blank=True, null=True)
 file = models.FileField(blank=True, null=True, upload_to=content_file_name)
 date_submitted = models.DateTimeField(blank=True, null=True)

any tips on how to make this work?  thanks.  

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8c9548cd-304a-4d06-bf84-ada8504612d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: MEDIA_URL doesnt work in windows but works on linux

2015-04-14 Thread dk
maybe I need to simplify my question.


how do I use media_url  in windows?






On Wednesday, April 8, 2015 at 10:56:27 AM UTC-5, dk wrote:

> in my settings 
> MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
> MEDIA_URL = "/media/"
>
>
> my view to accept files.
> def request_page(request):
>  #todo since sqlite my get stuck between 2 submittion at the same time,
>  # submit, if it cant try again  and then message that ask the user to try 
> in 5 mins.
>  try:
>   if request.method == "POST":
>form = Submit_Form(request.POST, request.FILES)
>if form.is_valid():
> email = form.cleaned_data["email"]
> file = request.FILES["file"]
> # we make the message true or false so we can display color in the 
> html template.
> if file.name.endswith(".ini"):
>  per = Person(email=email, date_submitted=datetime.datetime.now(), 
> file=file)
>  per.save()
>  message = ["Thanks, we receive your file:" + email, "True"]
>  forma = Submit_Form()
> else:
>  message = ["its not the appropriate type of file, please verify.", 
> "False"]
>  forma = Submit_Form()
>
>
>
>
> and this is how I am making my model
> def content_file_name(instance, filename):
> here is where I think is the problem,  windows like \ and Linux /  
> but even using os.path.join   I wasn't able to make it work, 
> I also try hard code the path using \\.join instead
>  if os.name == "nt":
>   # path = "\\".join(["submitted_ini_files", filename + "___" + 
> str(instance.email) + "___" + str(datetime.datetime.now())])
>   path = os.path.join("submitted_ini_files", filename + "___" + 
> str(instance.email) + "___" + str(datetime.datetime.now()))
>   print path
>   print MEDIA_URL
>   # path = os.path.join("submitted_ini_files", filename + "___" + 
> str(instance.email) + "___" + str(datetime.datetime.now() ))
>   return path
>  else:
>   print "other than nt"
>   return "/".join(["submitted_ini_files", filename + "___" + 
> str(instance.email) + "___" + str(datetime.datetime.now())])
>
>
> class Person(models.Model):
>  email = models.EmailField(blank=True, null=True)
>  file = models.FileField(blank=True, null=True, 
> upload_to=content_file_name)
>  date_submitted = models.DateTimeField(blank=True, null=True)
>
> any tips on how to make this work?  thanks.  
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c4053a51-ec3b-4445-8706-821ee2d539e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 1.8 and wsgi_mod

2015-04-27 Thread dk
we decided to test django 1.8,  using python manage.py runserver works 
great.  but now the production wsgi stop working, 
I remember there was a change between version 1.6 and 1.7.  
this is my code.   Did it something change?

import os
import sys
sys.path.append("/code/projects/my_web")
sys.path.append("/code/projects/my_web/core") # path to the project
os.environ["DJANGO_SETTINGS_MODULE"]= "core.settings"


*from django.core.wsgi import get_wsgi_applicationapplication = 
get_wsgi_application()*

#this is the way for django 1.6
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()

thanks guys.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2d130a53-d9e4-404e-bf79-ba4f1df492dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 and wsgi_mod

2015-04-28 Thread dk

I check the apache httpd log  and do get this

[Tue Apr 28 10:33:49.982311 2015] [:error] [pid 18060] [client 
10.35.0.91:61408] from django.apps import apps
[Tue Apr 28 10:33:49.982336 2015] [:error] [pid 18060] [client 
10.35.0.91:61408] ImportError: No module named apps

[Tue Apr 28 10:33:52.595973 2015] [:error] [pid 18061] [client 
10.35.0.91:61410] mod_wsgi (pid=18061): 
Target WSGI script '/code/projects/my_web/wsgi/my.wsgi' cannot be loaded as 
Python module.
[Tue Apr 28 10:33:52.596033 2015] [:error] [pid 18061] [client 
10.35.0.91:61410] mod_wsgi (pid=18061):
Exception occurred processing WSGI script 
'/code/projects/my_web/wsgi/my.wsgi'.

I think is the No module named apps is causing this =(

On Tuesday, April 28, 2015 at 1:28:04 AM UTC-5, Abhaya wrote:

> This looks fine. Are there any errors in the web server logs?
>
> Regards,
> Abhaya
>
> On Mon, Apr 27, 2015 at 10:23 PM, dk > 
> wrote:
>
>> we decided to test django 1.8,  using python manage.py runserver works 
>> great.  but now the production wsgi stop working, 
>> I remember there was a change between version 1.6 and 1.7.  
>> this is my code.   Did it something change?
>>
>> import os
>> import sys
>> sys.path.append("/code/projects/my_web")
>> sys.path.append("/code/projects/my_web/core") # path to the project
>> os.environ["DJANGO_SETTINGS_MODULE"]= "core.settings"
>>
>>
>> *from django.core.wsgi import get_wsgi_applicationapplication = 
>> get_wsgi_application()*
>>
>> #this is the way for django 1.6
>> #import django.core.handlers.wsgi
>> #application = django.core.handlers.wsgi.WSGIHandler()
>>
>> thanks guys.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/2d130a53-d9e4-404e-bf79-ba4f1df492dc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/2d130a53-d9e4-404e-bf79-ba4f1df492dc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> -
> blog: http://abhaga.blogspot.com
> Twitter: http://twitter.com/abhaga
> -
>  

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/34e206be-20a4-47e5-aa75-f4fdcfb09a17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 and wsgi_mod

2015-04-28 Thread dk

my folder structure is like this

├── my_web
│   ├── core (i rename this so i know where all the original django files 
are)
│   │   ├── __init__.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   ├── urls.pyc
│   │   ├── wsgi.py
│   ├── db.sqlite3
│   ├── __init__.py
│   ├── manage.py
│   ├── mes (this is my only app i did)
│   │   ├── admin.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── templates
│   │   │   └── mes
│   │   ├── urls.py
│   │   ├── views.py
│   ├── static
│   │   ├── images
│   │   ├── style
│   │   │   └── style.css
│   ├── templates
│   │   ├── main_page.html
│   │   └── main_template.html
│   └── wsgi
│   ├── idrac.wsgi (here is the wsgi)
│   ├── __init__.py
│   └── readme.txt
└── __init__.py





On Tuesday, April 28, 2015 at 10:41:25 AM UTC-5, dk wrote:

>
> I check the apache httpd log  and do get this
>
> [Tue Apr 28 10:33:49.982311 2015] [:error] [pid 18060] [client 
> 10.35.0.91:61408] from django.apps import apps
> [Tue Apr 28 10:33:49.982336 2015] [:error] [pid 18060] [client 
> 10.35.0.91:61408] ImportError: No module named apps
>
> [Tue Apr 28 10:33:52.595973 2015] [:error] [pid 18061] [client 
> 10.35.0.91:61410] mod_wsgi (pid=18061): 
> Target WSGI script '/code/projects/my_web/wsgi/my.wsgi' cannot be loaded 
> as Python module.
> [Tue Apr 28 10:33:52.596033 2015] [:error] [pid 18061] [client 
> 10.35.0.91:61410] mod_wsgi (pid=18061):
> Exception occurred processing WSGI script 
> '/code/projects/my_web/wsgi/my.wsgi'.
>
> I think is the No module named apps is causing this =(
>
> On Tuesday, April 28, 2015 at 1:28:04 AM UTC-5, Abhaya wrote:
>
>> This looks fine. Are there any errors in the web server logs?
>>
>> Regards,
>> Abhaya
>>
>> On Mon, Apr 27, 2015 at 10:23 PM, dk  wrote:
>>
>>> we decided to test django 1.8,  using python manage.py runserver works 
>>> great.  but now the production wsgi stop working, 
>>> I remember there was a change between version 1.6 and 1.7.  
>>> this is my code.   Did it something change?
>>>
>>> import os
>>> import sys
>>> sys.path.append("/code/projects/my_web")
>>> sys.path.append("/code/projects/my_web/core") # path to the project
>>> os.environ["DJANGO_SETTINGS_MODULE"]= "core.settings"
>>>
>>>
>>> *from django.core.wsgi import get_wsgi_applicationapplication = 
>>> get_wsgi_application()*
>>>
>>> #this is the way for django 1.6
>>> #import django.core.handlers.wsgi
>>> #application = django.core.handlers.wsgi.WSGIHandler()
>>>
>>> thanks guys.
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/2d130a53-d9e4-404e-bf79-ba4f1df492dc%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/2d130a53-d9e4-404e-bf79-ba4f1df492dc%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> -
>> blog: http://abhaga.blogspot.com
>> Twitter: http://twitter.com/abhaga
>> -
>>  
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86fde726-c224-470e-b011-cde4e6beca48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 and wsgi_mod

2015-04-28 Thread dk


I check the apache httpd log  and do get this

[Tue Apr 28 10:33:49.982311 2015] [:error] [pid 18060] [client 
10.35.0.91:61408] from django.apps import apps
[Tue Apr 28 10:33:49.982336 2015] [:error] [pid 18060] [client 
10.35.0.91:61408] ImportError: No module named apps
[Tue Apr 28 10:33:52.595973 2015] [:error] [pid 18061] [client 
10.35.0.91:61410] mod_wsgi (pid=18061): 
Target WSGI script '/code/projects/my_web/wsgi/my.wsgi' cannot be loaded as 
Python module.
[Tue Apr 28 10:33:52.596033 2015] [:error] [pid 18061] [client 
10.35.0.91:61410] mod_wsgi (pid=18061):
Exception occurred processing WSGI script 
'/code/projects/my_web/wsgi/my.wsgi'.

I think is the No module named apps is causing this =(



this is the folder structure.
├── my_web
│   ├── core (i rename this so i know where all the original django files 
are)
│   │   ├── __init__.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   ├── urls.pyc
│   │   ├── wsgi.py
│   ├── db.sqlite3
│   ├── __init__.py
│   ├── manage.py
│   ├── mes (this is my only app i did)
│   │   ├── admin.py
│   │   ├── __init__.py
│   │   ├── migrations
│   │   ├── models.py
│   │   ├── templates
│   │   │   └── mes
│   │   ├── urls.py
│   │   ├── views.py
│   ├── static
│   │   ├── images
│   │   ├── style
│   │   │   └── style.css
│   ├── templates
│   │   ├── main_page.html
│   │   └── main_template.html
│   └── wsgi
│   ├── idrac.wsgi (here is the wsgi)
│   ├── __init__.py
│   └── readme.txt
└── __init__.py


and this is how i activated the app
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mes',
)

everything works fine if i do it from manage.py runserver

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eb93da19-cf70-4005-9137-207e6cd2ab9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


httml form to django

2015-05-20 Thread dk
i have a regular form in the template.   the user and the password since 
the web designer did it like that.
can I still use it in django view?

any particular way that's need to be use?  or we need to change it to use 
django forms?

=)

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8070bda1-e549-4a3a-89ee-7c1e1df9ff2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


change the style of the forms been render in the httml?

2015-05-20 Thread dk
I did a form class and renders fine in the html.
but look ugly, I do have another field directly done directly in the HTML 
with a style like this and look pretty how can I put it to the form?
can I override the "style"? or can I change the class? so I can change the 
look?   thanks guys.

.text_line {
 -moz-box-shadow:inset 0px 1px 0px 0px #ff;
 -webkit-box-shadow:inset 0px 1px 0px 0px #ff;
 box-shadow:inset 0px 1px 0px 0px #ff;
 background-color:#ededed;
 -moz-border-radius:6px;
 -webkit-border-radius:6px;
 border-radius:6px;
 border:1px solid #dcdcdc;
 display:inline-block;
 cursor:pointer;
 color:#77;
 font-family:arial;
 font-size:20px;
 font-weight:bold;
 padding:6px 24px;
 text-decoration:none;
 text-shadow:0px 1px 0px #ff;
}

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d75d26ec-0835-48b1-a843-823c122cf23a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: change the style of the forms been render in the httml?

2015-05-21 Thread dk
Thanks Galia, since I only have 2 fields, I think the second options will 
be the faster,   do you have an example? no how to override the id? or the 
class?

in the template I am doing  {{ form }}   I even try to do something like   
{{ form }}
but that doesn't change it =(  thanks.

On Thursday, May 21, 2015 at 2:42:12 AM UTC-5, Galia Ladiray wrote:

> What you want to do is to add a class attribute to your django widget 
> using attrs so that they will be rendered with this class, then to add 
> the style you want to this class in your CSS section,
> This doc shows how to do it:
> https://docs.djangoproject.com/en/1.8/ref/forms/widgets/
>
> You can of course override the style as well, for example using the 
> rendered id of your field, but it is less cleaner, since you will need to 
> repeat this for every field
>
> On Thursday, May 21, 2015 at 1:00:50 AM UTC+2, dk wrote:
>>
>> I did a form class and renders fine in the html.
>> but look ugly, I do have another field directly done directly in the HTML 
>> with a style like this and look pretty how can I put it to the form?
>> can I override the "style"? or can I change the class? so I can change 
>> the look?   thanks guys.
>>
>> .text_line {
>>  -moz-box-shadow:inset 0px 1px 0px 0px #ff;
>>  -webkit-box-shadow:inset 0px 1px 0px 0px #ff;
>>  box-shadow:inset 0px 1px 0px 0px #ff;
>>  background-color:#ededed;
>>  -moz-border-radius:6px;
>>  -webkit-border-radius:6px;
>>  border-radius:6px;
>>  border:1px solid #dcdcdc;
>>  display:inline-block;
>>  cursor:pointer;
>>  color:#77;
>>  font-family:arial;
>>  font-size:20px;
>>  font-weight:bold;
>>  padding:6px 24px;
>>  text-decoration:none;
>>  text-shadow:0px 1px 0px #ff;
>> }
>>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2824dccf-ac12-4183-8ced-f4ec1917e49a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: httml form to django

2015-05-21 Thread dk
I am not going to update any models for the database or anything I just 
need some info from the user that will be process by the view.
I could put that info in the url as a variable such /?=variable.
and then get it with 
info = request.GET.get("info", "")  
but its little ugly since you display it on the url.


On Wednesday, May 20, 2015 at 9:07:11 PM UTC-5, luisza14 wrote:

> And you need to put inside the form the csrf token .
>
> {% csrf_token %} ...
>
> See: https://docs.djangoproject.com/en/1.8/ref/csrf/
>
>
>
> 2015-05-20 16:40 GMT-06:00 술욱 >:
>
>> Hi,
>>
>> just make sure you match your input names with what Django expects. For 
>> example:
>>
>> If the HTML is  your Form will need a "username" 
>> field.
>>
>> HTH,
>> Norberto
>>
>> 2015-05-20 18:24 GMT-03:00 dk >:
>> > i have a regular form in the template.   the user and the password 
>> since the
>> > web designer did it like that.
>> > can I still use it in django view?
>> >
>> > any particular way that's need to be use?  or we need to change it to 
>> use
>> > django forms?
>> >
>> > =)
>> >
>> > --
>> > 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...@googlegroups.com .
>> > To post to this group, send email to django...@googlegroups.com 
>> .
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> > 
>> https://groups.google.com/d/msgid/django-users/8070bda1-e549-4a3a-89ee-7c1e1df9ff2c%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CADut3oAaXtGjzK9repN_waOzn0SsuWkT3Mp5DYhzMWTzosUk3g%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> "La utopía sirve para caminar" Fernando Birri
>
>
> 

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cbe6f8ba-c31e-4fe7-93b2-309178a038b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"&" string to template adds "&" in the html

2015-05-21 Thread dk
I am creating a string inside the view that will be use in the template on 
the javascript.
my string in python contains &   and I print the view and works fine,  but 
when is send to the template I don get &.

is there something magical about &   ?  or any hint on how to make it 
work?  thanks guys.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a432f1b0-5042-4b4a-a7ff-57e92ce539be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "&" string to template adds "&" in the html

2015-05-22 Thread dk
I fixed doing this

{% autoescape off %}
 {{ my_var_with_& }}
{% endautoescape%}

now works fine.
On Thursday, May 21, 2015 at 11:53:07 AM UTC-5, Andréas Kühne wrote:

>
> 2015-05-21 18:35 GMT+02:00 dk >:
>
>> I am creating a string inside the view that will be use in the template 
>> on the javascript.
>> my string in python contains &   and I print the view and works fine,  
>> but when is send to the template I don get &.
>>
>> is there something magical about &   ?  or any hint on how to make it 
>> work?  thanks guys.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a432f1b0-5042-4b4a-a7ff-57e92ce539be%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a432f1b0-5042-4b4a-a7ff-57e92ce539be%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> Yes & is & when it is HTML encoded. You will get the same problem if 
> you try to send "Bold text" to a template, it will become the HTML 
> equivalent. All strings sent from your view function / class to the 
> template will be HTML encoded UNLESS you use safestring strings: 
> https://docs.djangoproject.com/en/1.8/ref/utils/#module-django.utils.safestring
>
> Regards,
>
> Andréas
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ee49346-f842-4880-a118-72bf8de2608d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: change the style of the forms been render in the httml?

2015-05-22 Thread dk

yea doing it like its easier =)
mucho mas facil.

On Thursday, May 21, 2015 at 10:15:48 PM UTC-5, luisza14 wrote:

> It is easy, you only need to put id attribute to form statement like this 
>
>  {{form.as_p}}
>
> In CSS use cascade starting by #myform.
>
> Other thing I was used form.as_p for printing as , but you could used 
> form.as_ul or form.as_table too.  By default as_table is set when you do 
> {{form}}
>
>
>
> El jueves, 21 de mayo de 2015, dk > 
> escribió:
> > Thanks Galia, since I only have 2 fields, I think the second options 
> will be the faster,   do you have an example? no how to override the id? or 
> the class?
> > in the template I am doing  {{ form }}   I even try to do something 
> like   {{ form }}
> > but that doesn't change it =(  thanks.
> > On Thursday, May 21, 2015 at 2:42:12 AM UTC-5, Galia Ladiray wrote:
> >>
> >> What you want to do is to add a class attribute to your django widget 
> using attrs so that they will be rendered with this class, then to add the 
> style you want to this class in your CSS section,
> >> This doc shows how to do it:
> >> https://docs.djangoproject.com/en/1.8/ref/forms/widgets/
> >> You can of course override the style as well, for example using the 
> rendered id of your field, but it is less cleaner, since you will need to 
> repeat this for every field
> >>
> >> On Thursday, May 21, 2015 at 1:00:50 AM UTC+2, dk wrote:
> >>>
> >>> I did a form class and renders fine in the html.
> >>> but look ugly, I do have another field directly done directly in the 
> HTML with a style like this and look pretty how can I put it to the form?
> >>> can I override the "style"? or can I change the class? so I can change 
> the look?   thanks guys.
> >>> .text_line {
> >>>  -moz-box-shadow:inset 0px 1px 0px 0px #ff;
> >>>  -webkit-box-shadow:inset 0px 1px 0px 0px #ff;
> >>>  box-shadow:inset 0px 1px 0px 0px #ff;
> >>>  background-color:#ededed;
> >>>  -moz-border-radius:6px;
> >>>  -webkit-border-radius:6px;
> >>>  border-radius:6px;
> >>>  border:1px solid #dcdcdc;
> >>>  display:inline-block;
> >>>  cursor:pointer;
> >>>  color:#77;
> >>>  font-family:arial;
> >>>  font-size:20px;
> >>>  font-weight:bold;
> >>>  padding:6px 24px;
> >>>  text-decoration:none;
> >>>  text-shadow:0px 1px 0px #ff;
> >>> }
> >
> > --
> > 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...@googlegroups.com .
> > To post to this group, send email to django...@googlegroups.com 
> .
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/2824dccf-ac12-4183-8ced-f4ec1917e49a%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> -- 
> "La utopía sirve para caminar" Fernando Birri
>
>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e2dcee42-4aa6-48be-9258-daab121abf55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: httml form to django

2015-05-22 Thread dk
thanks for the help, 
at the end I did it with 
putting it on the url as a url variable ?var=my_var
and in the view 
request.POST.get("username").

thanks for the tips,  super helpful.


On Thursday, May 21, 2015 at 10:29:24 PM UTC-5, luisza14 wrote:

> You don't need to alter any model, only need to create a form class 
> (better) or using request.POST.get("username").
>
> If you want to do in right way 
> See 
> https://docs.djangoproject.com/en/1.8/topics/forms/
>
>
> El jueves, 21 de mayo de 2015, dk > 
> escribió:
> > I am not going to update any models for the database or anything I just 
> need some info from the user that will be process by the view.
> > I could put that info in the url as a variable such /?=variable.
> > and then get it with
> > info = request.GET.get("info", "") 
> > but its little ugly since you display it on the url.
> >
> > On Wednesday, May 20, 2015 at 9:07:11 PM UTC-5, luisza14 wrote:
> >>
> >> And you need to put inside the form the csrf token .
> >>
> >> {% csrf_token %} ...
> >>
> >> See: https://docs.djangoproject.com/en/1.8/ref/csrf/
> >>
> >>
> >> 2015-05-20 16:40 GMT-06:00 술욱 :
> >>>
> >>> Hi,
> >>>
> >>> just make sure you match your input names with what Django expects. 
> For example:
> >>>
> >>> If the HTML is  your Form will need a 
> "username" field.
> >>>
> >>> HTH,
> >>> Norberto
> >>>
> >>> 2015-05-20 18:24 GMT-03:00 dk :
> >>> > i have a regular form in the template.   the user and the password 
> since the
> >>> > web designer did it like that.
> >>> > can I still use it in django view?
> >>> >
> >>> > any particular way that's need to be use?  or we need to change it 
> to use
> >>> > django forms?
> >>> >
> >>> > =)
> >>> >
> >>> > --
> >>> > 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...@googlegroups.com.
> >>> > To post to this group, send email to django...@googlegroups.com.
> >>> > Visit this group at http://groups.google.com/group/django-users.
> >>> > To view this discussion on the web visit
> >>> > 
> https://groups.google.com/d/msgid/django-users/8070bda1-e549-4a3a-89ee-7c1e1df9ff2c%40googlegroups.com
> .
> >>> > For more options, visit https://groups.google.com/d/optout.
> >>>
> >>> --
> >>> 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...@googlegroups.com.
> >>> To post to this group, send email to django...@googlegroups.com.
> >>> Visit this group at http://groups.google.com/group/django-users.
> >>> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CADut3oAaXtGjzK9repN_waOzn0SsuWkT3Mp5DYhzMWTzosUk3g%40mail.gmail.com
> .
> >>> For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>
> >> --
> >> "La utopía sirve para caminar" Fernando Birri
> >>
> >>
> > --
> > 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...@googlegroups.com .
> > To post to this group, send email to django...@googlegroups.com 
> .
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/cbe6f8ba-c31e-4fe7-93b2-309178a038b8%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> -- 
> "La utopía sirve para caminar" Fernando Birri
>
>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/961200a3-fd64-4b24-b1cd-b8d515949981%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


calling a view from a view doesnt clear the URL path

2015-05-29 Thread dk
I am doing something like this.
http://stackoverflow.com/questions/4808329/can-i-call-a-view-from-within-another-view

I have my original view that actually gets render as html.
the html have a button that runs another view. with all the logic to 
process the information. and at the end I want to return to the original 
view with an extra parameter. just a message saying that was successfully.

everything work perfect,  but the URL path at the top on the browser 
doesn't reset. still shows all the information that I passed to my second 
view.   still shows all the variables that I passed from the second url to 
the view. =(  
is there I way to reset that?





-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/de221155-79ad-459c-9f5d-402fcf961abb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: calling a view from a view doesnt clear the URL path

2015-05-29 Thread dk
in the second view I am doing at the end.

return original_view(request, message="successfully")

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/72437253-30d5-4c6a-86f3-b87539621936%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: calling a view from a view doesnt clear the URL path

2015-05-29 Thread dk
can I redirect with an argument?

On Friday, May 29, 2015 at 1:00:07 PM UTC-5, Daniel Roseman wrote:
>
> Why should it? The browser requested the original view, and the code 
> returned a response to that request. The browser doesn't know or care that 
> the process of constructing that response involved calling another view 
> function. 
>
> If you want to change the URL, instead of returning the result of another 
> view, you should return a *redirect* to that view. 
>
> -- 
> DR.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/908461ec-513e-4193-b465-00670074c366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: calling a view from a view doesnt clear the URL path

2015-05-29 Thread dk
so that redirect needs to be catch by the url,   interesting.

On Friday, May 29, 2015 at 1:22:40 PM UTC-5, Daniel Roseman wrote:
>
> You can redirect with whatever arguments you want, as long as the 
> receiving URL accepts them.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef6e3139-e78b-43eb-b1c8-671f50a64eac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django subprocess doesnt like sleep

2015-06-05 Thread dk
I created a website that can reboot a machine. basically subprocess a 
script that lunch the reboot command in Linux.
after that  I need to run some other operations. after that I wait 1 minute 
before start pinging the machine to see if its back online.

the funny thing my script doesn't work, and I found out that django doesn't 
like to wait more than 24 secs. =(  I might be doing something wrong?  If I 
do more than 25 the process just stops at the time.sleep(60) and nothing 
happen afterwards.  if I do it for 24 secs everything run fine.   

is there any special thing that I should know?

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/89d96ad6-88b2-402a-9e23-269b02ea4155%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django subprocess doesnt like sleep

2015-06-05 Thread dk
this is what I got from putting 
*time.sleep(60)*
*print "sleeped for 60secs"*
*print 6*
directly in the view.
and this is what the httpd log gave me.



*[Fri Jun 05 11:31:02.034913 2015] [mpm_prefork:notice] [pid 33231] 
AH00170: caught SIGWINCH, shutting down gracefully[Fri Jun 05 
16:31:02.046665 2015] [:error] [pid 33304] sleeped for 60secs[Fri Jun 05 
16:31:02.046702 2015] [:error] [pid 33304] 6*

why is shutting down gracefully, what does it mean? that killed to 
process?  why?can this be happening to my subprocess? 

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/222a147f-1771-43f7-8b0c-621819cfb89e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django subprocess doesnt like sleep

2015-06-05 Thread dk

some one put in contab -e
** * * * * systemctl resetart httpd*

means that every minute the apache server is restarting and killing 
everything. that's why non of the script where working =(  
now that I commented that line from cron tab its working =).

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cee01cab-d626-4216-96d5-75dd604497fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


why my button render on top of the form?

2015-06-24 Thread dk

{% csrf_token %}
{{ form }}



I expected since the form  its first than the input type submit,   I should 
get my form, and below the button right?

but instead I get the button on the top,  and then the form. I am missing 
something?



-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a98f93d2-23e7-4afe-9f6a-bbd519d66e26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why my button render on top of the form?

2015-06-24 Thread dk
I found that if the form is inside a table. then it acts funky =(


  
On Wednesday, June 24, 2015 at 2:12:23 PM UTC-5, dk wrote:

> 
> {% csrf_token %}
> {{ form }}
> 
> 
>
> I expected since the form  its first than the input type submit,   I 
> should get my form, and below the button right?
>
> but instead I get the button on the top,  and then the form. I am missing 
> something?
>
>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed698b57-4cb9-4ae5-9bb5-cdbcda9df742%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why my button render on top of the form?

2015-06-24 Thread dk


found the answer,  
if its inside a table does the funcky thing...  if its pass   as_p  works 
fine.

{{ form.as_p }} did the trick =)   

sorry for all the posts

On Wednesday, June 24, 2015 at 3:23:32 PM UTC-5, dk wrote:

> I found that if the form is inside a table. then it acts funky =(
>
>
>   
> On Wednesday, June 24, 2015 at 2:12:23 PM UTC-5, dk wrote:
>
>> 
>> {% csrf_token %}
>> {{ form }}
>> 
>> 
>>
>> I expected since the form  its first than the input type submit,   I 
>> should get my form, and below the button right?
>>
>> but instead I get the button on the top,  and then the form. I am missing 
>> something?
>>
>>
>>
>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/29e69310-a7c2-4062-8968-9696a1a6a678%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: can i use sqlite for big project?

2015-06-26 Thread dk

as my understanding SQLite will only let you do one transaction at the 
time. and cant handle big volume of inputs at  once.
is great and easy since comes already as part of python if you are doing 
something for your local team. like a bug report or something that you know 
that not every one will be using it ALL the time.


On Thursday, June 25, 2015 at 9:08:32 AM UTC-5, Arindam sarkar wrote:

> i need to develop a job portal . is there any problem if i use sqlite ? 
> coz i am having problem to setup mysql or postgresql . please help.
>
> -- 
> Regards,
>
> Arindam
>
> Contact no. 08732822385
>
>
>  

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ea5b889-c4fc-474c-87d4-e4a4f71317a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


loop a ChoiceField SelectMultiple form in the view as post

2015-07-09 Thread dk
i made a from

lista = (("1","one"), ("2", "two"))
pending = forms.ChoiceField(widget=forms.SelectMultiple, choices=lista)



I do get it as post method.
I do get true with is_valid()

it renders properly in the website. 
but when I press the submit button.

and I am printing the form.cleaned_data["pending"]
its just empty =(
so I try  to do 
for I in form.cleaned_data["pending"]
print i
and its also empty

should I get a list out of the multiselect form? 

I just want to print all the lines that are in there.  even if they are not 
selected.   I want to retrieve the 1 and 2 in the view.

might be a missing part that I am not doing correct.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6dc74f0f-5a7a-4855-907b-464981c58559%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: loop a ChoiceField SelectMultiple form in the view as post

2015-07-10 Thread dk
i might simplify lol i didnt even understand.

after i validate and clean a ChoiceField how do i us it?   
does it return a directory saying whats selected?

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5da5190f-065e-47f7-bf75-d9a1217c7526%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


new to django data modeling for an application

2014-09-18 Thread dk
i did the django tutorial  and to get a better grasp i decided to make a 
webpage.  with 2 sections

section 1
every day will let the user vote for a restaurant before 4pm

section 2
from the restaurant with more votes will display the menu of the 
restaurant  and each user can chose what they want for dinner.
that way the admin of the restaurant can just print that list every day =)

and if some one ask me for information,  
i would like to be able to tell them, 
a date, what restaurant was choosen, how many votes, and the selection of 
the users.
maybe they want to know whats the most popular restaurant, or the food that 
more people select from a particular restaurant

(this was very easy in my head till i got to thing on the data base tables 
and how they should be connected)

so first things first.

i made my django project, 
added an application call poll

in here i should have my
restaurant table with a choise list of the restaurants that can be chosen.

and after that should be another table with the dishes. where the forgen 
key is the restaurant???
how i do this one?

thaks guys.












-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5c575766-191d-4c29-8811-9c033efc2127%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django data modeling for an application

2014-09-21 Thread dk


class Person(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField()

def __str__(self):
return self.name


class Restaurant(models.Model):
name = models.CharField(max_length=100)
adress = models.CharField(max_length=200)

def __str__(self):
return self.name


class Dish(models.Model):
restaurant = models.ForeignKey(Restaurant)
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name

should i connect some how the person to the restaurant?


On Thursday, September 18, 2014 5:17:17 PM UTC-5, dk wrote:

> i did the django tutorial  and to get a better grasp i decided to make a 
> webpage.  with 2 sections
>
> section 1
> every day will let the user vote for a restaurant before 4pm
>
> section 2
> from the restaurant with more votes will display the menu of the 
> restaurant  and each user can chose what they want for dinner.
> that way the admin of the restaurant can just print that list every day =)
>
> and if some one ask me for information,  
> i would like to be able to tell them, 
> a date, what restaurant was choosen, how many votes, and the selection of 
> the users.
> maybe they want to know whats the most popular restaurant, or the food 
> that more people select from a particular restaurant
>
> (this was very easy in my head till i got to thing on the data base tables 
> and how they should be connected)
>
> so first things first.
>
> i made my django project, 
> added an application call poll
>
> in here i should have my
> restaurant table with a choise list of the restaurants that can be chosen.
>
> and after that should be another table with the dishes. where the forgen 
> key is the restaurant???
> how i do this one?
>
> thaks guys.
>
>
>
>
>
>
>
>
>
>
>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c300d469-5d6f-41f2-8b9f-7debdeb3bb8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django data modeling for an application

2014-09-21 Thread dk


class Person(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField()

def __str__(self):
return self.name


class Restaurant(models.Model):
name = models.CharField(max_length=100)
adress = models.CharField(max_length=200)

def __str__(self):
return self.name


class Dish(models.Model):
restaurant = models.ForeignKey(Restaurant)
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name


should i connect the person to a restaurant some how?



On Friday, September 19, 2014 6:01:52 PM UTC-5, Collin Anderson wrote:

> class Dish(models.Model):
> resturant = models.ForeignKey(Resturant)
> name = models.CharField(max_length=255)
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3995927f-853d-4174-856c-c8819ec13548%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


trying to load a view

2014-09-21 Thread dk
my application named polls
in polls/views.py
i have:


*from django.http import HttpResponseimport datetime*




*def hello(request):now = datetime.datetime.now()html = 
"It is now %s." % nowreturn 
HttpResponse(html)*


my project call restaurants
restaurants/urls.py:

*from django.conf.urls import patterns, include, url*

*from django.contrib import adminadmin.autodiscover()*


*import polls.viewsurlpatterns = patterns('',*


*url(r'^hello/$', include(polls.views.hello)),url(r'^admin/', 
include(admin.site.urls)),)*

and i get this error.
Request URL:http://127.0.0.1:8000/hello/Django Version:1.7Exception Type:
ImproperlyConfiguredException Value:

The included urlconf '' does not appear to have 
any patterns in it. If you see valid patterns in the file then the issue is 
probably caused by a circular import.


all the tutorials and webpages mention this tutorials, saying that should 
work, any ideas what might be?

thanks.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/205e4901-a436-4260-8d08-aff06cd3ca3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: trying to load a view

2014-09-21 Thread dk

>
> here is my project in a rar.
>>
>
dont know if might be something with django 1.7

thanks =) 

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd51a4d0-6168-4de9-ada3-3a292cd61c45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


restaurants.rar
Description: application/rar


Re: trying to load a view

2014-09-24 Thread dk

>
> thanks  now when i go to the website
>
 http://127.0.0.1:8000/hello/  does work, so the include work for 
including the urls file inside the applications?

and if i go to 
http://127.0.0.1:8000/
i get the 404 error

Page not found (404)Request Method:GETRequest URL:http://127.0.0.1:8000/

Using the URLconf defined in restaurants.urls, Django tried these URL 
patterns, in this order: 

   1. ^admin/ 
   2. ^hello/$ 

The current URL, , didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django 
settings file. Change that to False, and Django will display a standard 404 
page. 


is that how suppouse to be? or should i be getting the message that django 
gives at the beggining? 
It worked!Congratulations on your first Django-powered page


thanks for the help.  =)

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5fbdea98-4730-40ae-8a63-689c2e486c67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Query s in django 1.7

2014-10-03 Thread dk
*i am trying to query base on the id of the table and i get a big error,   
when i do it using .all()  i can get the objects*



*>>> Restaurant.objects.all()*
[, , , ]
this works for looping and getting the information such
for i in Restaurant.objects.all():
print i.id
print i.name

1
angry dog
2
cafe brazil
3
papa johns
4
lolos

and here when i want to get by  the id (or doing name="lolos")
*>>> Restaurant.objects.get(id=3)*
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python27\lib\site-packages\django\db\models\manager.py", line 
92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 345, 
in get
clone = self.filter(*args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 691, 
in filter
return self._filter_or_exclude(False, *args, **kwargs)
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 709, 
in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
  File "C:\Python27\lib\site-packages\django\db\models\sql\query.py", line 
1287, in add_q
clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "C:\Python27\lib\site-packages\django\db\models\sql\query.py", line 
1314, in _add_q
current_negated=current_negated, connector=connector)
  File "C:\Python27\lib\site-packages\django\db\models\sql\query.py", line 
1138, in build_filter
lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
  File "C:\Python27\lib\site-packages\django\db\models\sql\query.py", line 
1076, in solve_lookup_type
_, field, _, lookup_parts = self.names_to_path(lookup_splitted, 
self.get_meta())
  File "C:\Python27\lib\site-packages\django\db\models\sql\query.py", line 
1339, in names_to_path
field, model, direct, m2m = opts.get_field_by_name(name)
  File "C:\Python27\lib\site-packages\django\db\models\options.py", line 
416, in get_field_by_name
cache = self.init_name_map()
  File "C:\Python27\lib\site-packages\django\db\models\options.py", line 
445, in init_name_map
for f, model in self.get_all_related_m2m_objects_with_model():
  File "C:\Python27\lib\site-packages\django\db\models\options.py", line 
563, in get_all_related_m2m_objects_with_model
cache = self._fill_related_many_to_many_cache()
  File "C:\Python27\lib\site-packages\django\db\models\options.py", line 
577, in _fill_related_many_to_many_cache
for klass in self.apps.get_models():
  File "C:\Python27\lib\site-packages\django\utils\lru_cache.py", line 101, 
in wrapper
result = user_function(*args, **kwds)
  File "C:\Python27\lib\site-packages\django\apps\registry.py", line 168, 
in get_models
self.check_models_ready()
  File "C:\Python27\lib\site-packages\django\apps\registry.py", line 131, 
in check_models_ready
raise AppRegistryNotReady("Models aren't loaded yet.")
AppRegistryNotReady: Models aren't loaded yet.


reading the tutorials and my book thats it, not sure if i have to activate 
something somewhere else? or linke bewteen all the files some code?
thanks guys.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/278ad24d-fe8f-4f92-8021-0e2b8de6d79c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Query s in django 1.7

2014-10-03 Thread dk
yes,that did the trick, odd that on .all does work fine,  i wish the error 
was more descriptive.

On Friday, October 3, 2014 7:52:40 AM UTC-5, Collin Anderson wrote:
>
> You need to call django.setup().
>
> I can confirm, though, that using Model.objects.all() somehow sometimes 
> seems to work without calling django.setup().
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1664d4a8-45ff-4b6f-818e-2cf3f54c5413%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant pass the "CSRF verification failed. Request aborted." error

2014-10-07 Thread dk
I am using 1.7

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a5d18554-4e45-4723-a092-55207dd7898b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cant pass the "CSRF verification failed. Request aborted." error

2014-10-09 Thread dk
Ah   nice trick, store the variables into the url and then pass the url 
with some regular expression.
=)



def vote(request):
if request.method == "POST":
form = polls.forms_DK.NameForm(request.POST)
if form.is_valid():
*your_email **= form.cleaned_data["your_email"]*
*ratio **= str(form.cleaned_data["ratio"])*
*adress **= "thanks/"+your_email+"/"*
return HttpResponseRedirect(adress)
else:
form = polls.forms_DK.NameForm()
django.setup()
all_restaurants = Restaurant.objects.all()
#return render_to_response("vote_form.html", {"all_restaurants": 
all_restaurants, "form": form})
return render(request, "vote_form.html", {"all_restaurants": 
all_restaurants, "form": form})


ok now to learn how to catch that url
will something like this would work?
url(r'^thanks/(?Pw+)/$', views.thanks),


-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f906713c-6b72-4353-8d12-c0c45982c9b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


best aproach to pass an email from the url to a view?

2014-10-09 Thread dk
I put the Email that I got from a form into the url (I am using the url as 
a variable to store the email)

and look like this
http://127.0.0.1:8000/polls/vote/thank/a...@b.com/


url:
url(r'^vote/thank/(?   #here should be RE catching the email   
 )$', views.thank),
view:
def thank(request, your_email=None):
c = {"thanks_body": "thanks_body view"}
c["his_email"] = your_email
return render(request, "thanks.html", c)

I am having issues to try to come up with a RE to grab the email
I try 
http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address
using it on my url
such 
url(r'^vote/thank/(?
*^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$* ', 
views.thank),
 and I still don't catch it, I think because I am just copy pasting but in 
the url string should be arrenge diferntly?
I was reading about a  get function that can make a quary on the url like a 
dictionary?  any example on how to use it?

thanks,  (I order a book for RE  =)  just to be able to udertand a little 
bit more   )



-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b84874c3-32ad-47fb-82db-5e48b87a975d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: best aproach to pass an email from the url to a view?

2014-10-10 Thread dk
WOW SUPER EASY
I been fighting to the get the email and passing it

thanks for the tips, and how to use it.


my url
url(r'^vote/thank/$', views.thank),


my views

def vote(request):
if request.method == "POST":
form = polls.forms_DK.NameForm(request.POST)
if form.is_valid():
your_email = form.cleaned_data["your_email"]
ratio = str(form.cleaned_data["ratio"])
*adress **= "thank/?email="+your_email+"/" # here I make the 
URL*
return HttpResponseRedirect(adress)
else:
form = polls.forms_DK.NameForm()
django.setup()
all_restaurants = Restaurant.objects.all()
return render(request, "vote_form.html", {"all_restaurants": 
all_restaurants, "form": form})

def thank(request, your_email=None): # I don't need your_email=None
c = {"thanks_body": "thanks_body view"} # I can rearenge the dictonary
*remail **= request.GET["email"] #here I pick up the email*
c["thanks_body"] = remail
return render(request, "thanks.html", c)


-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32aa270f-fd9e-44b6-b8fc-cea6ff7706ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to query max count

2014-10-12 Thread dk
I am storing the information in the database like this.

class Choice(models.Model):
restaurant = models.ForeignKey(Restaurant)
person = models.ForeignKey(Person)
date = models.DateField("time published")
time = models.TimeField("date published")


that way I can get the person and the restaurant.   and will look like in 
the attached pictures, now how can I query.
the max repeated restaurant id, for today date.

I want to know today what restaurant won.   =)  (I am trying to 
even think on how to get this in a regular sql command)

thanks guys.

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


query join tables

2014-10-12 Thread dk
I have this 2 models

class Choice(models.Model):
restaurant = models.ForeignKey(Restaurant)
person = models.ForeignKey(Person)
date = models.DateField("time published")
time = models.TimeField("date published")

class Person(models.Model):
name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
email = models.EmailField()

and I would like to be able to see check if in a certain date, a certain 
person does exist in the record.
I am currently querying the date first.

date_query = Choice.objects.filter(date=dater)
for i in date_query:
if i.person_id == to_email_i_am_looking:

might be another way to chain the querys? 
kinda

SELECT person  FROM choice JOIN people
ON choice.person_ID=person+ID; 
WHERE date= today and person=someone
?

I read about select_related that use the ForeignKey,  but I have 2 in my 
case,  the person and the restaurant,  does it loop on bouth?


-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dce1c0b8-8e3e-4a86-b7f3-f968bd848d8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: query join tables

2014-10-13 Thread dk
I will give a try,   how does django know that have to join  using double 
filter? or it just auto-magically knows behind the hood?
or filtering by another model/class django get the idea, and joins the 
tables?

Thanks Tom =)

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a481b35d-a1db-497c-a39d-2519213500a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to query max count

2014-10-13 Thread dk
I need to learn how to use aggregation in django, I was thinking  on filter 
by date, 
and then loop the query and make a dictionary with the name, and += value 
and then use the python max function.


On Monday, October 13, 2014 3:12:39 AM UTC-5, JirkaV wrote:

> Hi there, 
>
>   you could do it manually by counting occurrences or you could take a 
> look at aggregation functions here: 
> https://docs.djangoproject.com/en/1.7/topics/db/aggregation/
>
>   Do as it suits your use case.
>
>   HTH
>
> Jirka
>
> On 13 October 2014 06:30, dk > wrote:
>
>> I am storing the information in the database like this.
>>
>> class Choice(models.Model):
>> restaurant = models.ForeignKey(Restaurant)
>> person = models.ForeignKey(Person)
>> date = models.DateField("time published")
>> time = models.TimeField("date published")
>>
>>
>> that way I can get the person and the restaurant.   and will look like in 
>> the attached pictures, now how can I query.
>> the max repeated restaurant id, for today date.
>>
>> I want to know today what restaurant won.   =)  (I am trying to 
>> even think on how to get this in a regular sql command)
>>
>> thanks guys.
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c007ac5c-691c-4e0c-aeb4-00b935ce4b9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to query max count

2014-10-15 Thread dk
looks like it works like this

the_max = Choice.objects.filter(date=date)
print max(the_max)





On Monday, October 13, 2014 6:14:28 PM UTC-5, dk wrote:

> I need to learn how to use aggregation in django, I was thinking  on 
> filter by date, 
> and then loop the query and make a dictionary with the name, and += value 
> and then use the python max function.
>
>
> On Monday, October 13, 2014 3:12:39 AM UTC-5, JirkaV wrote:
>
>> Hi there, 
>>
>>   you could do it manually by counting occurrences or you could take a 
>> look at aggregation functions here: 
>> https://docs.djangoproject.com/en/1.7/topics/db/aggregation/
>>
>>   Do as it suits your use case.
>>
>>   HTH
>>
>> Jirka
>>
>> On 13 October 2014 06:30, dk  wrote:
>>
>>> I am storing the information in the database like this.
>>>
>>> class Choice(models.Model):
>>> restaurant = models.ForeignKey(Restaurant)
>>> person = models.ForeignKey(Person)
>>> date = models.DateField("time published")
>>> time = models.TimeField("date published")
>>>
>>>
>>> that way I can get the person and the restaurant.   and will look like 
>>> in the attached pictures, now how can I query.
>>> the max repeated restaurant id, for today date.
>>>
>>> I want to know today what restaurant won.   =)  (I am trying to 
>>> even think on how to get this in a regular sql command)
>>>
>>> thanks guys.
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/feafc9d8-709a-48e7-a76e-405533a16208%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to use __init__ in a form (passing an extra variable to the form)

2014-10-15 Thread dk
I have a form, and I want to put the email and then get some ratio buttons 
with the information of dishes from a restaurant.
I want to pass the restaurant id to the form, and let the form init get all 
the information and spit out the form for rendering in the httml,the 
email form that is not inside the init works, but after that nothing else is 
render.  

I get the error:
Request Method:GETRequest URL:http://127.0.0.1:8000/polls/order/Django 
Version:1.7Exception Type:TypeErrorException Value:

__init__() should return None, not 'ChoiceField'


I am assuming I shouldn't be returning anything? or is another variable 
that I need to return?



my form:
class Form_Dishes(forms.Form):
your_email = forms.EmailField(initial="a...@b.com")
def __init__(self, restaurant_id):
super(Form_Dishes, self).__init__()

self.restaurant_id = restaurant_id
django.setup()
alll = Dish.objects.filter(restaurant_id=self.restaurant_id)
options_ratio = []
for i in alll:
mini_list = []
mini_list.append(i.id)
mini_list.append(i.name)
options_ratio.append(mini_list)

print options_ratio
ratio = forms.ChoiceField(choices=options_ratio, widget=forms.
RadioSelect(), initial=1)

return ratio



-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8fcdfad5-53d0-4ec2-a404-480e0fd6365d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use __init__ in a form (passing an extra variable to the form)

2014-10-17 Thread dk
thanks Carl, that  was extremely clear, step by step.

took me a little bit to get the self.fields,  since I was trying to 
override directly  as ratiooo.choices.
and I move the django.setup()  to the top of the file after the imports 
(meantime). not sure what it does, I know that just need to be call before 
any query if not they don't work =(


class FormDishes(forms.Form):
your_email = forms.EmailField(initial="a...@b.com")
ratiooo = forms.ChoiceField(choices="", widget=forms.RadioSelect(), 
initial=1)
def __init__(self, *args, **kwargs):
self.restaurant_id = kwargs.pop("restaurant_id")
super(FormDishes, self).__init__(*args, **kwargs)
self.options = self.make_choices()
self.fields["ratiooo"].choices=self.options

def make_choices(self):
all = Dish.objects.filter(restaurant_id=self.restaurant_id)
options_ratio = []
for i in all:
options_ratio.append((i.id, i.name))
return options_ratio

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/816954de-4e6f-411b-bafc-701a8a708227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to query max count

2014-10-20 Thread dk
ok that max(the_max)  didn't work every time it provide a different result 
(looking into this) just updating the post in case someone was looking into 
this as a solution.

On Thursday, October 16, 2014 12:21:33 AM UTC-5, dk wrote:
>
> looks like it works like this
>
> the_max = Choice.objects.filter(date=date)
> print max(the_max)
>
>
>
>
>
> On Monday, October 13, 2014 6:14:28 PM UTC-5, dk wrote:
>
>> I need to learn how to use aggregation in django, I was thinking  on 
>> filter by date, 
>> and then loop the query and make a dictionary with the name, and += value 
>> and then use the python max function.
>>
>>
>> On Monday, October 13, 2014 3:12:39 AM UTC-5, JirkaV wrote:
>>
>>> Hi there, 
>>>
>>>   you could do it manually by counting occurrences or you could take a 
>>> look at aggregation functions here: 
>>> https://docs.djangoproject.com/en/1.7/topics/db/aggregation/
>>>
>>>   Do as it suits your use case.
>>>
>>>   HTH
>>>
>>> Jirka
>>>
>>> On 13 October 2014 06:30, dk  wrote:
>>>
>>>> I am storing the information in the database like this.
>>>>
>>>> class Choice(models.Model):
>>>> restaurant = models.ForeignKey(Restaurant)
>>>> person = models.ForeignKey(Person)
>>>> date = models.DateField("time published")
>>>> time = models.TimeField("date published")
>>>>
>>>>
>>>> that way I can get the person and the restaurant.   and will look like 
>>>> in the attached pictures, now how can I query.
>>>> the max repeated restaurant id, for today date.
>>>>
>>>> I want to know today what restaurant won.   =)  (I am trying to 
>>>> even think on how to get this in a regular sql command)
>>>>
>>>> thanks guys.
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/1628cbb6-f8ee-491b-a031-ad7aec787178%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a23eaefc-65e8-4763-8d0f-1d2c51136e46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.8 or 1.9?

2016-05-12 Thread dk
will be better to  hit your head vs the wall now using 1.9, 
than later in a real project,plus there is not much difference, they 
added a couple of things,  but mostly is the same,  I would do the Django 
tutorial of Django website before, step by step.

On Thursday, May 12, 2016 at 8:55:15 AM UTC-7, Ankush Thakur wrote:

> I want to take a Udemy course on Django because it shows how to make an 
> e-commerce website. The only catch - it follows Django 1.8. So my question 
> is: Will I be "wasting" my time learning a possibly outdated (or 
> unrecommended) version of Django? I have a feeling the changes aren't going 
> to be that significant, but later on when I recreate the project myself in 
> 1.9, I wouldn't want to tear out my hair solving weird error messages.
>
> Any wise words?
>
> Regards,
> Ankush Thakur
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28b00546-7d7e-4efe-bf79-3ea8ae7bc8cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use css in django 1.9

2016-05-12 Thread dk
 or what would be the best way to "print" the path for static?



On Thursday, May 12, 2016 at 5:03:45 PM UTC-7, dk wrote:

> I am starting with Django 1.9  and  it say that we can have static files  
> outside the apps,  just for generics for the hole project or inside the 
> apps.
>
> according to the how to, should work  :(
>
> here I uploaded my mini project, 
> when I put this address the code works  but doesn't really use the css
> http://127.0.0.1:8000/my_app/
>
> I also try to put a folder call static inside the app and the css file 
> inside,  but same issue. what should be the proper way to set up the 
> css?
>
> thanks guys, I appreciate it. =)
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6aaf20f-3dbc-4f95-949b-9d4080d5bcca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to use css in django 1.9

2016-05-13 Thread dk
add this to the settings.


STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)



http://www.effectivedjango.com/tutorial/static.html

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c77b4e7e-d923-4475-8b1c-43b68fad1428%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


passing url variables to views

2016-05-31 Thread dk
this is the URS i get

http://127.0.0.1:8000/my_app/run_delete/?user_del=ccc_ccc***a_b***/

and i want to be able to get the string  *ccc_ccc***a_b

my url pattern is: 

url(r'^run_delete/(?P\w+)/$', views.run_delete, name='run_delete')



but it looks like is not catching it,   i am missing something? i am using 
django 1.9

thanks guys

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5c6c4fbe-836b-4f77-b5fe-64bdc382e35e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: passing url variables to views

2016-05-31 Thread dk
i was looking for something like this
https://docs.djangoproject.com/en/1.9/ref/urls/#django.conf.urls.url
http://stackoverflow.com/questions/15644809/django-url-patterns

the tutorial use d  for getting the number of the years,   =( i am 
skipping a step?

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62645261-8a24-4950-8cf5-06503dd809b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: passing url variables to views

2016-05-31 Thread dk
and then i can use it in the view? as an argument?

On Tuesday, May 31, 2016 at 12:33:55 PM UTC-5, Akhil Lawrence wrote:
>
> Hi,
>
> The URL you are calling is wrong.. 
>
> You should call it like 
> http://127.0.0.1:8000/my_app/run_delete/ccc_ccc***a_b***/ 
> <http://127.0.0.1:8000/my_app/run_delete/?user_del=ccc_ccc***a_b***/>
>
> No need to pass it as an query parameter.
>
>
>
>
> On Tuesday, 31 May 2016 15:03:59 UTC+5:30, dk wrote:
>>
>> this is the URS i get
>>
>> http://127.0.0.1:8000/my_app/run_delete/?user_del=ccc_ccc***a_b***/
>>
>> and i want to be able to get the string  *ccc_ccc***a_b
>>
>> my url pattern is: 
>>
>> url(r'^run_delete/(?P\w+)/$', views.run_delete, name='run_delete')
>>
>>
>>
>> but it looks like is not catching it,   i am missing something? i am 
>> using django 1.9
>>
>> thanks guys
>>
>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a864bc58-bc60-4863-bba8-85e2740f97ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


upload zip or rar files

2015-09-29 Thread dk
I set up a form to upload files,  and every thing works fine,   the only 
problem is when I am in the webpage and I click the button to choose the 
file I want to upload doesn't show or zips, or rars.  I try playing with 
the input tag accept, from all the type of zips,  to leave it open to 
upload what ever file.

I try it in Firefox, chrome and IE,   I am missing something?

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3ee0eb3-c1c7-424b-87c2-4c63d10ec83d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: upload zip or rar files

2015-09-30 Thread dk

FYI,
it works if the zip or the rar files were generated in windows, 

not if they come from Linux =(...




On Tuesday, September 29, 2015 at 1:41:27 PM UTC-5, dk wrote:

> I set up a form to upload files,  and every thing works fine,   the only 
> problem is when I am in the webpage and I click the button to choose the 
> file I want to upload doesn't show or zips, or rars.  I try playing with 
> the input tag accept, from all the type of zips,  to leave it open to 
> upload what ever file.
>
> I try it in Firefox, chrome and IE,   I am missing something?
>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9a74257b-36b1-47dc-a7d1-47532373960e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Project settings and application settings.

2013-06-20 Thread piir . dk
Hello all,

I want to have an application settings modifying the project settings but 
it doesn't seems to work.

For development purpose I need to authenticate users against my application 
database. In Production
the authentication is done by Apache, it then sends the REMOTE_USER, 
correctly.

To realize the authentication in production, i am using one middleware, and 
one backend as found in
django documentation.

I would like to have only one setting in the project thesite/settings.py, a 
boolean called EXTERNAL_AUTH,
controling the content of AUTHENTICATION_BACKENDS and MIDDLEWARE_CLASSES.

The code modifying those two variables will stand in my application 
my/settings.py, It would then look like this

from django.conf import settings
if settings.EXTERNAL_AUTH == False:
# Disabling standard login/logout.
settings.LOGIN_REDIRECT_URL='/'
settings.LOGIN_URL='/my/accounts/login/'
settings.LOGOUT_URL='/my/accounts/logout/'
else:
settings.AUTHENTICATION_BACKENDS = (
('my.backends.LDAPUserBackend', ) +
settings.AUTHENTICATION_BACKENDS)

# Insert LDAPUserMiddleware right after AuthenticationMiddleware
index = settings.MIDDLEWARE_CLASSES.index(
"django.contrib.auth.middleware.AuthenticationMiddleware")
settings.MIDDLEWARE_CLASSES = (settings.MIDDLEWARE_CLASSES[:index+1] +
('my.backends.LDAPUserMiddleware', ) +
settings.MIDDLEWARE_CLASSES[index+1:])

EXTERNAL_AUTH is used at different locations in my application, for example 
I use it to decide whether or not
I display the "change password" link.

When I start testing, toggling EXTERNAL_AUTH, the behavior is fuzzy. It 
inconsitently redirect me to the accounts/login
even if I'm authenticated through apache. I guess the middleware isn't 
called but when I raise an error, the debug page
contradicts this.

I'm a bit lost. Do you have any hint?

Regards,



-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Project settings and application settings.

2013-06-21 Thread piir . dk

I don't really want the settings to be adjusted at runtime, I would like my 
application to reset some django "core" settings like the 
MIDDLEWARE_CLASSES during the project configuration, once for all.
It is just to ease the deployment of the project and because the 
applications knows which settings it needs.

But if as you said settings are immutable then I'm doing it wrong, a 
management command would be a better place to do this settings.


Thank you for your answer

Le jeudi 20 juin 2013 17:00:19 UTC+2, Jacky Tian a écrit :
>
> Django settings are meant to be immutable, so your issues might be 
> stemming from the way you're changing settings at runtime. Most Django 
> projects that need to adjust settings at runtime do so by keeping the 
> mutable settings in the database (e.g. a separate app in the project), so 
> that's an approach you could try.
>
> On Thursday, June 20, 2013 5:32:31 AM UTC-4, pii...@gmail.com wrote:
>>
>> Hello all,
>>
>> I want to have an application settings modifying the project settings but 
>> it doesn't seems to work.
>>
>> For development purpose I need to authenticate users against my 
>> application database. In Production
>> the authentication is done by Apache, it then sends the REMOTE_USER, 
>> correctly.
>>
>> To realize the authentication in production, i am using one middleware, 
>> and one backend as found in
>> django documentation.
>>
>> I would like to have only one setting in the project thesite/settings.py, 
>> a boolean called EXTERNAL_AUTH,
>> controling the content of AUTHENTICATION_BACKENDS and MIDDLEWARE_CLASSES.
>>
>> The code modifying those two variables will stand in my application 
>> my/settings.py, It would then look like this
>>
>> from django.conf import settings
>> if settings.EXTERNAL_AUTH == False:
>> # Disabling standard login/logout.
>> settings.LOGIN_REDIRECT_URL='/'
>> settings.LOGIN_URL='/my/accounts/login/'
>> settings.LOGOUT_URL='/my/accounts/logout/'
>> else:
>> settings.AUTHENTICATION_BACKENDS = (
>> ('my.backends.LDAPUserBackend', ) +
>> settings.AUTHENTICATION_BACKENDS)
>>
>> # Insert LDAPUserMiddleware right after AuthenticationMiddleware
>> index = settings.MIDDLEWARE_CLASSES.index(
>> "django.contrib.auth.middleware.AuthenticationMiddleware")
>> settings.MIDDLEWARE_CLASSES = (settings.MIDDLEWARE_CLASSES[:index+1] +
>> ('my.backends.LDAPUserMiddleware', ) +
>> settings.MIDDLEWARE_CLASSES[index+1:])
>>
>> EXTERNAL_AUTH is used at different locations in my application, for 
>> example I use it to decide whether or not
>> I display the "change password" link.
>>
>> When I start testing, toggling EXTERNAL_AUTH, the behavior is fuzzy. It 
>> inconsitently redirect me to the accounts/login
>> even if I'm authenticated through apache. I guess the middleware isn't 
>> called but when I raise an error, the debug page
>> contradicts this.
>>
>> I'm a bit lost. Do you have any hint?
>>
>> Regards,
>>
>>
>>
>>

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Help login() session always expire on new migrated apache server

2017-11-27 Thread dk . dannykurniawan
Hello,

I used django login() in some code and it worked now in current server.

Odd enough that in new server (migrated), the login session gone when i check 
with @login_required. Keep asking to login.

The server have the same apache config with old server. Please help. Thank you

-- 
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 to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e5705107-a3d9-4348-8915-e555d4219e70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >