Re: Script for running Daphne and runworker in the background . runworker ends after session expires.

2019-03-23 Thread Adam Zedan
Thanks Aldian , what about runworker ?

On Sat, Mar 23, 2019 at 8:36 PM Aldian Fazrihady  wrote:

> Hi,
> Mine is like this. It is still running after exiting ssh:
>
> nohup daphne -v 2 -b $AFCOM_DAPHNE_HOST -p $AFCOM_DAPHNE_PORT 
> afcom.asgi:application > $AFCOM_PROJECT_PATH/daphne/afcom.log 2>&1 &
>
>
> On Sun, Mar 24, 2019 at 10:52 AM Adam Zedan  wrote:
>
>> I am trying to create a bash script that would run Daphne and runworker
>> in the background.
>> This is what I came up with so far
>>
>>
>> echo "Killing Redis."
>> killall redis-server
>>
>>
>> #echo "Starting redis Server."
>> redis-server --daemonize yes
>>
>>
>> echo "Stopping NGINX.."
>> sudo /etc/init.d/nginx stop
>>
>>
>> echo "Starting NGINX.."
>> sudo /etc/init.d/nginx start
>>
>>
>> echo "Killing Daphne.."
>> sudo kill -9 $(ps aux | grep 'daphne' | awk '{print $2}')
>>
>>
>> echo "Starting Daphne."
>> /home/ec2-user/MyDomainVenv/bin/daphne -b 0.0.0.0 -p 8001 
>> main.asgi:channel_layer
>> 2>> ./daphne.log &
>>
>>
>> echo "Starting Django worker thread"
>> #nohup python ./manage.py runworker 2>>./daphneWorker.log >&2 &
>> python ./manage.py runworker
>>
>>
>> However it seems like run worker simply terminates when my ssh session
>> expires. I tried nohup statement as well.
>> How did you fix this problem ?
>>
>> --
>> 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/b2a43f85-9b9a-48bf-918d-c70a70b1b80b%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b2a43f85-9b9a-48bf-918d-c70a70b1b80b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/chqoK7I_v4A/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAN7EoAaXtyij5N1TgL7xL6-sghwvMXUDn7ab12%2Bc4rPxTP6rHA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAN7EoAaXtyij5N1TgL7xL6-sghwvMXUDn7ab12%2Bc4rPxTP6rHA%40mail.gmail.com?utm_medium=email_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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACbvB%2B%2BepGFhiCRTGenLjhXKD9toFNpUur3qyqcRDv_p%3DNPwuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script for running Daphne and runworker in the background . runworker ends after session expires.

2019-03-23 Thread Adam Zedan
Seems like Daphne and runworker both terminate after session expires

On Saturday, March 23, 2019 at 7:51:26 PM UTC-7, Adam Zedan wrote:
>
> I am trying to create a bash script that would run Daphne and runworker in 
> the background.
> This is what I came up with so far
>
>
> echo "Killing Redis."
> killall redis-server
>
>
> #echo "Starting redis Server."
> redis-server --daemonize yes
>
>
> echo "Stopping NGINX.."
> sudo /etc/init.d/nginx stop
>
>
> echo "Starting NGINX.."
> sudo /etc/init.d/nginx start
>
>
> echo "Killing Daphne.."
> sudo kill -9 $(ps aux | grep 'daphne' | awk '{print $2}')
>
>
> echo "Starting Daphne."
> /home/ec2-user/MyDomainVenv/bin/daphne -b 0.0.0.0 -p 8001 
> main.asgi:channel_layer 
> 2>> ./daphne.log &
>
>
> echo "Starting Django worker thread"
> #nohup python ./manage.py runworker 2>>./daphneWorker.log >&2 &
> python ./manage.py runworker
>
>
> However it seems like run worker simply terminates when my ssh session 
> expires. I tried nohup statement as well.
> How did you fix this problem ?
>
>

-- 
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/c45cc88e-cbbf-4474-87d4-37910719e366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Script for running Daphne and runworker in the background . runworker ends after session expires.

2019-03-23 Thread Adam Zedan
I am trying to create a bash script that would run Daphne and runworker in 
the background.
This is what I came up with so far


echo "Killing Redis."
killall redis-server


#echo "Starting redis Server."
redis-server --daemonize yes


echo "Stopping NGINX.."
sudo /etc/init.d/nginx stop


echo "Starting NGINX.."
sudo /etc/init.d/nginx start


echo "Killing Daphne.."
sudo kill -9 $(ps aux | grep 'daphne' | awk '{print $2}')


echo "Starting Daphne."
/home/ec2-user/MyDomainVenv/bin/daphne -b 0.0.0.0 -p 8001 
main.asgi:channel_layer 
2>> ./daphne.log &


echo "Starting Django worker thread"
#nohup python ./manage.py runworker 2>>./daphneWorker.log >&2 &
python ./manage.py runworker


