Re: Converting Django app into a Desktop app

2013-03-06 Thread Loai Ghoraba
ython Desktop that embeds Internet Explorer browser > and > Mongoose web server: > https://code.google.com/p/phpdesktop/wiki/EmbeddingOtherScriptingLanguages > > I am the author of both projects. > > Cheers, > Czarek. > > > On Tuesday, December 18, 2012 8:06:19

Re: Converting Django app into a Desktop app

2012-12-19 Thread Loai Ghoraba
@all thanks a lot, I will try your suggestions, may be mixing them :) On Tue, Dec 18, 2012 at 11:39 PM, Chris Cogdon wrote: > Personally, I'd prefer something that didn't require packaging up > additional programs (xampp and python, in this example). > > It should be

Re: Converting Django app into a Desktop app

2012-12-18 Thread Loai Ghoraba
he web-server issue, though. There are a ton of choices > there (eg: gunicorn, twisted, tornado, web.py) but I have no opinion on > which one is going to both "freeze" well, serve static files well, and work > well with Django > > > > On Tuesday, December 18, 2012 8:06

Converting Django app into a Desktop app

2012-12-18 Thread Loai Ghoraba
Hi I am very comfortable with Django, and I was wondering about whether there is some way to convert a Django web app into a Desktop app (may be not 100%), so that I can distribute it to users. May be wrapping it in a light web server "if there is something like this". Thanks -- You

Re: Django ajax HTTP 500 when trying to access request.GET

2012-12-10 Thread Loai Ghoraba
the problem is solved now, seems rebooting sometimes works :) ! On Tue, Dec 11, 2012 at 2:04 AM, Loai Ghoraba <loai1...@gmail.com> wrote: > Hi all > > I am trying to write a simple ajax that tries to know whether the username > already exist before registering. > Whe

Django ajax HTTP 500 when trying to access request.GET

2012-12-10 Thread Loai Ghoraba
Hi all I am trying to write a simple ajax that tries to know whether the username already exist before registering. Whenever I try to access the request.GET in my view function, a HTTP 500 error is raised, if the view function doesn't access it and only use hard coded values-for test- it

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
okay I found it: it should be login with quotes. Thanks. On Mon, Dec 3, 2012 at 2:50 PM, Loai Ghoraba <loai1...@gmail.com> wrote: > not working, giving: Reverse for '' with arguments '()' and keyword > arguments '{}' not found. > > also I want to know about this dash (sorry

Re: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
not working, giving: Reverse for '' with arguments '()' and keyword arguments '{}' not found. also I want to know about this dash (sorry for using the term score in the previous post ) thing On Mon, Dec 3, 2012 at 2:34 PM, Nikhil Verma wrote: > {% url auth_login %} --

Template syntax error: Could not parse the remainder: '-login' from 'accounts-login'

2012-12-03 Thread Loai Ghoraba
Hi I have this in my urls.py url(r'^accounts/login/$', login,name="accounts-login") and in a template base.html login And when I try to open the site, this error is raised: Template syntax error: Could not parse the remainder: '-login' from 'accounts-login' But when I change the name of

Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Loai Ghoraba
Thanks a million for the tip :) On Sun, Dec 2, 2012 at 5:08 AM, Chris Cogdon <ch...@cogdon.org> wrote: > > > On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote: >> >> no I mean the root of my project guys :) thanks a lot :D which lives in >> path

Re: Django login twice required when using xsendfile with apache

2012-12-01 Thread Loai Ghoraba
and another issue: using apache, even when the user is logged in and is_staff, he is redirected to the login page, and he needs to login to download the file, and this continues on. On Sat, Dec 1, 2012 at 7:30 PM, Loai Ghoraba <loai1...@gmail.com> wrote: > Hi > > I am using

Django login twice required when using xsendfile with apache

2012-12-01 Thread Loai Ghoraba
Hi I am using apache2 server with xsend file to protect against static files, the python view is: @staff_member_required def media_xsendfile(request, path, document_root): print "is staff",request.user.is_staff response = HttpResponse() response['Content-Disposition'] = 'attachment'

Re: Django apache mod_wsgi permission denied