However it seems like run worker simply terminates when my ssh session 
expires. I tried nohup statement as well.
How did you fix this problem ?

-- 
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/b2a43f85-9b9a-48bf-918d-c70a70b1b80b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dispatching requests from one uwsgi to another uwsgi instance running Django Channels

2019-03-23 Thread Adam Zedan
YES it worked. I used Daphne with nginx and it worked. Thank you.


On Friday, March 22, 2019 at 5:58:20 PM UTC-7, Adam Zedan wrote:
>
> I am currently using Django channels for websocket communication. I read 
> this 
> <https://django-websocket-redis.readthedocs.io/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi>
>  article 
> and it states that I should split the project into two uwsgi instances. It 
> states that
>
> "The web server undertakes the task of dispatching normal requests to one 
>> uWSGI instance and WebSocket requests to another one"
>
>
> Now I have two uwsgi instances running. This is how I am running both.
>
> This uwsgi handles the normal django site requests
> uwsgi --virtualenv /home/ec2-user/MyProjVenv --socket /home/ec2-user/
> MyProjVenv/MyProjWeb/site1.socket --chmod-socket=777 --buffer-size=32768 
> --workers=5 --master --module main.wsgi
>
>
> This uwsgi handles the websocket requests
> uwsgi --virtualenv /home/ec2-user/MyProjVenv --http-socket /home/ec2-user/
> MyProjVenv/MyProjWeb/web.socket --gevent 1000 --http-websockets --workers=
> 2 --master --chmod-socket=777  --module main.wsgi_websocket
>
> Now the websocket uwsgi launches  main.wsgi_websocket
>
> The code for main.wsgi_websocket one is this
> import os
> import gevent.socket
> import redis.connection
> redis.connection.socket = gevent.socket
> os.environ.update(DJANGO_SETTINGS_MODULE='main.settings')
> from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
> application = uWSGIWebsocketServer()
>
> Now after spinning up the two uwsgi instances I am able to access the 
> website.The websocket uwsgi instance is also receiving data however I am 
> not sure if its passing that data to the website uwsgi instance. I am using 
> Django Channels here and this is the configuration I have specified in my 
> settings for Django Channels
>
> CHANNEL_LAYERS = {
> "default": {
> "BACKEND": "asgi_redis.RedisChannelLayer",
> "CONFIG": {
> "hosts": [(redis_host, 6379)],
> },
>"ROUTING": "main.routing.channel_routing", 
> },
> }
>
> The channel routing is this
> channel_routing = [
> include("chat.routing.websocket_routing", path=r"^/chat/stream"),
> include("chat.routing.custom_routing"),
> ]
>
> and this is the websocket_routing which i have mentioned above
>
>
>
> websocket_routing = [
> route("websocket.connect", ws_connect),
>
>
> # Called when WebSockets get sent a data frame
> route("websocket.receive", ws_receive),
>
>
> # Called when WebSockets disconnect
> route("websocket.disconnect", ws_disconnect),
> ]
>
> Now the problem is that my ws_receive is never called. If I test on my 
> local dev machine using  "*ipaddress:8000/chat/stream*" this works 
> perfectly fine however I have no clue why my receive is not being called 
> when I use *ipadress:80/ws/ *. I am certain that my other uwsgi instance 
> is getting that data but I dont know how to find out if its passing it to 
> the other uwsgi instance of the djnago side and if it is then why is my 
> receive not being called ?. Any suggestions on this would definitely 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4096133-d010-4b96-a403-985fb1b3a104%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dispatching requests from one uwsgi to another uwsgi instance running Django Channels

2019-03-23 Thread Adam Zedan
Hi Ahmed I am a little confused here. I was using NGINX and uwsgi.  Now 
based on your response i decided to use Daphne.. So Now I have NGINX with 
Daphne. I am not sure where gunicorn fits in here . I am following this 
<http://masnun.rocks/2016/09/25/introduction-to-django-channels/> tutorial. 
Essentially now I am getting a 502 Bad gateway when accessing my website.

This is the nginx configuration I have

server {
# the port your site will be served on
listen  80;
server_name .MyDomain.com;
charset utf-8;


# max upload size
client_max_body_size 75M;   # adjust to taste


# Django media
location /media  {
# your Django project's media files - amend as required
alias /home/ec2-user/MyDomainVenv/MyDomainWeb/media;
}


location /static {
# your Django project's static files - amend as required
alias /home/ec2-user/MyDomainVenv/MyDomainWeb/static;
}




location / {
proxy_pass http://0.0.0.0:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";


proxy_redirect off;
proxy_set_header   Host $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header   X-Forwarded-Host $server_name;
}
}

any suggestions on what might be going wrong ? I tried accessing my website 
and this is what i got

==> /var/log/nginx/error.log <==
2019/03/23 07:13:21 [error] 22191#0: *4 connect() failed (111: Connection 
refused) while connecting to upstream, client: 71.231.182.18, server: 
MyDomain.com, request: "GET /admin/ HTTP/1.1", upstream: 
"http://0.0.0.0:8001/admin/;, host: "www.MyDomain.com"


==> /var/log/nginx/access.log <==
71.231.182.18 - - [23/Mar/2019:07:13:21 +] "GET /admin/ HTTP/1.1" 502 
575 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36" "-"





On Friday, March 22, 2019 at 10:31:08 PM UTC-7, Ahmed Ishtiaque wrote:
>
> Aldian has pointed it out already, but I also use Nginx + gunicorn + 
> daphne for my production server. Nginx decides when to upgrade a request to 
> wss:// and passes it on to my daphne instance to handle automatically. 
> Would be happy to share my config for that if you want.
>
> Best,
> Ahmed
>
> On Fri, Mar 22, 2019 at 10:15 PM Aldian Fazrihady  > wrote:
>
>> Does it really use Django channels?  I am using Django channels and 
>> following its suggested package:  ASGI provided by Daphne
>>
>> Regards, 
>>
>> Aldian Fazrihady
>>
>> On Sat, 23 Mar 2019, 07:58 Adam Zedan, > 
>> wrote:
>>
>>> I am currently using Django channels for websocket communication. I read 
>>> this 
>>> <https://django-websocket-redis.readthedocs.io/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi>
>>>  article 
>>> and it states that I should split the project into two uwsgi instances. It 
>>> states that
>>>
>>> "The web server undertakes the task of dispatching normal requests to 
>>>> one uWSGI instance and WebSocket requests to another one"
>>>
>>>
>>> Now I have two uwsgi instances running. This is how I am running both.
>>>
>>> This uwsgi handles the normal django site requests
>>> uwsgi --virtualenv /home/ec2-user/MyProjVenv --socket /home/ec2-user/
>>> MyProjVenv/MyProjWeb/site1.socket --chmod-socket=777 --buffer-size=32768 
>>> --workers=5 --master --module main.wsgi
>>>
>>>
>>> This uwsgi handles the websocket requests
>>> uwsgi --virtualenv /home/ec2-user/MyProjVenv --http-socket /home/ec2-
>>> user/MyProjVenv/MyProjWeb/web.socket --gevent 1000 --http-websockets --
>>> workers=2 --master --chmod-socket=777  --module main.wsgi_websocket
>>>
>>> Now the websocket uwsgi launches  main.wsgi_websocket
>>>
>>> The code for main.wsgi_websocket one is this
>>> import os
>>> import gevent.socket
>>> import redis.connection
>>> redis.connection.socket = gevent.socket
>>> os.environ.update(DJANGO_SETTINGS_MODULE='main.settings')
>>> from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
>>> application = uWSGIWebsocketServer()
>>>
>>> Now after spinning up the two uwsgi instances I am able to access the 
>>> website.The websocket uwsgi instance is also receiving data however I am 
>>> not sure if its passing that data to the websi

Dispatching requests from one uwsgi to another uwsgi instance running Django Channels

2019-03-22 Thread Adam Zedan
I am currently using Django channels for websocket communication. I read 
this 

 article 
and it states that I should split the project into two uwsgi instances. It 
states that

"The web server undertakes the task of dispatching normal requests to one 
> uWSGI instance and WebSocket requests to another one"


Now I have two uwsgi instances running. This is how I am running both.

This uwsgi handles the normal django site requests
uwsgi --virtualenv /home/ec2-user/MyProjVenv --socket /home/ec2-user/
MyProjVenv/MyProjWeb/site1.socket --chmod-socket=777 --buffer-size=32768 --
workers=5 --master --module main.wsgi


This uwsgi handles the websocket requests
uwsgi --virtualenv /home/ec2-user/MyProjVenv --http-socket /home/ec2-user/
MyProjVenv/MyProjWeb/web.socket --gevent 1000 --http-websockets --workers=2 
--master --chmod-socket=777  --module main.wsgi_websocket

Now the websocket uwsgi launches  main.wsgi_websocket

The code for main.wsgi_websocket one is this
import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='main.settings')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()

Now after spinning up the two uwsgi instances I am able to access the 
website.The websocket uwsgi instance is also receiving data however I am 
not sure if its passing that data to the website uwsgi instance. I am using 
Django Channels here and this is the configuration I have specified in my 
settings for Django Channels

CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [(redis_host, 6379)],
},
   "ROUTING": "main.routing.channel_routing", 
},
}

The channel routing is this
channel_routing = [
include("chat.routing.websocket_routing", path=r"^/chat/stream"),
include("chat.routing.custom_routing"),
]

and this is the websocket_routing which i have mentioned above