2012-12-01 Thread Loai Ghoraba
<ch...@cogdon.org> wrote: > >> >> >> On Friday, November 30, 2012 8:53:42 PM UTC-8, Mike Dewhirst wrote: >>> >>> On 1/12/2012 3:48pm, Loai Ghoraba wrote: >>> > I have ran chmod o+rx on the root directory, isn't this enough (isn't >>>

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
okay it works now, I was just missing a trailing slash at Alias /static/ /home/loai/workspace/Faculty/Faculty/static/ On Sat, Dec 1, 2012 at 8:17 AM, Loai Ghoraba <loai1...@gmail.com> wrote: > a strange thing is that when I remove the directive so it > becomes: > > > Ord

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
a strange thing is that when I remove the directive so it becomes: Order deny,allow Allow from all instead of Order deny,allow Allow from all then trying to access any static or media file raises (not found) instead of permission denied ! On Sat, Dec 1, 2012 at 7:42 AM, Loai Ghoraba

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
thanks, but still I can't find what's wrong with the permission thing. The html pages are loaded without static content, no css or js or whatever, neither the media is accessible. On Sat, Dec 1, 2012 at 7:15 AM, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 1/12/2012 3:57pm, Loa

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
wrote: > Make sure all the directories, from static leading all the way up to the > root, are chmod a+x > > > On Friday, November 30, 2012 4:00:55 PM UTC-8, Loai Ghoraba wrote: >> >> Hi >> >> I have installed apache and mod_wsgi and my basic site *skeleton is

Django apache mod_wsgi permission denied

2012-11-30 Thread Loai Ghoraba
Hi I have installed apache and mod_wsgi and my basic site *skeleton is running* on local host, but with NO static files loaded such as css, when I try to access a static file (e.g:http://localhost/static/css/base.css) it says that I don't have permission to access the file, same goes to media

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Loai Ghoraba
I read it and it seems nice, I will further read about the topic Thanks a lot for the help :) On Thu, Nov 29, 2012 at 1:44 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Thu, Nov 29, 2012 at 11:30 AM, Loai Ghoraba <loai1...@gmail.com> wrote: > > I am still new to sre

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Loai Ghoraba
question: Does this applies also to light static files like css and javascript ? Thanks a lot On Thu, Nov 29, 2012 at 1:15 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Wed, Nov 28, 2012 at 6:27 PM, Loai Ghoraba <loai1...@gmail.com> wrote: > > Thanks for the repl

Re: How to make a url pattern that catch any url ?

2012-11-28 Thread Loai Ghoraba
thanks for the important advise :) On Wed, Nov 28, 2012 at 10:28 PM, Tim Chase <django.us...@tim.thechases.com>wrote: > On 11/28/12 14:19, Loai Ghoraba wrote: > > I just go it, it is > > > > url(r'^download/(?P.*)$', 'faculty.views.Main.download_file'), >

Re: How to make a url pattern that catch any url ?

2012-11-28 Thread Loai Ghoraba
I just go it, it is url(r'^download/(?P.*)$', 'faculty.views.Main.download_file'), Thanks :) On Wed, Nov 28, 2012 at 10:10 PM, Loai Ghoraba <loai1...@gmail.com> wrote: > Hi > > I am serving some files, and I want whenever I have a url > :/download/path/to/some/file to

How to make a url pattern that catch any url ?

2012-11-28 Thread Loai Ghoraba
Hi I am serving some files, and I want whenever I have a url :/download/path/to/some/file to map this to a view function with path/to/some/file sent as a parameter of the function, so how could I accomplish that ? I want a url of the following schema : url(r'downloads/(?P\[Anything

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-28 Thread Loai Ghoraba
Thanks for the reply, but I am still new to the web technology world, so I would like to fully use Django now before , moving to another ways to host my files. Actually I am totally new to serving stuff, so if there is some best practice or that my way is totally wrong, please tell me. So in

Where to put PDF files + how to authenticate the urls requesting them

2012-11-28 Thread Loai Ghoraba
Hi I have a little question: First, I am hosting my PDF files within / static directory, (as my understanding is that they are static files), so is this the correct way to host PDF files and downloadable files generally ? Second: Only authenticated users may view the links for those PDF files,

Javascript in external file not working

2012-11-26 Thread Loai Ghoraba
Hi all When I have a script like this: window.onload=function f(){} it is working fine. but when I create an external js file and put it within the static directory, and call the function like this window.onload=f It is not working at all. (by the way the url is mapped correctly to the js

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-21 Thread Loai Ghoraba
,*args,**kwargs) return new_view On Wednesday, November 21, 2012 2:51:49 PM UTC+2, Daniel Roseman wrote: > > On Wednesday, 21 November 2012 12:04:45 UTC, Loai Ghoraba wrote: > >> Well, thanks very much for your effort-y reply. I have read it and it is >> useful, though

Re: login page shouldn't open when I am already logged in, but it does !

2012-11-21 Thread Loai Ghoraba
alculate cookie_session_id(remarkable data_headers, database > information,...) > set cookie_session_id > *add according entry in the foreignkey field, adding it as well > in the sessionid table* > return the_user_main_page > else: > return

login page shouldn't open when I am already logged in, but it does !

2012-11-20 Thread Loai Ghoraba
Hi all I am trying to build a login page using Django auth app, it is all working nice but there is one problem: If I browse to accounts/login (the login url) when I am already logged in, in normal situation the login view shouldn't be rendered and the correct action will be to redirect to the