websocket_routing = [
route("websocket.connect", ws_connect),


# Called when WebSockets get sent a data frame
route("websocket.receive", ws_receive),


# Called when WebSockets disconnect
route("websocket.disconnect", ws_disconnect),
]

Now the problem is that my ws_receive is never called. If I test on my 
local dev machine using  "*ipaddress:8000/chat/stream*" this works 
perfectly fine however I have no clue why my receive is not being called 
when I use *ipadress:80/ws/ *. I am certain that my other uwsgi instance is 
getting that data but I dont know how to find out if its passing it to the 
other uwsgi instance of the djnago side and if it is then why is my receive 
not being called ?. Any suggestions on this would definitely 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4c4e57fa-c603-4be0-ba1a-cf1e9919fc09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Template html works when double clicked but empty when accessed through server

2011-08-17 Thread Adam Zedan
Are ou saying that the reason i get nothing when running through a url is
that because of security reasons (i.e) loading data from local machine ?? if
so could you tell me how i could solve that problem ??

On Tue, Aug 16, 2011 at 4:43 PM, Konstantin Sushenko wrote:

> you do not see anything because the style on your root element is set
> to "display:none" and the browser does not run scripts because they
> are loaded from local URLs. as it says: it is a insecure to execute
> scripts from local URLs. suppose you publish this page on your
> production server, where would your visitors get there scripts? they
> are not on their machines in "d:/django-1.3...". basically, it is
> unclear to me what you are trying to achieve.
>
> konstantin
>
> --
> 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.
>
>

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
So what do u suggest ?? will that also solve the firefox security
issue.
currenty i am just using the following html code





Demo







On Aug 16, 11:58 am, Adam Zedan <zedan...@gmail.com> wrote:
> Thanks.. that what i just came across.
> It seems firefox doesnt let u load static 
> fileshttp://rubenlaguna.com/wp/2007/04/20/firefox-and-file-windows-unc-paths/
>
> On Tue, Aug 16, 2011 at 11:43 AM, Jani Tiainen <rede...@gmail.com> wrote:
> > Hi,
>
> > You can't (and you shouldn't) use file urls in your original source but
> > should let the Django handle urls to them for you.
>
> > There is dedicated part about static file serving in documentation [1][2].
>
> > And if you really think that you're deploying your project to somewhere you
> > really expect everyone to have same directory structure on their machines as
> > you do? And even more, you think people really would appreciate browser to
> > load arbitrary files from a filesystem? :)
>
> > [1]https://docs.djangoproject.**com/en/1.3/howto/static-files/<https://docs.djangoproject.com/en/1.3/howto/static-files/>
> > [2]https://docs.djangoproject.**com/en/1.3/ref/contrib/**staticfiles/<https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/>
>
> > --
>
> > Jani Tiainen
>
> > On 08/16/2011 09:23 AM, Adam Zedan wrote:
>
> >> okay going to error ansole of firefox here is what i got
>
> >> Error: Slick is not defined
> >> Source File:http://127.0.0.1:8000/db/
> >> Line: 37
>
> >> which is : grid = new Slick.Grid("#myGrid", data, columns, options);
>
> >> and the warnings are
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.grid.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.core.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery.**
> >> event.drag-2.0.min.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery-1.4.**
> >> 3.min.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.grid.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.core.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery.**
> >> event.drag-2.0.min.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery-1.4.**
> >> 3.min.js.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/examples/**
> >> examples.css.
> >> Security Error: Content athttp://127.0.0.1:8000/db/may not load or
> >> link to file:///D:/Django-1.3/django/**bin/SlickGrid/css/smoothness/**
> >> jquery-ui-1.8.5.custom.css.
>
> >> I think it cant link to those files when rendered or something... not
> >> sure though ?? what do u guys think??
>
> >> On Aug 16, 11:01 am, Landy 
> >> Chapman<landy.chapm...@gmail.**com<landy.chapm...@gmail.com>>
> >>  wrote:
>
> >>>  From what I can tell it's not your fault. have a look at:
> >>>  http://code.google.com/p/**slickgrid/issues/detail?id=19<http://code.google.com/p/slickgrid/issues/detail?id=19>
>
> >>> fix might be here
> >>>    
> >>> http://drupal.org/node/**1094054#comment-4825024<http://drupal.org/node/1094054#comment-4825024>
>
> > --
> > 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+unsubscribe@**
> > googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> > For more options, visit this group athttp://groups.google.com/**
> > group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> > .
>
>

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
Thanks.. that what i just came across.
It seems firefox doesnt let u load static files
http://rubenlaguna.com/wp/2007/04/20/firefox-and-file-windows-unc-paths/


On Tue, Aug 16, 2011 at 11:43 AM, Jani Tiainen <rede...@gmail.com> wrote:

> Hi,
>
> You can't (and you shouldn't) use file urls in your original source but
> should let the Django handle urls to them for you.
>
> There is dedicated part about static file serving in documentation [1][2].
>
> And if you really think that you're deploying your project to somewhere you
> really expect everyone to have same directory structure on their machines as
> you do? And even more, you think people really would appreciate browser to
> load arbitrary files from a filesystem? :)
>
>
> [1] 
> https://docs.djangoproject.**com/en/1.3/howto/static-files/<https://docs.djangoproject.com/en/1.3/howto/static-files/>
> [2] 
> https://docs.djangoproject.**com/en/1.3/ref/contrib/**staticfiles/<https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/>
>
> --
>
> Jani Tiainen
>
>
> On 08/16/2011 09:23 AM, Adam Zedan wrote:
>
>> okay going to error ansole of firefox here is what i got
>>
>> Error: Slick is not defined
>> Source File: http://127.0.0.1:8000/db/
>> Line: 37
>>
>> which is : grid = new Slick.Grid("#myGrid", data, columns, options);
>>
>> and the warnings are
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.grid.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.core.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery.**
>> event.drag-2.0.min.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery-1.4.**
>> 3.min.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.grid.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/slick.core.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery.**
>> event.drag-2.0.min.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/lib/jquery-1.4.**
>> 3.min.js.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/examples/**
>> examples.css.
>> Security Error: Content at http://127.0.0.1:8000/db/ may not load or
>> link to file:///D:/Django-1.3/django/**bin/SlickGrid/css/smoothness/**
>> jquery-ui-1.8.5.custom.css.
>>
>> I think it cant link to those files when rendered or something... not
>> sure though ?? what do u guys think??
>>
>> On Aug 16, 11:01 am, Landy 
>> Chapman<landy.chapm...@gmail.**com<landy.chapm...@gmail.com>>
>>  wrote:
>>
>>>  From what I can tell it's not your fault. have a look at:
>>>  
>>> http://code.google.com/p/**slickgrid/issues/detail?id=19<http://code.google.com/p/slickgrid/issues/detail?id=19>
>>>
>>> fix might be here
>>>
>>> http://drupal.org/node/**1094054#comment-4825024<http://drupal.org/node/1094054#comment-4825024>
>>>
>>
>>
> --
> 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+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> .
>
>

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Adam Zedan
okay going to error ansole of firefox here is what i got

Error: Slick is not defined
Source File: http://127.0.0.1:8000/db/
Line: 37

which is : grid = new Slick.Grid("#myGrid", data, columns, options);

and the warnings are
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/slick.grid.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/slick.core.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to 
file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery.event.drag-2.0.min.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery-1.4.3.min.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/slick.grid.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/slick.core.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to 
file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery.event.drag-2.0.min.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery-1.4.3.min.js.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to file:///D:/Django-1.3/django/bin/SlickGrid/examples/examples.css.
Security Error: Content at http://127.0.0.1:8000/db/ may not load or
link to 
file:///D:/Django-1.3/django/bin/SlickGrid/css/smoothness/jquery-ui-1.8.5.custom.css.

I think it cant link to those files when rendered or something... not
sure though ?? what do u guys think??

On Aug 16, 11:01 am, Landy Chapman  wrote:
> From what I can tell it's not your fault. have a look at:
>  http://code.google.com/p/slickgrid/issues/detail?id=19
>
> fix might be here
>    http://drupal.org/node/1094054#comment-4825024

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-15 Thread Adam Zedan
Yes the title changes but my table does not appear. It only appear if i
double click it ... :(


On Tue, Aug 16, 2011 at 7:46 AM, Landy Chapman wrote:

> When you get a blank page Does the title change?
> Is debug mode on/off?
> Is there an error message?
>
>
> You could add this:
> 
>My html IS being displayed
>
> --
> 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.
>
>

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-15 Thread Adam Zedan
 the url you're using when you get a blank page?
 http://127.0.0.1:8000/db/

 urls.py
 url('^db/$', dbdemo),


 views.py
 def dbdemo(request):
 list= Student_Info.objects.all()
 #field=Student_Info._meta.get_all_field_names()
 return render_to_response("db.html",{'content':list})

On Aug 16, 7:39 am, Landy Chapman  wrote:
> On Aug 15, 9:11 pm, Konstantin Sushenko  wrote:
>
> > what is the source code for the blank page?
>
> beat me to the punch...  can you paste
>    the url you're using when you get a blank page
>    urls.py
>    views.py
>
> thanks

-- 
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: Template html works when double clicked but empty when accessed through server

2011-08-15 Thread Adam Zedan
Its at the top most post..
have a look at 
http://groups.google.com/group/django-users/browse_thread/thread/8a509a916ae0023?hl=en


On Aug 16, 6:11 am, Konstantin Sushenko <ako...@gmail.com> wrote:
> what is the source code for the blank page?
>
> On Aug 15, 8:50 pm, Adam Zedan <zedan...@gmail.com> wrote:
>
> > Hi my html works properly when i double click it.
>
> > The code is
>
> > 
> > 
> >     
> >         
> >         Demo
> >          > href="file:///D:/Django-1.3/django/bin/SlickGrid/slick.grid.css"
> > type="text/css" media="screen" charset="utf-8" />
> >          > href="file:///D:/Django-1.3/django/bin/SlickGrid/css/smoothness/jquery-ui-1.8.5.custom.css"
> > type="text/css" media="screen" charset="utf-8" />
> >          > href="file:///D:/Django-1.3/django/bin/SlickGrid/examples/examples.css"
> > type="text/css" media="screen" charset="utf-8" />
>
> >          > src="<a  rel="nofollow" href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot</a>;>
> >          > src="file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery-1.4.3.min.js">
> >          > src="file:///D:/Django-1.3/django/bin/SlickGrid/lib/jquery.event.drag-2.0.min.js">
>
> >          > src="file:///D:/Django-1.3/django/bin/SlickGrid/slick.core.js">
> >          > src="file:///D:/Django-1.3/django/bin/SlickGrid/slick.grid.js">
>
> >         
> >         var grid;
> >         var columns = [
> >             {id:"title", name:"Title", field:"title"},
> >             {id:"duration", name:"Duration", field:"duration"},
> >             {id:"%", name:"% Complete", field:"percentComplete"},
> >             {id:"start", name:"Start", field:"start"},
> >             {id:"finish", name:"Finish", field:"finish"},
> >             {id:"effort-driven", name:"Effort Driven", field:"effortDriven"}
> >         ];
>
> >         var options = {
> >             enableCellNavigation: true,
> >             enableColumnReorder: false
> >         };
>
> >         $(function() {
> >             var data = [];
> >             for (var i = 0; i < 500; i++) {
> >                 data[i] = {
> >                     title: "Task " + i,
> >                     duration: "5 days",
> >                     percentComplete: Math.round(Math.random() * 100),
> >                     start: "01/01/2009",
> >                     finish: "01/05/2009",
> >                     effortDriven: (i % 5 == 0)
> >                 };
> >             }
>
> >             grid = new Slick.Grid("#myGrid", data, columns, options);
>
> >             $("#myGrid").show();
> >         })
>
> >         
>
> >     
>
> >     
>
> >          
> >         
> >             
> >                  > style="width:600px;height:500px;display:none;">
> >             
> >         
> >         
>
> >     
> > 
>
> > however when i run it the proper way i.e run the server "manage.py
> > runserver" and enter the url i just get a blank screen ?? Does anyone know
> > why this happens??
>
>

-- 
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: For loop problem in template..Is this correct

2011-08-15 Thread Adam Zedan
I dont think we could even use "[]" as in
  roll_no: {{content[0].roll_no}},
am i correct  ?? couldnt find any reference to it on
https://docs.djangoproject.com/en/dev/topics/templates/


On Tue, Aug 16, 2011 at 5:07 AM, Landy Chapman <landy.chapm...@gmail.com>wrote:

> @Konstantin Sushenko   nice catch!
> >> as a result of this you will have a series of 'data[i] = ...'
> >>assignments in your output. where 'i' would be undefined.
>
> So could he use this:   JS isn't my thing, and this is approaching
> too_clever
> > $(function() {
>   i = 0;
> > var data = [];
> > {% for x in content %}
> > data[i] =
> > {
> > roll_no: {{x.roll_no}},
> > cell_no: {{x.cell_no}},
> > nationality:{{x.nationality}},
> > e_mail:{{x.e_mail}}
> > };
> i +=1;
> > {% endfor %}
> > grid = new Slick.Grid("#myGrid", data, columns, options);
> > $("#myGrid").show();
> > })
> >
> > and the error i get is
> >
> > Exception Type: TemplateSyntaxError
> > Exception Value: Could not parse the remainder: '(len(content))' from
> > 'range(len(content))'
> >
> > Template error
> >
> > In template d:\django-1.3\django\bin\onlinedemo\dbdemo\templates\db.html,
> > error at line 34
> > Could not parse the remainder: '(len(content))' from
> 'range(len(content))'
> >
> > --
> >
> > On Tue, Aug 16, 2011 at 4:50 AM, Konstantin Sushenko <ako...@gmail.com
> >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > hello,
> >
> > > as a result of this you will have a series of 'data[i] = ...'
> > > assignments in your output. where 'i' would be undefined.
> >
> > > konstantin
> >
> > > On Aug 15, 7:45 pm, Adam Zedan <zedan...@gmail.com> wrote:
> > > > Hi i am getting a problem with my for loop which i used in my
> > > template.Could
> > > > you kindly let me know what is going wrong in here.
> > > > The for loop is in a jquery function
> >
> > > > $(function() {
> > > > var data = [];
> >
> > > >{% for x in range(len(content)) %}
> > > > data[i] =
> > > > {
> > > > roll_no: {{content[x].roll_no}},
> > > > cell_no: {{content[x].cell_no}},
> > > > nationality:{{content[x].nationality}},
> > > > e_mail:{{content[x].e_mail}}
> >
> > > > };
> > > > {% endfor %}
> >
> > > > grid = new Slick.Grid("#myGrid", data, columns, options);
> >
> > > > $("#myGrid").show();
> > > > })
> >
> > > --
> > > 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.
>
> --
> 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.
>
>

-- 
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: For loop problem in template..Is this correct

2011-08-15 Thread Adam Zedan
okay so i temporarily removed the loop just to see if the template works

$(function() {
var data = [];

data[0] =
{
roll_no: {{content[0].roll_no}},
cell_no: {{content[0].cell_no}},
nationality:{{content[0].nationality}},
e_mail:{{content[0].e_mail}}
};
grid = new Slick.Grid("#myGrid", data, columns, options);
$("#myGrid").show();
})


The final return in the view which calls the above templates is
return render_to_response("db.html",{'content':list})

and now i am getting the exception
Exception Value:
Could not parse the remainder: '[0].roll_no' from 'content[0].roll_no'

any ideas???

On Tue, Aug 16, 2011 at 4:58 AM, Landy Chapman <landy.chapm...@gmail.com>wrote:

>
>
> On Aug 15, 11:45 pm, Adam Zedan <zedan...@gmail.com> wrote:
> > Hi i am getting a problem with my for loop which i used in my
> template.Could
> > you kindly let me know what is going wrong in here.
> > The for loop is in a jquery function
>
> I think this:
> >{% for x in range(len(content)) %}
>
> .. is not allowed --no python in django templates.
>
> Do you have a sample (2 or 3 elements) showing how content is defined?
> If content came from a query, this should work:
>
> >{% for x in content %}
> > data[i] =
> > {
> > roll_no: {{x.roll_no}},
> > cell_no: {{x.cell_no}},
> > nationality:{{x.nationality}},
> > e_mail:{{x.e_mail}}
> > };
> > {% endfor %}
>
> --
> 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.
>
>

-- 
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: For loop problem in template..Is this correct

2011-08-15 Thread Adam Zedan
Ooops.. sorry for the i:

The code is
$(function() {
var data = [];
{% for x in range(len(content)) %}
data[x] =
{
roll_no: {{content[x].roll_no}},
cell_no: {{content[x].cell_no}},
nationality:{{content[x].nationality}},
e_mail:{{content[x].e_mail}}

};
{% endfor %}
grid = new Slick.Grid("#myGrid", data, columns, options);
$("#myGrid").show();
})

and the error i get is

Exception Type: TemplateSyntaxError
Exception Value: Could not parse the remainder: '(len(content))' from
'range(len(content))'


Template error

In template d:\django-1.3\django\bin\onlinedemo\dbdemo\templates\db.html,
error at line 34
Could not parse the remainder: '(len(content))' from 'range(len(content))'

--


On Tue, Aug 16, 2011 at 4:50 AM, Konstantin Sushenko <ako...@gmail.com>wrote:

> hello,
>
> as a result of this you will have a series of 'data[i] = ...'
> assignments in your output. where 'i' would be undefined.
>
> konstantin
>
> On Aug 15, 7:45 pm, Adam Zedan <zedan...@gmail.com> wrote:
> > Hi i am getting a problem with my for loop which i used in my
> template.Could
> > you kindly let me know what is going wrong in here.
> > The for loop is in a jquery function
> >
> > $(function() {
> > var data = [];
> >
> >{% for x in range(len(content)) %}
> > data[i] =
> > {
> > roll_no: {{content[x].roll_no}},
> > cell_no: {{content[x].cell_no}},
> > nationality:{{content[x].nationality}},
> > e_mail:{{content[x].e_mail}}
> >
> > };
> > {% endfor %}
> >
> > grid = new Slick.Grid("#myGrid", data, columns, options);
> >
> > $("#myGrid").show();
> > })
>
> --
> 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.
>
>

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



For loop problem in template..Is this correct

2011-08-15 Thread Adam Zedan
Hi i am getting a problem with my for loop which i used in my template.Could
you kindly let me know what is going wrong in here.
The for loop is in a jquery function

$(function() {
var data = [];

   {% for x in range(len(content)) %}
data[i] =
{
roll_no: {{content[x].roll_no}},
cell_no: {{content[x].cell_no}},
nationality:{{content[x].nationality}},
e_mail:{{content[x].e_mail}}

};
{% endfor %}


grid = new Slick.Grid("#myGrid", data, columns, options);

$("#myGrid").show();
})

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



using djblets data grid.. simple question

2011-08-14 Thread Adam Zedan
I am trying to construct a simplest example to see the djblets data grid in
action

suppose everything is in my view.py

views.py
-
class UserDataGrid(DataGrid):
username = Column("Country Name", sortable=True)
first_name = Column("Population", sortable=True)
last_name = Column("Timezone", sortable=True)

and the main function that gets called is

def test(request):
 countries = [ {'name': 'Australia', 'population': 21, 'tz': 'UTC +10',
'visits': 1},
   {'name': 'Germany', 'population': 81, 'tz': 'UTC +1',
'visits': 2},
   {'name': 'Mexico', 'population': 107, 'tz': 'UTC -6',
'visits': 0},]

 //How can i incorporate the dictionary object to the datagrid??
 return render_to_response('test.html', {'table': countries})


test.html
-
How can i display the contents of dictionary in the djblets datagrid ??


My question is how can i display the dictionary object in the dblets
datagrid??

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



data modeling in Django

2011-08-11 Thread Adam Zedan
hi coming from a background dealing with Relational database, i am q bit
unfamiliar to the concepts of data modelling such as one to one,one to many
etc.When to use them why to use them and the drawbacks of not using
them.Could anyone please suggest a good resource(books,websites..) on
quickly getting started with this thanks..

-- 
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: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Adam Zedan
Or in other words  a good datagrid to use with Djano...What do u
people suggest or use??

On Aug 11, 1:52 am, Adam Zedan <zedan...@gmail.com> wrote:
> Hi i wanted to know what do most people here do when they need to show
> results in a template which just needs to be displayed in Table.
> For example displaying data from a db etc in a template. I did try an app
> called django_tables2 but it just seems really simple with respect to
> presentation.
> I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
> if someone has already tried that please do let me know ?? What do people do
> in case they need to display data,allow rearrangement of data etc.Are there
> any other apps...looking forward to hearing from you folks

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



Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Adam Zedan
Hi i wanted to know what do most people here do when they need to show
results in a template which just needs to be displayed in Table.
For example displaying data from a db etc in a template. I did try an app
called django_tables2 but it just seems really simple with respect to
presentation.
I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
if someone has already tried that please do let me know ?? What do people do
in case they need to display data,allow rearrangement of data etc.Are there
any other apps...looking forward to hearing from you folks

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



Question about imports..Python Dejango and Models

2011-08-05 Thread Adam Zedan
Hi while going through the Django Book I ran into the following code
Being fairly new to Python the code kind of confused me

from django.db import models --->lineA
class Publisher(models.Model):  --->line B

Consider line A
 from django.db import models
This means that in the django directory therewill be a subdirectory of
db from in which either you'll find a file called models.py or a
directory called models??Rite?? so there is a directory called
models..great Let me know if what i said was correct.

Moving on to Line B
class Publisher(models.Model):
i am more interested in the models.Model.
does that mean in the models folder youll find a Model.py ??  I cant
seem to find Model.py then?? could anyone please clear this
concept..why cant i find this file ?? I would like to take a look at
the base class models.Model.
I have checked a couple of sites on python tutorial and they dont
cover imports in that much detail

-- 
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: Error "Cant import.." during manage.py syncdb

2011-08-04 Thread Adam Zedan
Problem Solved...just needed to register environmental variables

On Aug 5, 2:58 am, Adam Zedan <hayya...@gmail.com> wrote:
> Hi i am having problem importing a module
> in my settings.py located in "D:\Django-1.3\django\bin\cms"
> I added
> INSTALLED_APPS = (
> .
> .
>         'coltrane',
> )
>
> The folder coltrane is next to the cms folder.
> Anyways when i go like as shown in cmd I get
>
> D:\Django-1.3\django\bin\cms>manage.py syncdb
> Error: No module named coltrane
>
> Could you tell me how i could get it to recognize coltrane.
> The book i am following says
>
> "Because it’s directly on the Python path, just adding coltrane will
> work. "
> What does that mean ??Will i have to configure some environmental
> variable here.. BTW i am using WindowsXP

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



Error "Cant import.." during manage.py syncdb

2011-08-04 Thread Adam Zedan
Hi i am having problem importing a module
in my settings.py located in "D:\Django-1.3\django\bin\cms"
I added
INSTALLED_APPS = (
.
.
'coltrane',
)

The folder coltrane is next to the cms folder.
Anyways when i go like as shown in cmd I get

D:\Django-1.3\django\bin\cms>manage.py syncdb
Error: No module named coltrane

Could you tell me how i could get it to recognize coltrane.
The book i am following says

"Because it’s directly on the Python path, just adding coltrane will
work. "
What does that mean ??Will i have to configure some environmental
variable here.. BTW i am using WindowsXP

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