Re: What is the ideal web server to use with Django?

2015-05-15 Thread Marc Aymerich
On Fri, May 15, 2015 at 10:33 AM, Tom Evans <tevans...@googlemail.com> wrote:
> On Thu, May 14, 2015 at 4:18 PM, Marc Aymerich <glicer...@gmail.com> wrote:
>> On Thu, May 14, 2015 at 11:26 AM, Tom Evans <tevans...@googlemail.com> wrote:
>>> On our app servers we typically use Apache with worker MPM and
>>> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
>>> love some time to play around with a circusd + chausette + celery
>>> setup.
>>
>>
>> Hi Tom,
>> never heard about circusd and chaussette, but it sounds interesting.
>>
>> I believe the advantage of this setup pays when you have several
>> independent low-traffic applications, because you don't want all of
>> them to have preforked wsgi worker processes, not even the master
>> process. I think uwsgi can do that (emperor mode, cheaper subsystem),
>> but circusd will allow you to do the same which celery (celery needs
>> at least one master per pool). Is this the main point? I'm asking
>> because I can only find just a couple of blogposts and the
>> documentation is concise, neither mention the real tangible advantage
>> over traditional deployments.
>>
>
> There are few very cool things I like about circusd + chaussette,
> chausette allows you to run over a unix socket, and this allows
> circusd to easily spin up a new backend (with different code) and
> transfer requests to that unix socket, whilst leaving the old backend
> still running.
>
> This means zero downtime when doing a code upgrade, and instant
> failback to the old application if for some reason you don't like what
> was pushed.
>
> The second thing is that circusd is a process manager like
> supervisord, but it allows for dynamic operation - you can run celery
> worker processes underneath it, and spin up/spin down worker processes
> as you see fit to allow for load.
>
> The third is that circusd is accessed by a web interface, which allows
> for simple day to day use and also simplifies how admins and sysadmins
> can interact with it. Its very easy for our sysadmins to control
> things they can just fire http requests at.
>

thanks Tom, that is really cool, I really appreciated your comments on this!


-- 
Marc

-- 
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/CA%2BDCN_t886rR7b88H7oBYXGJTUBFA0wsxe9c6p8vK4G_7b2d9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-15 Thread Ilya Kazakevich
Hi.

I believe the best installation is Apache + wsgi and nginx for static. 

In some scenarios Apache performance may be your bottleneck, but:
1) there are a lot of ways to tune it. Read about "Multi-Processing 
Modules" for example.
2) 99% of web applications do have different bottlenecks, not the web 
server.
3) really huge installations should use clusters hence should be scalable 
horizontally. In such scenarios web server performance is not an issue 
(unless you work for Google or Facebook) :)


On Wednesday, May 13, 2015 at 4:15:18 AM UTC+3, akshat wrote:
>
> I am new to Django. I am building a app which will have to handle several 
> concurrent requests. Which web server is suitable for this? I have read 
> that Apache's performance degrades on high load.
>

-- 
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/eed0c413-9cf6-4ceb-91ef-95a85c42ec3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-15 Thread Avraham Serour
>chausette allows you to run over a unix socket, and this allows
circusd to easily spin up a new backend (with different code) and
transfer requests to that unix socket, whilst leaving the old backend
still running.

This was the killer feature that I started using uwsgi, you can reload your
new django code without uwsgi closing the socket, in the worst case some
requests may feel a little delay but won't feel any downtime

I once even did a crazy thing: a form that updated and reload its own
django code (git pull and uwsgi reload), it worked great, user would click
on the button to update the system, the request would come and the user
would get the updated version on reload (because form response is redirect)

my only problem was doing the same trick on cygwin, but that's another story

On Fri, May 15, 2015 at 11:33 AM, Tom Evans <tevans...@googlemail.com>
wrote:

> On Thu, May 14, 2015 at 4:18 PM, Marc Aymerich <glicer...@gmail.com>
> wrote:
> > On Thu, May 14, 2015 at 11:26 AM, Tom Evans <tevans...@googlemail.com>
> wrote:
> >> On our app servers we typically use Apache with worker MPM and
> >> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> >> love some time to play around with a circusd + chausette + celery
> >> setup.
> >
> >
> > Hi Tom,
> > never heard about circusd and chaussette, but it sounds interesting.
> >
> > I believe the advantage of this setup pays when you have several
> > independent low-traffic applications, because you don't want all of
> > them to have preforked wsgi worker processes, not even the master
> > process. I think uwsgi can do that (emperor mode, cheaper subsystem),
> > but circusd will allow you to do the same which celery (celery needs
> > at least one master per pool). Is this the main point? I'm asking
> > because I can only find just a couple of blogposts and the
> > documentation is concise, neither mention the real tangible advantage
> > over traditional deployments.
> >
>
> There are few very cool things I like about circusd + chaussette,
> chausette allows you to run over a unix socket, and this allows
> circusd to easily spin up a new backend (with different code) and
> transfer requests to that unix socket, whilst leaving the old backend
> still running.
>
> This means zero downtime when doing a code upgrade, and instant
> failback to the old application if for some reason you don't like what
> was pushed.
>
> The second thing is that circusd is a process manager like
> supervisord, but it allows for dynamic operation - you can run celery
> worker processes underneath it, and spin up/spin down worker processes
> as you see fit to allow for load.
>
> The third is that circusd is accessed by a web interface, which allows
> for simple day to day use and also simplifies how admins and sysadmins
> can interact with it. Its very easy for our sysadmins to control
> things they can just fire http requests at.
>
> Cheers
>
> 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/CAFHbX1Kekp9cNqqcZPjxfpWgGS%2BxGhuaaE9VT35Hd79S%3Dv8kbg%40mail.gmail.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+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/CAFWa6tKVfSGznv5NNzBfqPkakCn_oofaDe28Nf6Nmb6mXP2zoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-15 Thread Tom Evans
On Thu, May 14, 2015 at 4:18 PM, Marc Aymerich <glicer...@gmail.com> wrote:
> On Thu, May 14, 2015 at 11:26 AM, Tom Evans <tevans...@googlemail.com> wrote:
>> On our app servers we typically use Apache with worker MPM and
>> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
>> love some time to play around with a circusd + chausette + celery
>> setup.
>
>
> Hi Tom,
> never heard about circusd and chaussette, but it sounds interesting.
>
> I believe the advantage of this setup pays when you have several
> independent low-traffic applications, because you don't want all of
> them to have preforked wsgi worker processes, not even the master
> process. I think uwsgi can do that (emperor mode, cheaper subsystem),
> but circusd will allow you to do the same which celery (celery needs
> at least one master per pool). Is this the main point? I'm asking
> because I can only find just a couple of blogposts and the
> documentation is concise, neither mention the real tangible advantage
> over traditional deployments.
>

There are few very cool things I like about circusd + chaussette,
chausette allows you to run over a unix socket, and this allows
circusd to easily spin up a new backend (with different code) and
transfer requests to that unix socket, whilst leaving the old backend
still running.

This means zero downtime when doing a code upgrade, and instant
failback to the old application if for some reason you don't like what
was pushed.

The second thing is that circusd is a process manager like
supervisord, but it allows for dynamic operation - you can run celery
worker processes underneath it, and spin up/spin down worker processes
as you see fit to allow for load.

The third is that circusd is accessed by a web interface, which allows
for simple day to day use and also simplifies how admins and sysadmins
can interact with it. Its very easy for our sysadmins to control
things they can just fire http requests at.

Cheers

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/CAFHbX1Kekp9cNqqcZPjxfpWgGS%2BxGhuaaE9VT35Hd79S%3Dv8kbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: What is the ideal web server to use with Django?

2015-05-14 Thread Andrew Farrell
Ashkat,

I second the recommendation that Ashkat go with gunicorn+nginx for the same
reason Avraham does. Digital Ocean has a good walkthrough of how to set
that up here
<https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn>
.


One thing though is I would make sure to do it in stages when you are just
starting out. That way you always have some piece working and when some
thing isn't working you have a guess where that is:
1) First run through the tutorial with just a sqlite database and the
built-in webserver on port 8000.
2) Get nginx so that it is able to serve a static html file and you can see
its' logs (probably in /var/log/nginx)
3) Get nginx to be able to proxy_pass from port 80 to the built-in
webserver on port 8000
4) Get gunicorn able to serve on port 8000
5) Get nginx able to proxy to gunicorn on port 8000

And then you can also get the postgres database working, first by being
able to connect to it with manage.py dbshell, then by running migrations
and the built-in webserver and then the full stack.

Welcome aboard the django train,
Andrew


-- Forwarded message --
From: Avraham Serour <tovm...@gmail.com>
Date: Thu, May 14, 2015 at 4:40 AM
Subject: Re: What is the ideal web server to use with Django?
To: django-users@googlegroups.com


My main reason for recommending nginx is the config file, they are simpler
than apache,
when developing an application you shouldn't spend much time configuring
the web server,
only after you reached so much traffic that it would make sense to spend
time with it
On May 14, 2015 12:26 PM, "Tom Evans" <tevans...@googlemail.com> wrote:

> On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com>
> wrote:
> > The question you asked Tom was "Doesn't Apache create new process for
> each
> > request [thus eating memory when serving large amounts of static files
> > during traffic peaks]?", and the reason that Tom correctly answers "No"
> is
> > that as far as "serving large amounts of static files" goes you should be
> > using mpm-worker (multi-threaded Apache) which most definitely does not
> > spawn a new process for each request.
> >
> > The reason for those search results is that mpm-prefork does, however,
> spawn
> > a process per request,
>
> No, really, it does not. It only spawns a new process when there are
> no available workers to process an incoming request, and you have not
> reached the maximum number of workers that you have configured it to
> start. You can configure it to start all the worker processes you want
> when it starts up, and never to kill them off, and it will never spawn
> a new process.
>
> Apache processes are small, unless you do daft things like embed your
> web application in each worker process (mod_php style). This is the
> main complaint "Apache is eating all my memory" - it isn't, your web
> application you've embedded into Apache is eating all your memory.
>
> All of this is irrelevant for django, because with Apache you should
> use mod_wsgi in daemon mode, which separates out your web application
> processes from the web server.
>
> > but it is only needed for non-thread-safe
> > environments (most notoriously mod_php) and you shouldn't have to use it
> as
> > long as you've been a good coder and avoided global state in your Django
> app
> > (e.g. keep request-specific shared-state thread-local).
> >
> > I think the reason a lot of people seem to run mpm-prefork is just that
> it's
> > the default multi-processing module for Apache on most (all?) *nix
> platforms
> > and they don't know any better.
>
> Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
> our (400+) domains, serving around 40 million requests per day,
> providing SSL termination and static file serving. We use event MPM
> and we have it scaled to support a peak of 2048 simultaneous
> connections. Load on the server never goes above 0.2, memory usage
> never goes above 1GB for the entire OS + applications, the rest of the
> RAM is used by the OS to cache the aforementioned static files.
>
> On our app servers we typically use Apache with worker MPM and
> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> love some time to play around with a circusd + chausette + celery
> setup.
>
> The choice of web server is, these days, irrelevant. If it uses too
> much memory or can't handle enough users, it is never the fault of the
> web server, but instead of your application and/or configuration.
> Which is why I return to my original advice:
>
> > I am new to Django. I am building a app which will have to handle seve

Re: What is the ideal web server to use with Django?

2015-05-14 Thread Marc Aymerich
On Thu, May 14, 2015 at 11:26 AM, Tom Evans <tevans...@googlemail.com> wrote:
>
> On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com> 
> wrote:
> > The question you asked Tom was "Doesn't Apache create new process for each
> > request [thus eating memory when serving large amounts of static files
> > during traffic peaks]?", and the reason that Tom correctly answers "No" is
> > that as far as "serving large amounts of static files" goes you should be
> > using mpm-worker (multi-threaded Apache) which most definitely does not
> > spawn a new process for each request.
> >
> > The reason for those search results is that mpm-prefork does, however, spawn
> > a process per request,
>
> No, really, it does not. It only spawns a new process when there are
> no available workers to process an incoming request, and you have not
> reached the maximum number of workers that you have configured it to
> start. You can configure it to start all the worker processes you want
> when it starts up, and never to kill them off, and it will never spawn
> a new process.
>
> Apache processes are small, unless you do daft things like embed your
> web application in each worker process (mod_php style). This is the
> main complaint "Apache is eating all my memory" - it isn't, your web
> application you've embedded into Apache is eating all your memory.
>
> All of this is irrelevant for django, because with Apache you should
> use mod_wsgi in daemon mode, which separates out your web application
> processes from the web server.
>
> > but it is only needed for non-thread-safe
> > environments (most notoriously mod_php) and you shouldn't have to use it as
> > long as you've been a good coder and avoided global state in your Django app
> > (e.g. keep request-specific shared-state thread-local).
> >
> > I think the reason a lot of people seem to run mpm-prefork is just that it's
> > the default multi-processing module for Apache on most (all?) *nix platforms
> > and they don't know any better.
>
> Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
> our (400+) domains, serving around 40 million requests per day,
> providing SSL termination and static file serving. We use event MPM
> and we have it scaled to support a peak of 2048 simultaneous
> connections. Load on the server never goes above 0.2, memory usage
> never goes above 1GB for the entire OS + applications, the rest of the
> RAM is used by the OS to cache the aforementioned static files.
>
> On our app servers we typically use Apache with worker MPM and
> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> love some time to play around with a circusd + chausette + celery
> setup.


Hi Tom,
never heard about circusd and chaussette, but it sounds interesting.

I believe the advantage of this setup pays when you have several
independent low-traffic applications, because you don't want all of
them to have preforked wsgi worker processes, not even the master
process. I think uwsgi can do that (emperor mode, cheaper subsystem),
but circusd will allow you to do the same which celery (celery needs
at least one master per pool). Is this the main point? I'm asking
because I can only find just a couple of blogposts and the
documentation is concise, neither mention the real tangible advantage
over traditional deployments.


>
> The choice of web server is, these days, irrelevant. If it uses too
> much memory or can't handle enough users, it is never the fault of the
> web server, but instead of your application and/or configuration.
> Which is why I return to my original advice:
>
> > I am new to Django. I am building a app which will have to handle several
> > concurrent requests. Which web server is suitable for this?
>
> Any and all.
>
> Leave the fanboyism to the phone guys.
>
> Cheers
>
> 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/CAFHbX1KEVRM6WU7OCcLRSkJhpMS%2BfHpd7%2BWo7LO8XcEt8_f0Nw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.




-- 
Marc

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

Re: What is the ideal web server to use with Django?

2015-05-14 Thread Jonathan Barratt
> On 14 พ.ค. 2558, at 05:26, Tom Evans <tevans...@googlemail.com> wrote:
> 
>> On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com> 
>> wrote:

>> The reason for those search results is that mpm-prefork does, however, spawn
>> a process per request,
> 
> No, really, it does not. It only spawns a new process when there are
> no available workers to process an incoming request, and you have not
> reached the maximum number of workers that you have configured it to
> start.

Oops, sorry, I was totally wrong about that.

> You can configure it to start all the worker processes you want
> when it starts up, and never to kill them off, and it will never spawn
> a new process.
> 
> Apache processes are small, unless you do daft things like embed your
> web application in each worker process (mod_php style). This is the
> main complaint "Apache is eating all my memory" - it isn't, your web
> application you've embedded into Apache is eating all your memory.
> 
> All of this is irrelevant for django, because with Apache you should
> use mod_wsgi in daemon mode, which separates out your web application
> processes from the web server.

>> I think the reason a lot of people seem to run mpm-prefork is just that it's
>> the default multi-processing module for Apache on most (all?) *nix platforms
>> and they don't know any better.
> 
> Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
> our (400+) domains, serving around 40 million requests per day,
> providing SSL termination and static file serving. We use event MPM
> and we have it scaled to support a peak of 2048 simultaneous
> connections. Load on the server never goes above 0.2, memory usage
> never goes above 1GB for the entire OS + applications, the rest of the
> RAM is used by the OS to cache the aforementioned static files.
> 
> On our app servers we typically use Apache with worker MPM and
> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> love some time to play around with a circusd + chausette + celery
> setup.
> 
> The choice of web server is, these days, irrelevant. If it uses too
> much memory or can't handle enough users, it is never the fault of the
> web server, but instead of your application and/or configuration.

Thanks for the awesome write-up Tom and for correcting my error, my apologies 
to all for contributing to any FUD!

Yours gratefully,
Jonathan

-- 
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/46CB380A-BBA2-4F78-8F7F-8DFC7A994859%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-14 Thread Avraham Serour
My main reason for recommending nginx is the config file, they are simpler
than apache,
when developing an application you shouldn't spend much time configuring
the web server,
only after you reached so much traffic that it would make sense to spend
time with it
On May 14, 2015 12:26 PM, "Tom Evans" <tevans...@googlemail.com> wrote:

> On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com>
> wrote:
> > The question you asked Tom was "Doesn't Apache create new process for
> each
> > request [thus eating memory when serving large amounts of static files
> > during traffic peaks]?", and the reason that Tom correctly answers "No"
> is
> > that as far as "serving large amounts of static files" goes you should be
> > using mpm-worker (multi-threaded Apache) which most definitely does not
> > spawn a new process for each request.
> >
> > The reason for those search results is that mpm-prefork does, however,
> spawn
> > a process per request,
>
> No, really, it does not. It only spawns a new process when there are
> no available workers to process an incoming request, and you have not
> reached the maximum number of workers that you have configured it to
> start. You can configure it to start all the worker processes you want
> when it starts up, and never to kill them off, and it will never spawn
> a new process.
>
> Apache processes are small, unless you do daft things like embed your
> web application in each worker process (mod_php style). This is the
> main complaint "Apache is eating all my memory" - it isn't, your web
> application you've embedded into Apache is eating all your memory.
>
> All of this is irrelevant for django, because with Apache you should
> use mod_wsgi in daemon mode, which separates out your web application
> processes from the web server.
>
> > but it is only needed for non-thread-safe
> > environments (most notoriously mod_php) and you shouldn't have to use it
> as
> > long as you've been a good coder and avoided global state in your Django
> app
> > (e.g. keep request-specific shared-state thread-local).
> >
> > I think the reason a lot of people seem to run mpm-prefork is just that
> it's
> > the default multi-processing module for Apache on most (all?) *nix
> platforms
> > and they don't know any better.
>
> Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
> our (400+) domains, serving around 40 million requests per day,
> providing SSL termination and static file serving. We use event MPM
> and we have it scaled to support a peak of 2048 simultaneous
> connections. Load on the server never goes above 0.2, memory usage
> never goes above 1GB for the entire OS + applications, the rest of the
> RAM is used by the OS to cache the aforementioned static files.
>
> On our app servers we typically use Apache with worker MPM and
> mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
> love some time to play around with a circusd + chausette + celery
> setup.
>
> The choice of web server is, these days, irrelevant. If it uses too
> much memory or can't handle enough users, it is never the fault of the
> web server, but instead of your application and/or configuration.
> Which is why I return to my original advice:
>
> > I am new to Django. I am building a app which will have to handle several
> > concurrent requests. Which web server is suitable for this?
>
> Any and all.
>
> Leave the fanboyism to the phone guys.
>
> Cheers
>
> 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/CAFHbX1KEVRM6WU7OCcLRSkJhpMS%2BfHpd7%2BWo7LO8XcEt8_f0Nw%40mail.gmail.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+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/CAFWa6tKVcxdXkZOOr2mu1xvLkJKz2XcS4HTZKRo8vwTTh0qo%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-14 Thread Tom Evans
On Thu, May 14, 2015 at 4:36 AM, reduxionist <jonathan.barr...@gmail.com> wrote:
> The question you asked Tom was "Doesn't Apache create new process for each
> request [thus eating memory when serving large amounts of static files
> during traffic peaks]?", and the reason that Tom correctly answers "No" is
> that as far as "serving large amounts of static files" goes you should be
> using mpm-worker (multi-threaded Apache) which most definitely does not
> spawn a new process for each request.
>
> The reason for those search results is that mpm-prefork does, however, spawn
> a process per request,

No, really, it does not. It only spawns a new process when there are
no available workers to process an incoming request, and you have not
reached the maximum number of workers that you have configured it to
start. You can configure it to start all the worker processes you want
when it starts up, and never to kill them off, and it will never spawn
a new process.

Apache processes are small, unless you do daft things like embed your
web application in each worker process (mod_php style). This is the
main complaint "Apache is eating all my memory" - it isn't, your web
application you've embedded into Apache is eating all your memory.

All of this is irrelevant for django, because with Apache you should
use mod_wsgi in daemon mode, which separates out your web application
processes from the web server.

> but it is only needed for non-thread-safe
> environments (most notoriously mod_php) and you shouldn't have to use it as
> long as you've been a good coder and avoided global state in your Django app
> (e.g. keep request-specific shared-state thread-local).
>
> I think the reason a lot of people seem to run mpm-prefork is just that it's
> the default multi-processing module for Apache on most (all?) *nix platforms
> and they don't know any better.

Quite. We run a pair of Apache 2.4 reverse proxies in front of all of
our (400+) domains, serving around 40 million requests per day,
providing SSL termination and static file serving. We use event MPM
and we have it scaled to support a peak of 2048 simultaneous
connections. Load on the server never goes above 0.2, memory usage
never goes above 1GB for the entire OS + applications, the rest of the
RAM is used by the OS to cache the aforementioned static files.

On our app servers we typically use Apache with worker MPM and
mod_wsgi, although we have a few nginx+uwsgi sites, and I would dearly
love some time to play around with a circusd + chausette + celery
setup.

The choice of web server is, these days, irrelevant. If it uses too
much memory or can't handle enough users, it is never the fault of the
web server, but instead of your application and/or configuration.
Which is why I return to my original advice:

> I am new to Django. I am building a app which will have to handle several
> concurrent requests. Which web server is suitable for this?

Any and all.

Leave the fanboyism to the phone guys.

Cheers

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/CAFHbX1KEVRM6WU7OCcLRSkJhpMS%2BfHpd7%2BWo7LO8XcEt8_f0Nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread reduxionist
On Wednesday, May 13, 2015 at 5:06:47 AM UTC-4, termopro wrote:
>
>
> No. 
>>
>> Cheers 
>>
>> Tom 
>>
>
> OK 
> <https://www.google.com/search?q=Apache+performance+problems=utf-8=utf-8#q=apache+eating+memory>
>  
> :) 
>

That's only evidence that a lot of people don't know how to 
"performance-tune" (a.k.a. configure) Apache.

The question you asked Tom was "Doesn't Apache create new process for each 
request [thus eating memory when serving large amounts of static files 
during traffic peaks]?", and the reason that Tom correctly answers "No" is 
that as far as "serving large amounts of static files" goes you should be 
using mpm-worker (multi-threaded Apache) which most definitely does not 
spawn a new process for each request.

The reason for those search results is that mpm-prefork does, however, 
spawn a process per request, but it is only needed for non-thread-safe 
environments (most notoriously mod_php) and you shouldn't have to use it as 
long as you've been a good coder and avoided global state in your Django 
app (e.g. keep request-specific shared-state thread-local).

I think the reason a lot of people seem to run mpm-prefork is just that 
it's the default multi-processing module for Apache on most (all?) *nix 
platforms and they don't know any better.

Hope that helps explain away that myth! :)

Best wishes,
Jonathan

-- 
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/425d7d29-e6e3-495f-9901-239570a96622%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread James Schneider
If you get enough traffic to trounce a (web server of choice) installation,
you probably are making enough money to hire an expert with that system to
tune it properly or recommend adding additional resources.

Don't get bogged down in Apache vs. Nginx vs. uWSGI, etc. You're nowhere
near that point if you're asking that question.

The web server platform is usually not the cause of site slowness,
especially if it is tuned correctly (number of worker threads, memory
allocation, etc.). Optimizing the application itself normally provides the
largest gains.

The three most common configurations I've seen are using Apache/mod_wsgi,
Nginx/uWSGI, and Gnuicorn. All have varying degrees of difficulty,
strengths, extended functionality (ie allowing configuration via
environment variables for things like your SECRET_KEY), documentation, and
support.

Research all of them and determine either a) the one that is easiest to
implement/configure/maintain/secure for you and b) whether your site
warrants the extra work of doing so rather than using a pre-built
environment such as Heroku.

Of course, the Django docs have recommendations:

https://docs.djangoproject.com/en/dev/howto/deployment/

-James
On May 13, 2015 2:06 AM, "termopro" <termo...@gmail.com> wrote:

>
> No.
>>
>> Cheers
>>
>> Tom
>>
>
> OK
> <https://www.google.com/search?q=Apache+performance+problems=utf-8=utf-8#q=apache+eating+memory>
> :)
>
> --
> 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/b1943895-42a8-4472-b11f-ec92a7120b65%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b1943895-42a8-4472-b11f-ec92a7120b65%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 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/CA%2Be%2BciWKx8_ECWZ1dU%2Bfh2PPyU1PfwvJRU78quiUaaSeF%2BviKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread termopro


> No. 
>
> Cheers 
>
> Tom 
>

OK 
<https://www.google.com/search?q=Apache+performance+problems=utf-8=utf-8#q=apache+eating+memory>
 
:) 

-- 
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/b1943895-42a8-4472-b11f-ec92a7120b65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 9:55 AM, termopro <termo...@gmail.com> wrote:
>
>> >I have read that
>> > Apache's performance degrades on high load.
>>
>> That is absolute nonsense.
>>
>> Cheers
>>
>> Tom
>
>
> Doesn't Apache create new process for each request thus eating memory when
> serving large amounts of static files during traffic peaks ?

No.

Cheers

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/CAFHbX1KwDGU4dAEQZkYPiVCcqM7%3DXCi8O630vr1UZyy9bhpJyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread termopro


> >I have read that 
> > Apache's performance degrades on high load. 
>
> That is absolute nonsense. 
>
> Cheers 
>
> Tom 
>

Doesn't Apache create new process for each request thus eating memory when 
serving large amounts of static files during traffic peaks ?

-- 
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/2f832399-cd90-4021-b9ba-a27eaab1c50d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread Tom Evans
On Wed, May 13, 2015 at 2:12 AM, akshat <akshatwillro...@gmail.com> wrote:
> I am new to Django. I am building a app which will have to handle several
> concurrent requests. Which web server is suitable for this?

Any and all.

>I have read that
> Apache's performance degrades on high load.

That is absolute nonsense.

Cheers

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/CAFHbX1KoyWx_v4rRBheugE1or0_84cGxJA5avxxa_wrQKsSh1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-13 Thread kk


I would suggest using Nginx.

happy hacking.
Krishnakant.
On Wednesday 13 May 2015 06:42 AM, akshat wrote:
I am new to Django. I am building a app which will have to handle 
several concurrent requests. Which web server is suitable for this? I 
have read that Apache's performance degrades on high load.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/4b0d96b1-76b8-4068-92e2-cbdbdc55e609%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/4b0d96b1-76b8-4068-92e2-cbdbdc55e609%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 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/5552F5DA.2040606%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to go about building complicated web apps with django?

2015-05-12 Thread Mario Gudelj
"Should I start building a basic web app and then iteratively" <<< This.

Then buy this book https://highperformancedjango.com/ after you've done
things like these
http://www.revsys.com/blog/2015/may/06/django-performance-simple-things/

On 13 May 2015 at 11:04, akshat <akshatwillro...@gmail.com> wrote:

> I am new to django. I have till now built tutorial apps and read almost
> 25% of the source code of django. Right now I guess I have decent know-how
> of django but since I have not built large-scale app on django hence the
> question.
> I am building a web app which I know will involve various complexities
> when I will scale it. But right now user base will be pretty low on the web
> app. So should I take care of topics such as -
> 1) Scaling Python/Django Application with Apache and mod_wsgi
> 2) Scaling database with Django and HAProxy
> 3) Scheduling asynchronous tasks with Celery.
>
> from the very starting or Should I start building a basic web app and then
> iteratively add various modules to the app?
> I mean what is the right way to build a Django app which I know will have
> to be scaled in the future?
>
>  --
> 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/0474ff5f-0a7a-4475-bb38-1faeb2d12001%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0474ff5f-0a7a-4475-bb38-1faeb2d12001%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 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/CAHqTbjnw0DM26Ju6CXxQdxaPcUwWLCcdWLWRAH_%2BW%3D5ZndLVpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the ideal web server to use with Django?

2015-05-12 Thread Mario Gudelj
The most common setups I came across are Nginx + Gunicorn and Nginx +
uWSGI. Nginx + Gunicorn is really easy to setup and it will probably be
sufficient. You just need to have enough Gunicorn workers running for your
amount of traffic. I really like this setup
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
.

On 13 May 2015 at 11:12, akshat <akshatwillro...@gmail.com> wrote:

> I am new to Django. I am building a app which will have to handle several
> concurrent requests. Which web server is suitable for this? I have read
> that Apache's performance degrades on high load.
>
> --
> 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/4b0d96b1-76b8-4068-92e2-cbdbdc55e609%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4b0d96b1-76b8-4068-92e2-cbdbdc55e609%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 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/CAHqTbjm%2BcjgHqHpACTnR3mUgYHg6g8Twc6weE%3DQ9FoDntKaHKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


What is the ideal web server to use with Django?

2015-05-12 Thread akshat
I am new to Django. I am building a app which will have to handle several 
concurrent requests. Which web server is suitable for this? I have read 
that Apache's performance degrades on high load.

-- 
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/4b0d96b1-76b8-4068-92e2-cbdbdc55e609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to go about building complicated web apps with django?

2015-05-12 Thread akshat
I am new to django. I have till now built tutorial apps and read almost 25% 
of the source code of django. Right now I guess I have decent know-how of 
django but since I have not built large-scale app on django hence the 
question.
I am building a web app which I know will involve various complexities when 
I will scale it. But right now user base will be pretty low on the web app. 
So should I take care of topics such as -  
1) Scaling Python/Django Application with Apache and mod_wsgi
2) Scaling database with Django and HAProxy
3) Scheduling asynchronous tasks with Celery.

from the very starting or Should I start building a basic web app and then 
iteratively add various modules to the app?
I mean what is the right way to build a Django app which I know will have 
to be scaled in the future?

-- 
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/0474ff5f-0a7a-4475-bb38-1faeb2d12001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GUI with web-browser using Django, Python 3

2015-05-04 Thread Gergely Polonkai
Hello,

you should walk through the Django tutorial[1] to get as idea on how to use
it. However, if this is the sole problem, I think Django is overkill, a
pure WSGI page would suffice.

Best,
Gergely

[1] https://docs.djangoproject.com/en/1.8/intro/tutorial01/
On 4 May 2015 17:28, "Aura" <leiwule...@gmail.com> wrote:

> I want to make a py-file by GUI. The GUI I want is based on web-browser
> (chrome, safari). So I use Django.
>
> The step-by-step idea is:
>
>1.
>
>I open the web-browser (as GUI, not to access internet). On the
>web-browser, there are two blanks and a "Generate" button, like
>
>a = ??
>
>filename = ??
>
>"Generate"
>
>(Here ?? is blank waiting for filling.)
>2.
>
>I fill like: a = [1,2,3,4], and filename = MyFile
>3.
>
>Click the "Generate" button
>
>Then A py-file "MyFile.py" is generated in an aimed folder. In the
>file, there is a python code
>
>a = [1,2,3,4]
>
>4.
>
>I plot a figure by
>
>import matplotlib.pyplot as plt
>plt.plot(a,a)
>
>It will generate a figure. I want this figure to be shown on the
>web-browser.
>
> I am using Python 3.
>
> Can you please show me how to do the 4 steps with Django? 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/d4a8bc37-a838-40a1-ac21-48ebd335d8d8%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d4a8bc37-a838-40a1-ac21-48ebd335d8d8%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 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/CACczBUKG73S-DPWpMibwas3hSyPn4i%2Buj1p_o64bQfzmzZ8yFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


GUI with web-browser using Django, Python 3

2015-05-04 Thread Aura


I want to make a py-file by GUI. The GUI I want is based on web-browser 
(chrome, safari). So I use Django.

The step-by-step idea is:

   1. 
   
   I open the web-browser (as GUI, not to access internet). On the 
   web-browser, there are two blanks and a "Generate" button, like
   
   a = ??
   
   filename = ??
   
   "Generate"
   
   (Here ?? is blank waiting for filling.)
   2. 
   
   I fill like: a = [1,2,3,4], and filename = MyFile
   3. 
   
   Click the "Generate" button
   
   Then A py-file "MyFile.py" is generated in an aimed folder. In the file, 
   there is a python code
   
   a = [1,2,3,4]
   
   4. 
   
   I plot a figure by
   
   import matplotlib.pyplot as plt
   plt.plot(a,a)
   
   It will generate a figure. I want this figure to be shown on the 
   web-browser.
   
I am using Python 3.

Can you please show me how to do the 4 steps with Django? 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/d4a8bc37-a838-40a1-ac21-48ebd335d8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-05-04 Thread guettli
Hi Derek,

yes, your previous answer already contained information what the database 
schema could be.

This schema is not related to my application at all. At least I think so. 
This would be generic and reusable.

I think there is a better solution than starting plumbing this for myself.

Maybe it is better if we would use one of the many navigation apps for our 
project.

https://www.djangopackages.com/grids/g/navigation/

Maybe one of those already stores the relevant data in the database 

I will post here, if I found a solution.

Regards,
  Thomas Güttler


Am Donnerstag, 30. April 2015 18:29:30 UTC+2 schrieb Derek:
>
> Hi Thomas
>
> I do not I understand your question; I made a suggestion previously for 
> what fields you might need in this 'metadata' model, and you can add or 
> change as needed.  I do not know what your project looks like, so I cannot 
> comment on what the rest of your database should contain.
>
> Derek
>
> On Thursday, 30 April 2015 13:26:25 UTC+2, guettli wrote:
>>
>> Hi Derek,
>>
>> yes, your idea looks good.
>>
>> Next question would be: How to lay out the database structure (models)?
>>
>> Regards,
>>   Thomas
>>
>> Am Dienstag, 28. April 2015 16:04:35 UTC+2 schrieb Derek:
>>>
>>> A quick "brain storm"...
>>>
>>> One idea could be to keep all the metadata for your views - their full 
>>> name; abbreviated name; aliases (alternate names); URL; keywords; and 
>>> categories etc. in a single table.  You could then use this table to 
>>> generate *multiple* possible ways for a user to "find" the view they need.
>>>
>>> For example - you could present a list of categories (and 
>>> sub-categories, and sub-sub-categories) which could be presented in a 
>>> expandable list (jQuery-style).
>>>
>>> You could create a tag-cloud and allow a user to 'expand' a single tag 
>>> into related-views.
>>>
>>> You could allow a user to create their own tags for searching and 
>>> display (in a many-to-many table linked to user).
>>>
>>> You could allow a user to "favourite" some of the views and allow the 
>>> user to easily see (list/sort/search) those.
>>>
>>> And, of course, a simple search button could be created to allow an 
>>> 'incremental' display (auto-complete Google-style) of all possible matches 
>>> from all fields in your table...
>>>
>>> I am sure there are other ways you could think of to generate navigation 
>>> options, including fancy graphic ones!
>>>
>>> You would have to 'admin' this table of course, but the data in it could 
>>> be changed dynamically (e.g. adding more categories and aliases) without 
>>> affecting the logic of your app.
>>>
>>> [Hey - this could even make a cool app on its own!]
>>>
>>> Hope these ideas help  my project is a just a boring menu-driven one.
>>>
>>> Derek
>>>
>>>
>>> On Tuesday, 28 April 2015 11:27:47 UTC+2, guettli wrote:
>>>>
>>>> We have a complex intranet application.
>>>>
>>>> It has many view.
>>>>
>>>> The problem: How to find the view a user wants to use?
>>>>
>>>> A huge sitemap HTML does not help.
>>>>
>>>> Is there a way to search the matching view?
>>>>
>>>> Maybe even with auto complete?
>>>>
>>>>
>>>>

-- 
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/afb9bf35-4c10-4f39-aa4a-629177245102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-30 Thread Derek
Hi Thomas

I do not I understand your question; I made a suggestion previously for 
what fields you might need in this 'metadata' model, and you can add or 
change as needed.  I do not know what your project looks like, so I cannot 
comment on what the rest of your database should contain.

Derek

On Thursday, 30 April 2015 13:26:25 UTC+2, guettli wrote:
>
> Hi Derek,
>
> yes, your idea looks good.
>
> Next question would be: How to lay out the database structure (models)?
>
> Regards,
>   Thomas
>
> Am Dienstag, 28. April 2015 16:04:35 UTC+2 schrieb Derek:
>>
>> A quick "brain storm"...
>>
>> One idea could be to keep all the metadata for your views - their full 
>> name; abbreviated name; aliases (alternate names); URL; keywords; and 
>> categories etc. in a single table.  You could then use this table to 
>> generate *multiple* possible ways for a user to "find" the view they need.
>>
>> For example - you could present a list of categories (and sub-categories, 
>> and sub-sub-categories) which could be presented in a expandable list 
>> (jQuery-style).
>>
>> You could create a tag-cloud and allow a user to 'expand' a single tag 
>> into related-views.
>>
>> You could allow a user to create their own tags for searching and display 
>> (in a many-to-many table linked to user).
>>
>> You could allow a user to "favourite" some of the views and allow the 
>> user to easily see (list/sort/search) those.
>>
>> And, of course, a simple search button could be created to allow an 
>> 'incremental' display (auto-complete Google-style) of all possible matches 
>> from all fields in your table...
>>
>> I am sure there are other ways you could think of to generate navigation 
>> options, including fancy graphic ones!
>>
>> You would have to 'admin' this table of course, but the data in it could 
>> be changed dynamically (e.g. adding more categories and aliases) without 
>> affecting the logic of your app.
>>
>> [Hey - this could even make a cool app on its own!]
>>
>> Hope these ideas help  my project is a just a boring menu-driven one.
>>
>> Derek
>>
>>
>> On Tuesday, 28 April 2015 11:27:47 UTC+2, guettli wrote:
>>>
>>> We have a complex intranet application.
>>>
>>> It has many view.
>>>
>>> The problem: How to find the view a user wants to use?
>>>
>>> A huge sitemap HTML does not help.
>>>
>>> Is there a way to search the matching view?
>>>
>>> Maybe even with auto complete?
>>>
>>>
>>>

-- 
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/701ba7ce-e777-4094-8e37-3a2b246e4276%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-30 Thread guettli
Hi Derek,

yes, your idea looks good.

Next question would be: How to lay out the database structure (models)?

Regards,
  Thomas

Am Dienstag, 28. April 2015 16:04:35 UTC+2 schrieb Derek:
>
> A quick "brain storm"...
>
> One idea could be to keep all the metadata for your views - their full 
> name; abbreviated name; aliases (alternate names); URL; keywords; and 
> categories etc. in a single table.  You could then use this table to 
> generate *multiple* possible ways for a user to "find" the view they need.
>
> For example - you could present a list of categories (and sub-categories, 
> and sub-sub-categories) which could be presented in a expandable list 
> (jQuery-style).
>
> You could create a tag-cloud and allow a user to 'expand' a single tag 
> into related-views.
>
> You could allow a user to create their own tags for searching and display 
> (in a many-to-many table linked to user).
>
> You could allow a user to "favourite" some of the views and allow the user 
> to easily see (list/sort/search) those.
>
> And, of course, a simple search button could be created to allow an 
> 'incremental' display (auto-complete Google-style) of all possible matches 
> from all fields in your table...
>
> I am sure there are other ways you could think of to generate navigation 
> options, including fancy graphic ones!
>
> You would have to 'admin' this table of course, but the data in it could 
> be changed dynamically (e.g. adding more categories and aliases) without 
> affecting the logic of your app.
>
> [Hey - this could even make a cool app on its own!]
>
> Hope these ideas help  my project is a just a boring menu-driven one.
>
> Derek
>
>
> On Tuesday, 28 April 2015 11:27:47 UTC+2, guettli wrote:
>>
>> We have a complex intranet application.
>>
>> It has many view.
>>
>> The problem: How to find the view a user wants to use?
>>
>> A huge sitemap HTML does not help.
>>
>> Is there a way to search the matching view?
>>
>> Maybe even with auto complete?
>>
>>
>>

-- 
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/c24246d5-a053-418f-a196-3b9b026dd6bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-30 Thread guettli


Am Dienstag, 28. April 2015 16:49:18 UTC+2 schrieb Andrew Farrell:
>
> If you are asking this question as a developer who wants to know what view 
> to use to affect a page when you know the url, I recommend you install The 
> Silver Searcher <http://geoff.greer.fm/ag/>, which lets you run 
>
> $ ag 'some arbitrary text you might find on a page'
>
> and it will quickly show you every place that text occurs in the entire 
> directory tree where you run the command. This will show you what template 
> is being rendered. Then, you can take the name of that template and do 
> something like.
>
> $ ag 'orders/unfulfilled.html'
>
> and you will see which view is rendering that template.
>
>

No, I was looking at my pages through the glasses of a user. 

For search in code I use pyCharm.

-- 
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/bd57cc98-e613-4c24-bc93-72faf32d3124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-28 Thread Andrew Farrell
If you are asking this question as a developer who wants to know what view
to use to affect a page when you know the url, I recommend you install The
Silver Searcher <http://geoff.greer.fm/ag/>, which lets you run

$ ag 'some arbitrary text you might find on a page'

and it will quickly show you every place that text occurs in the entire
directory tree where you run the command. This will show you what template
is being rendered. Then, you can take the name of that template and do
something like.

$ ag 'orders/unfulfilled.html'

and you will see which view is rendering that template.

On Tue, Apr 28, 2015 at 9:04 AM, Derek <gamesb...@gmail.com> wrote:

> A quick "brain storm"...
>
> One idea could be to keep all the metadata for your views - their full
> name; abbreviated name; aliases (alternate names); URL; keywords; and
> categories etc. in a single table.  You could then use this table to
> generate *multiple* possible ways for a user to "find" the view they need.
>
> For example - you could present a list of categories (and sub-categories,
> and sub-sub-categories) which could be presented in a expandable list
> (jQuery-style).
>
> You could create a tag-cloud and allow a user to 'expand' a single tag
> into related-views.
>
> You could allow a user to create their own tags for searching and display
> (in a many-to-many table linked to user).
>
> You could allow a user to "favourite" some of the views and allow the user
> to easily see (list/sort/search) those.
>
> And, of course, a simple search button could be created to allow an
> 'incremental' display (auto-complete Google-style) of all possible matches
> from all fields in your table...
>
> I am sure there are other ways you could think of to generate navigation
> options, including fancy graphic ones!
>
> You would have to 'admin' this table of course, but the data in it could
> be changed dynamically (e.g. adding more categories and aliases) without
> affecting the logic of your app.
>
> [Hey - this could even make a cool app on its own!]
>
> Hope these ideas help  my project is a just a boring menu-driven one.
>
> Derek
>
>
> On Tuesday, 28 April 2015 11:27:47 UTC+2, guettli wrote:
>>
>> We have a complex intranet application.
>>
>> It has many view.
>>
>> The problem: How to find the view a user wants to use?
>>
>> A huge sitemap HTML does not help.
>>
>> Is there a way to search the matching view?
>>
>> Maybe even with auto complete?
>>
>>
>>  --
> 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/7509b96e-5445-4a2d-b584-4440e76975ca%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/7509b96e-5445-4a2d-b584-4440e76975ca%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 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/CA%2By5TLaeQaShO7cqYs%2BGu3rKX7%2Byr8-WWoXxunDFrbapBkC4Ug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-28 Thread Derek
A quick "brain storm"...

One idea could be to keep all the metadata for your views - their full 
name; abbreviated name; aliases (alternate names); URL; keywords; and 
categories etc. in a single table.  You could then use this table to 
generate *multiple* possible ways for a user to "find" the view they need.

For example - you could present a list of categories (and sub-categories, 
and sub-sub-categories) which could be presented in a expandable list 
(jQuery-style).

You could create a tag-cloud and allow a user to 'expand' a single tag into 
related-views.

You could allow a user to create their own tags for searching and display 
(in a many-to-many table linked to user).

You could allow a user to "favourite" some of the views and allow the user 
to easily see (list/sort/search) those.

And, of course, a simple search button could be created to allow an 
'incremental' display (auto-complete Google-style) of all possible matches 
from all fields in your table...

I am sure there are other ways you could think of to generate navigation 
options, including fancy graphic ones!

You would have to 'admin' this table of course, but the data in it could be 
changed dynamically (e.g. adding more categories and aliases) without 
affecting the logic of your app.

[Hey - this could even make a cool app on its own!]

Hope these ideas help  my project is a just a boring menu-driven one.

Derek


On Tuesday, 28 April 2015 11:27:47 UTC+2, guettli wrote:
>
> We have a complex intranet application.
>
> It has many view.
>
> The problem: How to find the view a user wants to use?
>
> A huge sitemap HTML does not help.
>
> Is there a way to search the matching view?
>
> Maybe even with auto complete?
>
>
>

-- 
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/7509b96e-5445-4a2d-b584-4440e76975ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to find a view in a complex web application

2015-04-28 Thread aRkadeFR

I dont quite get your request.

Where is your starting point to search the user view?
When you say "a user wants to use", where does it
come from? A template view? A view_name maybe?
A URL?

On 04/28/2015 11:27 AM, guettli wrote:

We have a complex intranet application.

It has many view.

The problem: How to find the view a user wants to use?

A huge sitemap HTML does not help.

Is there a way to search the matching view?

Maybe even with auto complete?


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/b933d0e6-dcb4-4be2-90c3-aeb943924cdd%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/b933d0e6-dcb4-4be2-90c3-aeb943924cdd%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 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/553F56F5.1020208%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


How to find a view in a complex web application

2015-04-28 Thread guettli
We have a complex intranet application.

It has many view.

The problem: How to find the view a user wants to use?

A huge sitemap HTML does not help.

Is there a way to search the matching view?

Maybe even with auto complete?


-- 
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/b933d0e6-dcb4-4be2-90c3-aeb943924cdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Host a web application

2015-04-22 Thread Mario Gudelj
Sign up for AWS, fire up a free micro instance and host on that. You can
have it up there in no time with something like
https://github.com/gcollazo/Fabulous

On 23 April 2015 at 00:52, Mario R. Osorio <nimbiot...@gmail.com> wrote:

>
>
> www.pythonanywhere.com made it easier for me to deploy than heroku
>
> On Wednesday, April 22, 2015 at 2:25:56 AM UTC-4, Kishan Mehta wrote:
>>
>> Hi ,
>>
>> I have to show my web application project work to a potential employer.
>> Is it possible to host the demo somewhere? Any guide on this?
>>
>> Thanks for help,
>> Kishankumar Mehta
>>
>  --
> 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/109e5f89-bc99-48a4-a0cd-02ab86f79545%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/109e5f89-bc99-48a4-a0cd-02ab86f79545%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 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/CAHqTbjkui6fk1B01LDviPMKCBMz0FTgKN3UmXywmnAH1ZqScfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Host a web application

2015-04-22 Thread Mario R. Osorio


www.pythonanywhere.com made it easier for me to deploy than heroku

On Wednesday, April 22, 2015 at 2:25:56 AM UTC-4, Kishan Mehta wrote:
>
> Hi ,
>
> I have to show my web application project work to a potential employer. 
> Is it possible to host the demo somewhere? Any guide on this? 
>
> Thanks for help,
> Kishankumar Mehta 
>

-- 
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/109e5f89-bc99-48a4-a0cd-02ab86f79545%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Host a web application

2015-04-22 Thread Michele Mattioni
Hi,
if it is for a demo, you could use heroku to show it to your client:
https://www.heroku.com/

Best,
Michele

On Wed, Apr 22, 2015 at 7:24 AM, Kishan Mehta <kishanmeh...@gmail.com>
wrote:

> Hi ,
>
> I have to show my web application project work to a potential employer.
> Is it possible to host the demo somewhere? Any guide on this?
>
> Thanks for help,
> Kishankumar Mehta
>
> --
> 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/CAC5ThKGDtC%2B6DrGB6P%3Dn3%3D90PeapaGWyjFSBkqr66UdaxNwpZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAC5ThKGDtC%2B6DrGB6P%3Dn3%3D90PeapaGWyjFSBkqr66UdaxNwpZw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADDzk72OOq-G%3D%3Dx2MUUZWArY64PnvNEKi8PV2jkSnkvfNJ-A%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Host a web application

2015-04-22 Thread Kishan Mehta
Hi ,

I have to show my web application project work to a potential employer.
Is it possible to host the demo somewhere? Any guide on this?

Thanks for help,
Kishankumar Mehta

-- 
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/CAC5ThKGDtC%2B6DrGB6P%3Dn3%3D90PeapaGWyjFSBkqr66UdaxNwpZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread Filipe Ximenes
Yes, you can develop a website were some data is processed and presented in
the template by the backend, and some is fetched using AJAX
(Javascript/Angular) from the frontend.

I do not know a specific tutorial to point you, but from a quick search,
this one seems to cover a lot of things:
https://thinkster.io/django-angularjs-tutorial/

On Thu, Apr 16, 2015 at 5:03 PM, 백병화 <barkb...@gmail.com> wrote:

>
>>
> Thank you very much for the professional advice :)
>
> I have more questions..
>
> Is there a way to develop a web site by combining MPA and SPA ?
>
> And..
>
> Can you please recommend a tutorial of django+angularjs that is about
> configuration, building structure, and etc for dividing backend and
> frontend ?
>
>>   --
> 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/61b3252f-679e-4918-9309-4811a6001102%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/61b3252f-679e-4918-9309-4811a6001102%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB3uqiMy6qWxZRbgKwk92dMT%3DL003tYqPVSgycnezpK44w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread 백병화

>
>
>  
Thank you very much for the professional advice :)

I have more questions..

Is there a way to develop a web site by combining MPA and SPA ? 

And..

Can you please recommend a tutorial of django+angularjs that is about 
configuration, building structure, and etc for dividing backend and 
frontend ?

>  

-- 
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/61b3252f-679e-4918-9309-4811a6001102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread Filipe Ximenes
1) The Facebook WEBSITE is a MPA, but some of it's content is loaded via
ajax (like the newsfeed). The Facebook mobile app is a native application.
The Android one is developed in Java, and the iOS is developed in Objectve-C

2) If you use a cross-paltform framework like Cordova you will be
programming in HTML/CSS and Javascript. The framework will handle the
generation of the apps for each platform from your javascript code.
HTML/CSS will define how the app looks and Javascript will handle fetching
data from the server and presenting it on the app. AngularJS is a
Javascript framework that give you some nice tools, but you are free to
chose between using it or not.

3) There's no such a thing as "the best cross-platform to fit DRF". The
backend (Django/DRF) will handle storing and processing data, and the
mobile app will fetch data from the backend and show it to the user. The
platform you will use and the backend are separated things and do not
interfere within each other.
About using native or cross-platform, I expressed MY OPNION in the second
email of the last message:
https://groups.google.com/forum/#!topic/django-users/B8v9wjR4-M0
But this is a polemic subject, other people may have different opinions
about it.

On Thu, Apr 16, 2015 at 4:12 PM, 백병화 <barkb...@gmail.com> wrote:

> Thank you very much for replying my question.
> I'm a student in Korea, so my english grammar is not good. I'm sorry for
> that.
>
> I'm wondering to create a web site as Facebook.
>
> I have 3 questions.
>
> 1) Is facebook developed as SPA? or Is it developed as SPA+MPA ?
>
> 2) Last time, I understood as when I use DRF with Angularjs, it is not
> needed to make front-end for Android/iOS. Did I misunderstand about it ?
>
> 3) If I need to develop front-end for iOS/Android, I'm curious what
> cross-platform is the best to fit DRF. Also I'm curious whether the
> cross-platform is good when it is compared to Native Apps.
>
> Thank you for replying!
>
> --
> 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/cb9633d6-5571-45c1-91c0-a1118faf7e26%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/cb9633d6-5571-45c1-91c0-a1118faf7e26%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB1P4GNcUL5txKUAGGjAtY17uC-Xdb0nzF7onoHa3E%2BRcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread 백병화
Thank you very much for replying my question.
I'm a student in Korea, so my english grammar is not good. I'm sorry for
that.

I'm wondering to create a web site as Facebook.

I have 3 questions.

1) Is facebook developed as SPA? or Is it developed as SPA+MPA ?

2) Last time, I understood as when I use DRF with Angularjs, it is not
needed to make front-end for Android/iOS. Did I misunderstand about it ?

3) If I need to develop front-end for iOS/Android, I'm curious what
cross-platform is the best to fit DRF. Also I'm curious whether the
cross-platform is good when it is compared to Native Apps.

Thank you for replying!

2015-04-17 3:51 GMT+09:00 Filipe Ximenes <filipexime...@gmail.com>:

> Hi,
>
> I think I partially answered this to you in your previous question:
> https://groups.google.com/forum/#!topic/django-users/B8v9wjR4-M0
> Can you tell me if you didn't understand something?
>
> Mobile and AngularJS apps don't work exactly the same as a normal web
> page. While in a normal web page, the frontend (what the user sees) is
> processed in the backend (django) and sent to the user, in a Mobile or
> AngularJS app, the frontend is already in the user device and it only
> fetches the data to fill in the frontend.
> The default Django behaviour is to work with "normal web pages", but when
> you use Django REST Framework it makes it easy to develop APIs and return
> JSON data (JSON is one of the most popular data formats).
>
> Now, normal iOS apps are build in Objective-C, normal Android apps are
> developed in Java. But it's possible to built both iOS and Android apps
> using Javascript, some of the frameworks that do this are:
> Cordova/Phonegap, Titanium and Ionic (witch is AngularJS compatible).
>
> There are lots of tutorials in the interned for all this technologies.
> This is pretty much the basics of how this works. Feel free to ask more
> specific questions if you need more detailed response.
>
>
>
> On Thu, Apr 16, 2015 at 1:25 PM, 백병화 <barkb...@gmail.com> wrote:
>
>> I want to develop a web site and mobile apps(iOS/Android) as Facebook.by
>> using Django REST Framework AND Angularjs.
>> I'm confused about what steps should I follow..
>>
>>  --
>> 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/f26fe122-e66f-4760-ad2c-9a74e60d5238%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f26fe122-e66f-4760-ad2c-9a74e60d5238%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
>
> *Filipe Ximenes*+55 (81) 8245-9204
>
> *Vinta Software Studio*http://www.vinta.com.br
>
> --
> 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/sxQQPGwH2KQ/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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA-QWB3K%3D9vwXVvrHSOezO7yN7MZ1fbrgeq2R3pQdsmpr1BTxA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA-QWB3K%3D9vwXVvrHSOezO7yN7MZ1fbrgeq2R3pQdsmpr1BTxA%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbMFOTy4c6v1txwpFtqx0-rvwVwhQJUQj6osGrQJfYjbQ3KTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread 백병화


Thank you very much for replying my question.
I'm a student in Korea, so my english grammar is not good. I'm sorry for 
that. 

I'm wondering to create a web site as Facebook.

I have 3 questions.

1) Is facebook developed as SPA? or Is it developed as SPA+MPA ?

2) Last time, I understood as when I use DRF with Angularjs, it is not 
needed to make front-end for Android/iOS. Did I misunderstand about it ?

3) If I need to develop front-end for iOS/Android, I'm curious what 
cross-platform is the best to fit DRF. Also I'm curious whether the 
cross-platform is good when it is compared to Native Apps.

Thank you for replying!

-- 
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/cb9633d6-5571-45c1-91c0-a1118faf7e26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread Filipe Ximenes
Hi,

I think I partially answered this to you in your previous question:
https://groups.google.com/forum/#!topic/django-users/B8v9wjR4-M0
Can you tell me if you didn't understand something?

Mobile and AngularJS apps don't work exactly the same as a normal web page.
While in a normal web page, the frontend (what the user sees) is processed
in the backend (django) and sent to the user, in a Mobile or AngularJS app,
the frontend is already in the user device and it only fetches the data to
fill in the frontend.
The default Django behaviour is to work with "normal web pages", but when
you use Django REST Framework it makes it easy to develop APIs and return
JSON data (JSON is one of the most popular data formats).

Now, normal iOS apps are build in Objective-C, normal Android apps are
developed in Java. But it's possible to built both iOS and Android apps
using Javascript, some of the frameworks that do this are:
Cordova/Phonegap, Titanium and Ionic (witch is AngularJS compatible).

There are lots of tutorials in the interned for all this technologies.
This is pretty much the basics of how this works. Feel free to ask more
specific questions if you need more detailed response.



On Thu, Apr 16, 2015 at 1:25 PM, 백병화 <barkb...@gmail.com> wrote:

> I want to develop a web site and mobile apps(iOS/Android) as Facebook.by
> using Django REST Framework AND Angularjs.
> I'm confused about what steps should I follow..
>
>  --
> 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/f26fe122-e66f-4760-ad2c-9a74e60d5238%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f26fe122-e66f-4760-ad2c-9a74e60d5238%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB3K%3D9vwXVvrHSOezO7yN7MZ1fbrgeq2R3pQdsmpr1BTxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How should I develop a web site and mobile apps(iOS/Android) as Facebook(using DRF + Angularjs)?

2015-04-16 Thread 백병화
I want to develop a web site and mobile apps(iOS/Android) as Facebook.by 
using Django REST Framework AND Angularjs.
I'm confused about what steps should I follow..

-- 
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/f26fe122-e66f-4760-ad2c-9a74e60d5238%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Thank you all for your input. It turns out my settings file was improperly
configured. I needed to change MEDIA_ROOT and MEDIA_URL

On Tue, Apr 7, 2015 at 12:30 PM, Luis Zárate <luisz...@gmail.com> wrote:

> Hi,
>
> Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file,
> for production used static deploy strategy, see the documentation about
> static files.
>
> Model file field has an url attribute that return a media url, you use in
> template like {{obj.file.url}}
>
>
> El martes, 7 de abril de 2015, Stephanie Socias <stephsoc...@gmail.com>
> escribió:
> > Do I need to update/add something to my urls.py?
> >
> > On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
> >>
> >> Thank you very much for responding, Daniel.
> >>
> >> I'm sorry I don't quite follow- I've never done this before. I should
> use the URL {{ datamine.image.url }} in the template?
> >>
> >> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk>
> wrote:
> >>>
> >>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
> >>>>
> >>>> I've implemented this same solution (using custom file storage and
> the "upload_to" parameter) but now cannot get the uploaded files to display
> from my template. I would normally use {{ STATIC_URL }} but, since I've now
> specified a custom location, I'm not sure why my path, which I've
> hard-coded in the template, isn't working...any ideas?
> >>>>
> >>>> fs = FileSystemStorage(location='/data/www/upload')
> >>>>
> >>>> def image_location(instance, filename):
> >>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
> >>>>
> >>>> class DataModel(models.Model):
> >>>> name = models.CharField()
> >>>> date = models.DateField(blank=True)
> >>>> image = models.ImageField(storage=fs, upload_to=image_location,
> blank=True)
> >>>>
> >>>> template.html
> >>>>
> >>>> 
> >>>> 
> >>>> 
> >>>
> >>> But /data/www/upload/... is the file path of your upload, not the URL.
> You still need an actual URL that is served by your webserver. Obviously, a
> browser can't access arbitrary file paths on your server.
> >>> --
> >>> DR.
> >>>
> >>> --
> >>> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
> >>> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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+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/b015d26d-c95a-4435-bd93-107244d5a798%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 a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAG%2B5VyNHO5H1m_dtE3WVrPE4FgSZ%3D%3Dckj-YFZWdoEWVxU4AKgA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyNHO5H1m_dtE3WVrPE4FgSZ%3D%3Dckj-YFZWdoEWVxU4AKgA%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOw%3DD6Wod%3DGaReJsjbieHODQtJxy%3DG_kX7uztxWYp3FoVRT7-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
You are not set base_url in FileSystemStorage so you are using MEDIA_URL by
default.

The imagefield url property is called like this

def _get_url(self):
self._require_file() # check if It is an object
return self.storage.url(self.name)
url = property(_get_url)

And self.storage.url throw exception if base_url is not set.


def url(self, name):
if self.base_url is None:
raise ValueError("This file is not accessible via a URL.")
return urljoin(self.base_url, filepath_to_uri(name))

So, I should try to call datamine.image.url() in shell and see what happen


2015-04-07 10:47 GMT-06:00 Stephanie Socias <stephsoc...@gmail.com>:

> Hi Luis,
>
> Yes, I used {{ datamine.image.url }} in my template but it doesn't work.
> I'm not sure how to format my urls.py since I haven't changed the MEDIA_URL
> and MEDIA_ROOT. I want to upload these images to a location not in my
> MEDIA_ROOT...?
>
> This is my urls.py:
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'tt.views.home', name='home'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> url(r'^', include('myproj.urls', namespace='myproj')),
> ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
> On Tue, Apr 7, 2015 at 12:30 PM, Luis Zárate <luisz...@gmail.com> wrote:
>
>> Hi,
>>
>> Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded
>> file, for production used static deploy strategy, see the documentation
>> about static files.
>>
>> Model file field has an url attribute that return a media url, you use in
>> template like {{obj.file.url}}
>>
>>
>> El martes, 7 de abril de 2015, Stephanie Socias <stephsoc...@gmail.com>
>> escribió:
>> > Do I need to update/add something to my urls.py?
>> >
>> > On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
>> >>
>> >> Thank you very much for responding, Daniel.
>> >>
>> >> I'm sorry I don't quite follow- I've never done this before. I should
>> use the URL {{ datamine.image.url }} in the template?
>> >>
>> >> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk>
>> wrote:
>> >>>
>> >>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>> >>>>
>> >>>> I've implemented this same solution (using custom file storage and
>> the "upload_to" parameter) but now cannot get the uploaded files to display
>> from my template. I would normally use {{ STATIC_URL }} but, since I've now
>> specified a custom location, I'm not sure why my path, which I've
>> hard-coded in the template, isn't working...any ideas?
>> >>>>
>> >>>> fs = FileSystemStorage(location='/data/www/upload')
>> >>>>
>> >>>> def image_location(instance, filename):
>> >>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
>> >>>>
>> >>>> class DataModel(models.Model):
>> >>>> name = models.CharField()
>> >>>> date = models.DateField(blank=True)
>> >>>> image = models.ImageField(storage=fs, upload_to=image_location,
>> blank=True)
>> >>>>
>> >>>> template.html
>> >>>>
>> >>>> 
>> >>>> 
>> >>>> 
>> >>>
>> >>> But /data/www/upload/... is the file path of your upload, not the
>> URL. You still need an actual URL that is served by your webserver.
>> Obviously, a browser can't access arbitrary file paths on your server.
>> >>> --
>> >>> DR.
>> >>>
>> >>> --
>> >>> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
>> >>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%40googlegroups.com
>> .
>> >>> For more options, visit https://groups.go

Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Hi Luis,

Yes, I used {{ datamine.image.url }} in my template but it doesn't work.
I'm not sure how to format my urls.py since I haven't changed the MEDIA_URL
and MEDIA_ROOT. I want to upload these images to a location not in my
MEDIA_ROOT...?

This is my urls.py:
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tt.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

url(r'^admin/', include(admin.site.urls)),
url(r'^', include('myproj.urls', namespace='myproj')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

On Tue, Apr 7, 2015 at 12:30 PM, Luis Zárate <luisz...@gmail.com> wrote:

> Hi,
>
> Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file,
> for production used static deploy strategy, see the documentation about
> static files.
>
> Model file field has an url attribute that return a media url, you use in
> template like {{obj.file.url}}
>
>
> El martes, 7 de abril de 2015, Stephanie Socias <stephsoc...@gmail.com>
> escribió:
> > Do I need to update/add something to my urls.py?
> >
> > On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
> >>
> >> Thank you very much for responding, Daniel.
> >>
> >> I'm sorry I don't quite follow- I've never done this before. I should
> use the URL {{ datamine.image.url }} in the template?
> >>
> >> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk>
> wrote:
> >>>
> >>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
> >>>>
> >>>> I've implemented this same solution (using custom file storage and
> the "upload_to" parameter) but now cannot get the uploaded files to display
> from my template. I would normally use {{ STATIC_URL }} but, since I've now
> specified a custom location, I'm not sure why my path, which I've
> hard-coded in the template, isn't working...any ideas?
> >>>>
> >>>> fs = FileSystemStorage(location='/data/www/upload')
> >>>>
> >>>> def image_location(instance, filename):
> >>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
> >>>>
> >>>> class DataModel(models.Model):
> >>>> name = models.CharField()
> >>>> date = models.DateField(blank=True)
> >>>> image = models.ImageField(storage=fs, upload_to=image_location,
> blank=True)
> >>>>
> >>>> template.html
> >>>>
> >>>> 
> >>>> 
> >>>> 
> >>>
> >>> But /data/www/upload/... is the file path of your upload, not the URL.
> You still need an actual URL that is served by your webserver. Obviously, a
> browser can't access arbitrary file paths on your server.
> >>> --
> >>> DR.
> >>>
> >>> --
> >>> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
> >>> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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+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/b015d26d-c95a-4435-bd93-107244d5a798%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 a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/aHa0WWHGreY/unsubscribe.
> To unsubsc

Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
Hi,

Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file,
for production used static deploy strategy, see the documentation about
static files.

Model file field has an url attribute that return a media url, you use in
template like {{obj.file.url}}


El martes, 7 de abril de 2015, Stephanie Socias <stephsoc...@gmail.com>
escribió:
> Do I need to update/add something to my urls.py?
>
> On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
>>
>> Thank you very much for responding, Daniel.
>>
>> I'm sorry I don't quite follow- I've never done this before. I should
use the URL {{ datamine.image.url }} in the template?
>>
>> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk>
wrote:
>>>
>>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>>>>
>>>> I've implemented this same solution (using custom file storage and the
"upload_to" parameter) but now cannot get the uploaded files to display
from my template. I would normally use {{ STATIC_URL }} but, since I've now
specified a custom location, I'm not sure why my path, which I've
hard-coded in the template, isn't working...any ideas?
>>>>
>>>> fs = FileSystemStorage(location='/data/www/upload')
>>>>
>>>> def image_location(instance, filename):
>>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
>>>>
>>>> class DataModel(models.Model):
>>>> name = models.CharField()
>>>> date = models.DateField(blank=True)
>>>> image = models.ImageField(storage=fs, upload_to=image_location,
blank=True)
>>>>
>>>> template.html
>>>>
>>>> 
>>>> 
>>>> 
>>>
>>> But /data/www/upload/... is the file path of your upload, not the URL.
You still need an actual URL that is served by your webserver. Obviously, a
browser can't access arbitrary file paths on your server.
>>> --
>>> DR.
>>>
>>> --
>>> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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+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/b015d26d-c95a-4435-bd93-107244d5a798%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/CAG%2B5VyNHO5H1m_dtE3WVrPE4FgSZ%3D%3Dckj-YFZWdoEWVxU4AKgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Do I need to update/add something to my urls.py?

On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
>
> Thank you very much for responding, Daniel.
>
> I'm sorry I don't quite follow- I've never done this before. I should use 
> the URL {{ datamine.image.url }} in the template? 
>
> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk> 
> wrote:
>
>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>>>
>>> I've implemented this same solution (using custom file storage and the 
>>> "upload_to" parameter) but now cannot get the uploaded files to display 
>>> from my template. I would normally use {{ STATIC_URL }} but, since I've now 
>>> specified a custom location, I'm not sure why my path, which I've 
>>> hard-coded in the template, isn't working...any ideas?
>>>
>>> fs = FileSystemStorage(location='/data/www/upload')
>>> def image_location(instance, filename):
>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
>>> class DataModel(models.Model):
>>> name = models.CharField()
>>> date = models.DateField(blank=True)  
>>> image = models.ImageField(storage=fs, upload_to=image_location, 
>>> blank=True)
>>>
>>> template.html
>>>
>>> 
>>> 
>>>
>>>
>> But /data/www/upload/... is the file path of your upload, not the URL. 
>> You still need an actual URL that is served by your webserver. Obviously, a 
>> browser can't access arbitrary file paths on your server.
>> --
>> DR. 
>>
>> -- 
>> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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 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/b015d26d-c95a-4435-bd93-107244d5a798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Stephanie Socias
Thank you very much for responding, Daniel.

I'm sorry I don't quite follow- I've never done this before. I should use
the URL {{ datamine.image.url }} in the template?

On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman <dan...@roseman.org.uk>
wrote:

> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>>
>> I've implemented this same solution (using custom file storage and the
>> "upload_to" parameter) but now cannot get the uploaded files to display
>> from my template. I would normally use {{ STATIC_URL }} but, since I've now
>> specified a custom location, I'm not sure why my path, which I've
>> hard-coded in the template, isn't working...any ideas?
>>
>> fs = FileSystemStorage(location='/data/www/upload')
>> def image_location(instance, filename):
>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
>> class DataModel(models.Model):
>> name = models.CharField()
>> date = models.DateField(blank=True)
>> image = models.ImageField(storage=fs, upload_to=image_location, 
>> blank=True)
>>
>> template.html
>>
>> 
>> 
>>
>>
> But /data/www/upload/... is the file path of your upload, not the URL. You
> still need an actual URL that is served by your webserver. Obviously, a
> browser can't access arbitrary file paths on your server.
> --
> DR.
>
> --
> 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/aHa0WWHGreY/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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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 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/CAOw%3DD6XU%2BQmk8ZoqJXoFuAtFzKvZG487_eUZ%3DkkyphQDdVgN3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Daniel Roseman
On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>
> I've implemented this same solution (using custom file storage and the 
> "upload_to" parameter) but now cannot get the uploaded files to display 
> from my template. I would normally use {{ STATIC_URL }} but, since I've now 
> specified a custom location, I'm not sure why my path, which I've 
> hard-coded in the template, isn't working...any ideas?
>
> fs = FileSystemStorage(location='/data/www/upload')
> def image_location(instance, filename):
> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
> class DataModel(models.Model):
> name = models.CharField()
> date = models.DateField(blank=True)  
> image = models.ImageField(storage=fs, upload_to=image_location, 
> blank=True)
>
> template.html
>
> 
> 
>
>
But /data/www/upload/... is the file path of your upload, not the URL. You 
still need an actual URL that is served by your webserver. Obviously, a 
browser can't access arbitrary file paths on your server.
--
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/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-06 Thread Stephanie Socias
I've implemented this same solution (using custom file storage and the 
"upload_to" parameter) but now cannot get the uploaded files to display 
from my template. I would normally use {{ STATIC_URL }} but, since I've now 
specified a custom location, I'm not sure why my path, which I've 
hard-coded in the template, isn't working...any ideas?

fs = FileSystemStorage(location='/data/www/upload')
def image_location(instance, filename):
return '/'.join(['thumbnails', str(instance.dataset_id), filename])
class DataModel(models.Model):
name = models.CharField()
date = models.DateField(blank=True)  
image = models.ImageField(storage=fs, upload_to=image_location, blank=True)

template.html







On Thursday, September 30, 2010 at 12:45:42 PM UTC-4, Federico Capoano 
wrote:
>
> I wanted to write this post anyway, gives a quick solution to upload 
> files above the public directory and serve the files with django- 
> filetransfers. Hopefully it will be easier to find from search 
> engines. 
>
>
> http://nemesisdesign.net/blog/coding/django-private-file-upload-and-serving/ 
>
>
>
>
> On Sep 30, 10:40 am, Xavier Ordoquy <xordo...@linovia.com> wrote: 
> > Hi, 
> > 
> > To me, it looks like the documentation already gave the answer. 
> > 
> > Regards, 
> > Xavier. 
> > 
> > Le 30 sept. 2010 à 10:37, Federico Capoano a écrit : 
> > 
> > 
> > 
> > > PS: i'll post a solution so other noobs like me will see how to do 
> > > that.. 
> > 
> > > On 30 Set, 10:35, Federico Capoano <nemesis.des...@libero.it> wrote: 
> > >> Yes you're right, I'm trying it out. I'll post a solution when I'm 
> > >> done. 
> > 
> > >> On 30 Set, 10:10, Xavier Ordoquy <xordo...@linovia.com> wrote: 
> > 
> > >>> Well, the documentation already tells you about it:
> http://docs.djangoproject.com/en/1.2/topics/files/#the-built-in-files... 
> > 
> > >>> Le 30 sept. 2010 à 09:49, Federico Capoano a écrit : 
> > 
> > >>>> Is this not possible? I wonder why Django force to upload files 
> only 
> > >>>> in a certain directory and doesn't allow more flexibility. 
> > 
> > >>>> On 29 Set, 19:46, Federico Capoano <nemesis.des...@libero.it> 
> wrote: 
> > >>>>> Hi everyone, 
> > 
> > >>>>> is it possible to write a custom model filefield that upload files 
> > >>>>> somewhere above the public directory? 
> > 
> > >>>> -- 
> > >>>> You received this message because you are subscribed to the Google 
> Groups "Django users" group. 
> > >>>> To post to this group, send email to django...@googlegroups.com 
> . 
> > >>>> To unsubscribe from this group, send email to 
> django-users...@googlegroups.com . 
> > >>>> For more options, visit this group athttp://
> 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...@googlegroups.com 
> . 
> > > To unsubscribe from this group, send email to 
> django-users...@googlegroups.com . 
> > > For more options, visit this group athttp://
> groups.google.com/group/django-users?hl=en.

-- 
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/549c35ee-f40c-4b4f-814a-d70c42eff1de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-19 Thread SHINTO PETER
Thank you James Schneider & Andrew Farrell

On Wednesday, 18 March 2015 21:46:33 UTC+5:30, SHINTO PETER wrote:
>
> How to make request ie GET/POST  to soap (windows web service ) in Django?
>

-- 
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/2632a791-21bf-4bf9-98cb-03250bb7bca2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread James Schneider
I would recommend that you use the suds-jurko fork. It should be a drop in
replacement for the suds library available via pip, but is actively
maintained. The original suds library looks to be abandoned and has some
issues parsing current WSDL definition files that suds-jurko can handle.

-James
On Mar 18, 2015 9:32 AM, "Andrew Farrell" <armorsmit...@gmail.com> wrote:

> Based on a brief search but no personal experience, SUDS
> <https://fedorahosted.org/suds/wiki/Documentation> looks like the best
> python library for making requests to an existing SOAP server.
>
> On Wed, Mar 18, 2015 at 11:16 AM, SHINTO PETER <shinto@gmail.com>
> wrote:
>
>> How to make request ie GET/POST  to soap (windows web service ) in Django?
>>
>> --
>> 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/6174dbf9-8a58-4aff-b1bd-5a11e2c8e7b8%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/6174dbf9-8a58-4aff-b1bd-5a11e2c8e7b8%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 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/CA%2By5TLaDZS2O-rtFYpJ8kqJc5Nfvk3Dy%2BEmF1LmRdGBxCbwjXQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2By5TLaDZS2O-rtFYpJ8kqJc5Nfvk3Dy%2BEmF1LmRdGBxCbwjXQ%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXCJBR1ZQSvmqFPXZeo3ugtNzsY0nV72J3Gchh5967M6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread Andrew Farrell
Based on a brief search but no personal experience, SUDS
<https://fedorahosted.org/suds/wiki/Documentation> looks like the best
python library for making requests to an existing SOAP server.

On Wed, Mar 18, 2015 at 11:16 AM, SHINTO PETER <shinto@gmail.com> wrote:

> How to make request ie GET/POST  to soap (windows web service ) in Django?
>
> --
> 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/6174dbf9-8a58-4aff-b1bd-5a11e2c8e7b8%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6174dbf9-8a58-4aff-b1bd-5a11e2c8e7b8%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 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/CA%2By5TLaDZS2O-rtFYpJ8kqJc5Nfvk3Dy%2BEmF1LmRdGBxCbwjXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to make request ie GET/POST to soap (windows web service ) in Django?

2015-03-18 Thread SHINTO PETER
How to make request ie GET/POST  to soap (windows web service ) in Django?

-- 
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/6174dbf9-8a58-4aff-b1bd-5a11e2c8e7b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embedding a compiler to my web page

2015-03-07 Thread Russell Keith-Magee
If you're going to be compiling code, you almost certainly don't want to be
using subprocess for this. A view should be able to return in milliseconds.
Very few native code compilations are going to be complete in milliseconds.

What you should be doing is treating the compilation step as a compilation
task:

 1) User submits code for compilation. This creates a compilation task in
state "Pending"

 2) A second process, completely external to your web server sits waiting
for new "pending" tasks; when a new task arrives, it is taken off the
queue, and moved to a "compiling" state.

 3) The user has the ability to refresh the status of the tasks they have
submitted. This could be auto-refreshed, or left as something that the user
can hit reload to see the current state.

 4) When the compilation completes, the state moves to "Done", and the user
can see the result.

This external process is called a task queue; there are lots of ways of
managing this; two relatively easy options are RQ (a simple Redis-based
queue) and Celery (a more complete option; harder to get going, but more
reliable and configurable under heavy load).

Also - as a security warning - if you're going to be exposing the ability
to compile code on the internet, be prepared to be exploited. Compilers can
do lots of things, and you're going to be giving  permission to compile
arbitrary code to anyone who can submit a compilation task. You will need
to be *extremely* careful about how you set up the compilation tools to
make sure they are adequately sandboxed.

Yours,
Russ Magee %-)

On Sun, Mar 8, 2015 at 12:08 AM, luis zarate <luisz...@gmail.com> wrote:

> You should want to read about subprocess
>
> https://docs.python.org/3.4/library/subprocess.html
>
> Install your favorite compiler and call it with subprocess as a comand
> line program.
>
> 2015-03-07 9:01 GMT-06:00 Snehasish Sen <sen.snehasis...@gmail.com>:
>
> How can I embed a c/c++ compiler to my site which can host a programming
>> competetion
>>
>> --
>> 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/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/CAG%2B5VyM2yKJDZXLnndEHn%3DoVn1siTeVOeh5YsNuh5hwan2VFLw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyM2yKJDZXLnndEHn%3DoVn1siTeVOeh5YsNuh5hwan2VFLw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84-h-6L1hO%3Dq-tt237Tnq87Xq4d2Kzcms3%2B--2RYkjCCMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embedding a compiler to my web page

2015-03-07 Thread luis zarate
You should want to read about subprocess

https://docs.python.org/3.4/library/subprocess.html

Install your favorite compiler and call it with subprocess as a comand line
program.

2015-03-07 9:01 GMT-06:00 Snehasish Sen <sen.snehasis...@gmail.com>:

> How can I embed a c/c++ compiler to my site which can host a programming
> competetion
>
> --
> 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/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAG%2B5VyM2yKJDZXLnndEHn%3DoVn1siTeVOeh5YsNuh5hwan2VFLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Embedding a compiler to my web page

2015-03-07 Thread Snehasish Sen
How can I embed a c/c++ compiler to my site which can host a programming 
competetion

-- 
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/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a grammar checker on the web

2015-02-16 Thread Ricardo Daniel Quiroga
security disable CORS, and add CSRF tokken verification..
if only going to implement the grammar interpreter is way too django uses
something simpler like bottle or flask

2015-02-16 16:02 GMT-03:00 Ricardo Daniel Quiroga <l2radamant...@gmail.com>:

> Hi
>
> html + textarea + javascript +  AJAX?
>
>
>
> 2015-02-16 9:58 GMT-03:00 Kelvin Nyota <kamaunyr...@gmail.com>:
>
> I have built a grammar checker in Python. It works well in the terminal,
>> but i don't know how to implement it on the web. How can I implement a
>> grammar checker on the web, like Grammarly or spellcheckerplus? I could not
>> find any article that talked about that at all.Most of it was errelevant.
>> Infact, what I have done with Javascript for my grammarchecker
>> <http://researchpaperstobuy.com/grammarchecker.html> interface is
>> better. Please help guys.
>>
>> I will not need a database because I have a text file for replacing
>> words. What I don't know is if I will need some sort of a server to
>> communicate back and forth for reading, checking, and retrieving. The link
>> on the grammar checker button should also be protected to prevent people
>> from using my code to do their grammar checking functionality on their
>> websites.
>>
>> --
>> 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/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Ricardo Daniel Quiroga
>
>


-- 

Ricardo Daniel Quiroga

-- 
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/CAO2-wHYCgf0aw-NuL3yNKRnrzUZLca6nJgfzn4n-zzVrcH%3D2Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a grammar checker on the web

2015-02-16 Thread Ricardo Daniel Quiroga
Hi

html + textarea + javascript +  AJAX?



2015-02-16 9:58 GMT-03:00 Kelvin Nyota <kamaunyr...@gmail.com>:

> I have built a grammar checker in Python. It works well in the terminal,
> but i don't know how to implement it on the web. How can I implement a
> grammar checker on the web, like Grammarly or spellcheckerplus? I could not
> find any article that talked about that at all.Most of it was errelevant.
> Infact, what I have done with Javascript for my grammarchecker
> <http://researchpaperstobuy.com/grammarchecker.html> interface is better.
> Please help guys.
>
> I will not need a database because I have a text file for replacing words.
> What I don't know is if I will need some sort of a server to communicate
> back and forth for reading, checking, and retrieving. The link on the
> grammar checker button should also be protected to prevent people from
> using my code to do their grammar checking functionality on their websites.
>
> --
> 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/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Ricardo Daniel Quiroga

-- 
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/CAO2-wHZTSdZSv0yPw27eNuXFi5UyyyRX9r33UXyrkYFGfrdb5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Implementing a grammar checker on the web

2015-02-16 Thread Kelvin Nyota
 

I have built a grammar checker in Python. It works well in the terminal, 
but i don't know how to implement it on the web. How can I implement a 
grammar checker on the web, like Grammarly or spellcheckerplus? I could not 
find any article that talked about that at all.Most of it was errelevant. 
Infact, what I have done with Javascript for my grammarchecker 
<http://researchpaperstobuy.com/grammarchecker.html> interface is better. 
Please help guys.

I will not need a database because I have a text file for replacing words. 
What I don't know is if I will need some sort of a server to communicate 
back and forth for reading, checking, and retrieving. The link on the 
grammar checker button should also be protected to prevent people from 
using my code to do their grammar checking functionality on their websites.

-- 
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/b7817512-cdad-460d-b0b9-a643e303d490%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django web hosts in Canada

2015-01-30 Thread jogaserbia
Hi All,

Thanks for the ideas.  I'll consider the suggestions.

Ivan

-- 
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/f9862c63-ed67-44e1-80cf-4606221f2c3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django web hosts in Canada

2015-01-30 Thread Carlos Carcamo
Why don't you try Digitalocean?
Take a look at those articles:
https://www.digitalocean.com/community/tutorials/how-to-use-the-django-one-click-install-image
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-django-with-postgres-nginx-and-gunicorn

If you want $10 credit on digitalocean, use this link for register your
account
https://www.digitalocean.com/?refcode=b049a5d14734


2015-01-29 13:28 GMT-06:00 Avraham Serour <tovm...@gmail.com>:

> look for a vps and not a shared hosting, something like what you would get
> with AWS
>
> on the downside you will need to do everything yourself (installing and
> configuring all the libraries, updating the server etc)
>
> on the plus side it will be more flexible, it will support anything you
> would like
>
> On Thu, Jan 29, 2015 at 5:09 PM, jogaserbia <ivanjanko...@live.ca> wrote:
>
>> Hi All,
>>
>> I would like to deploy my first Django website in the next month or so.
>> I am looking at deployment options, but need some clarification.
>>
>> 1) when id doesn't matter where the servers are
>>
>> I understand that  in terms of PASS: heroku, AWS, and Google elastic
>> beanstalk can all handle Django (python) and postres.
>>
>> If I want to host on a 'normal' hosting service, which would be
>> available? greengeeks just told me that they support Python but not Django,
>> which confused me because I thought Django was fully written in Python, so
>> I am clearly not understanding the complexities of deploying.  Also, they
>> only use MYSQL databases, I wrote my first app using Postgres/POSTGIS as
>> the database.
>>
>> 2) when I need servers in Canada
>>
>> Due to privacy concerns, I may need to use servers that are exclusively
>> in Canada.  I cannot seem to find any options on how to host Python/Django
>> and postres on Canadian servers.  Does anyone have any pointers on that?
>>
>>
>> Any advice would be appreciated, as this will be my first run at
>> deploying.
>>
>> I have been through the heroku example, and it seems nice and easy to
>> deploy and I can use Django and they use postgres.
>>
>> Ivan
>>
>> --
>> 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/d489e516-94d8-46e2-a212-438faa404452%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/d489e516-94d8-46e2-a212-438faa404452%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 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/CAFWa6tLOviREvHPDT_G8K_q4E_g_NrpQuPuKKDHguE0ra%3D6isw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFWa6tLOviREvHPDT_G8K_q4E_g_NrpQuPuKKDHguE0ra%3D6isw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"El desarrollo no es material es un estado de conciencia mental"

-- 
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/CADpTsTbSdK6QQK%2BD6Fr1%2Bh2Cyieait3e3poageoX6mh3VV-cXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django web hosts in Canada

2015-01-29 Thread Avraham Serour
look for a vps and not a shared hosting, something like what you would get
with AWS

on the downside you will need to do everything yourself (installing and
configuring all the libraries, updating the server etc)

on the plus side it will be more flexible, it will support anything you
would like

On Thu, Jan 29, 2015 at 5:09 PM, jogaserbia <ivanjanko...@live.ca> wrote:

> Hi All,
>
> I would like to deploy my first Django website in the next month or so.  I
> am looking at deployment options, but need some clarification.
>
> 1) when id doesn't matter where the servers are
>
> I understand that  in terms of PASS: heroku, AWS, and Google elastic
> beanstalk can all handle Django (python) and postres.
>
> If I want to host on a 'normal' hosting service, which would be available?
> greengeeks just told me that they support Python but not Django, which
> confused me because I thought Django was fully written in Python, so I am
> clearly not understanding the complexities of deploying.  Also, they only
> use MYSQL databases, I wrote my first app using Postgres/POSTGIS as the
> database.
>
> 2) when I need servers in Canada
>
> Due to privacy concerns, I may need to use servers that are exclusively in
> Canada.  I cannot seem to find any options on how to host Python/Django and
> postres on Canadian servers.  Does anyone have any pointers on that?
>
>
> Any advice would be appreciated, as this will be my first run at deploying.
>
> I have been through the heroku example, and it seems nice and easy to
> deploy and I can use Django and they use postgres.
>
> Ivan
>
> --
> 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/d489e516-94d8-46e2-a212-438faa404452%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d489e516-94d8-46e2-a212-438faa404452%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 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/CAFWa6tLOviREvHPDT_G8K_q4E_g_NrpQuPuKKDHguE0ra%3D6isw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django web hosts in Canada

2015-01-29 Thread jogaserbia
Hi All,

I would like to deploy my first Django website in the next month or so.  I 
am looking at deployment options, but need some clarification.

1) when id doesn't matter where the servers are

I understand that  in terms of PASS: heroku, AWS, and Google elastic 
beanstalk can all handle Django (python) and postres.

If I want to host on a 'normal' hosting service, which would be available? 
greengeeks just told me that they support Python but not Django, which 
confused me because I thought Django was fully written in Python, so I am 
clearly not understanding the complexities of deploying.  Also, they only 
use MYSQL databases, I wrote my first app using Postgres/POSTGIS as the 
database.

2) when I need servers in Canada

Due to privacy concerns, I may need to use servers that are exclusively in 
Canada.  I cannot seem to find any options on how to host Python/Django and 
postres on Canadian servers.  Does anyone have any pointers on that?


Any advice would be appreciated, as this will be my first run at deploying.

I have been through the heroku example, and it seems nice and easy to 
deploy and I can use Django and they use postgres.  

Ivan

-- 
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/d489e516-94d8-46e2-a212-438faa404452%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Linking to multiple dynamic images from same web page

2015-01-19 Thread Derek
Thanks Mitesh

I thought it might be along those lines.  I have tried calling plt.close() 
just before I return from the plot creation function, but still get the 
same error.

Do you perhaps have a simple code example I can try and follow?  (I am 
already using the io module for the image storage.)

Derek


On Sunday, 18 January 2015 16:05:45 UTC+2, mitesh_django wrote:
>
> Hi Derek,
>
> I face same issue few months ago, what I did is I destroyed plot object 
> completely everytime the view is called and regenerated new plot everytime. 
> You can try that. There is an issue with matplotlib memory, which basically 
> usage same plot.
>
> Another solution could be try different cStringIO to store base64 encoded 
> image data, send that as response and at browser using javascript (
> data:image/png;base64).
>
>
>
> Thanks,
> With Best Regards,
>
> Mitesh Patel
>
> Senior Product Engineer
>
> Mobile: +91-9970 8575 39
> Email: mitesh.p...@gmail.com 
> LinkedIn : http://in.linkedin.com/in/miteshpatel11
>
>
> On 18 January 2015 at 19:23, Derek <game...@gmail.com > 
> wrote:
>
>> I have a situation which is puzzling.
>>
>> I have a web page that, when generated embeds links that look like:
>>
>> 
>> >  
>> line 1401, in xlabel
>> l =  gca().set_xlabel(s, *args, **kwargs)
>>   File 
>> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/pyplot.py",
>>  
>> line 803, in gca
>> ax =  gcf().gca(**kwargs)
>>   File 
>> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
>>  
>> line 1221, in gca
>> return self.add_subplot(1, 1, 1, **kwargs)
>>   File 
>> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
>>  
>> line 916, in add_subplot
>> self._axstack.add(key, a)
>>   File 
>> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
>>  
>> line 120, in add
>> Stack.remove(self, (key, a_existing))
>>   File 
>> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/cbook.py",
>>  
>> line 1343, in remove
>> raise ValueError('Unknown element o')
>> ValueError: Unknown element o
>>
>> I have googled for this error, but it seems fairly obscure and I am not 
>> sure how it relates to my situation.
>>
>> Any insights welcome!
>>
>> Thanks
>> Derek
>>
>>  -- 
>> 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/CAF1Wu3OfN9rmUKTDO%2BT%3DJan%3DF%3DLKODqQObds-tvME%3DUhL18fMw%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAF1Wu3OfN9rmUKTDO%2BT%3DJan%3DF%3DLKODqQObds-tvME%3DUhL18fMw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9c70be64-efdf-4bef-ba3d-e93dad32bc23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Linking to multiple dynamic images from same web page

2015-01-18 Thread Mitesh Patel
Hi Derek,

I face same issue few months ago, what I did is I destroyed plot object
completely everytime the view is called and regenerated new plot everytime.
You can try that. There is an issue with matplotlib memory, which basically
usage same plot.

Another solution could be try different cStringIO to store base64 encoded
image data, send that as response and at browser using javascript (
data:image/png;base64).



Thanks,
With Best Regards,

Mitesh Patel

Senior Product Engineer

Mobile: +91-9970 8575 39
Email: mitesh.patel1...@gmail.com
LinkedIn : http://in.linkedin.com/in/miteshpatel11


On 18 January 2015 at 19:23, Derek <gamesb...@gmail.com> wrote:

> I have a situation which is puzzling.
>
> I have a web page that, when generated embeds links that look like:
>
> 
>  line 1401, in xlabel
> l =  gca().set_xlabel(s, *args, **kwargs)
>   File
> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/pyplot.py",
> line 803, in gca
> ax =  gcf().gca(**kwargs)
>   File
> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
> line 1221, in gca
> return self.add_subplot(1, 1, 1, **kwargs)
>   File
> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
> line 916, in add_subplot
> self._axstack.add(key, a)
>   File
> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/figure.py",
> line 120, in add
> Stack.remove(self, (key, a_existing))
>   File
> "/home/gamesbook/.virtualenvs/dev/local/lib/python2.7/site-packages/matplotlib/cbook.py",
> line 1343, in remove
> raise ValueError('Unknown element o')
> ValueError: Unknown element o
>
> I have googled for this error, but it seems fairly obscure and I am not
> sure how it relates to my situation.
>
> Any insights welcome!
>
> Thanks
> Derek
>
>  --
> 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/CAF1Wu3OfN9rmUKTDO%2BT%3DJan%3DF%3DLKODqQObds-tvME%3DUhL18fMw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF1Wu3OfN9rmUKTDO%2BT%3DJan%3DF%3DLKODqQObds-tvME%3DUhL18fMw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD3RGrQWey-Yi2W-Qkc8JynCtBgqxQhv8f3rdH8%3DPZ2AsHT_Rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Linking to multiple dynamic images from same web page

2015-01-18 Thread Derek
I have a situation which is puzzling.

I have a web page that, when generated embeds links that look like:


http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF1Wu3OfN9rmUKTDO%2BT%3DJan%3DF%3DLKODqQObds-tvME%3DUhL18fMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need some advice on how to go about building a real time web app.

2015-01-15 Thread Shazwi Suwandi
Hi group,

I'm facing a very weird issue that causes a clash when I use swampdragon's 
*SelfPublishModel* and django's *models.Model*.
This is the current model that I'm using.

class Activity(SelfPublishModel, models.Model):
content = models.TextField()
dateTime = models.DateTimeField()
activityOwner = models.ForeignKey(User, related_name='activitiesOwned')
privacy = models.CharField()
participants = models.ManyToManyField(User)
event = models.ForeignKey(Event)

The activity model has a many to one relationship with the event model.
This works fine, but when an activity row gets added and points to an 
existing event, an error called "
*TypeError: 'NoneType' object is not callable".*
I found out that the error has something to do with this line residing at 
/swampdragon/models.py
*self._serializer = self.serializer_class(instance=self)*

I've tried all I could without touching /swampdragon/models.py but to no 
avail. Does anyone have a clue to point me somewhere to edit?



On Sunday, 4 January 2015 02:03:14 UTC+8, jonas hagstedt wrote:
>
> Yes I am the author of that article.
>
> Libraries does make life easier, as long as they are the right libraries 
> for the job.
>
> If you are unfamiliar with Angular I would actually recommend not using it.
>
> *  Angular 2.0 is supposedly not going to be backwards compatible (it 
> actually looks like a totally different framework).
> *  As you mentioned, you don't need to use Angular with SwampDragon.
> *  It's another layer of complexity.
> *  The blog post I linked to pretty much covers the basis for doing real 
> time notifications, and isn't using Angular, so you could more or less just 
> tweak that code and add it to your project.
>
>
> On Friday, January 2, 2015 4:12:10 PM UTC+1, Shazwi Suwandi wrote:
>>
>> Michiel: Ah, that's myopic on my part. Both sides are important. 
>>
>> Jonas: I see I see. I keep thinking that libraries will make my life a 
>> bit easier but maybe what I currently need now does not require the use of 
>> them. And are you the author of 
>> the article? (I'm assuming it's the same Jonas) Thank you so much for 
>> this link!! I'll go read it up. 
>>
>

-- 
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/1af4aabc-da9f-413f-8b95-5821d6f4a52d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need some advice on how to go about building a real time web app.

2015-01-03 Thread jonas hagstedt
Yes I am the author of that article.

Libraries does make life easier, as long as they are the right libraries 
for the job.

If you are unfamiliar with Angular I would actually recommend not using it.

*  Angular 2.0 is supposedly not going to be backwards compatible (it 
actually looks like a totally different framework).
*  As you mentioned, you don't need to use Angular with SwampDragon.
*  It's another layer of complexity.
*  The blog post I linked to pretty much covers the basis for doing real 
time notifications, and isn't using Angular, so you could more or less just 
tweak that code and add it to your project.


On Friday, January 2, 2015 4:12:10 PM UTC+1, Shazwi Suwandi wrote:
>
> Michiel: Ah, that's myopic on my part. Both sides are important. 
>
> Jonas: I see I see. I keep thinking that libraries will make my life a bit 
> easier but maybe what I currently need now does not require the use of 
> them. And are you the author of 
> the article? (I'm assuming it's the same Jonas) Thank you so much for this 
> link!! I'll go read it up. 
>

-- 
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/378c226c-9a93-4be6-8dfc-e2d282b98d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need some advice on how to go about building a real time web app.

2015-01-02 Thread Shazwi Suwandi
Michiel: Ah, that's myopic on my part. Both sides are important. 

Jonas: I see I see. I keep thinking that libraries will make my life a bit 
easier but maybe what I currently need now does not require the use of 
them. And are you the author of 
the article? (I'm assuming it's the same Jonas) Thank you so much for this 
link!! I'll go read it up. 

-- 
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/1a28893c-ba5e-4030-a53c-da15cdf2d48e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need some advice on how to go about building a real time web app.

2015-01-02 Thread jonas hagstedt
Personally I don't use any library between Angular and Django (so I don't 
know about django-angular).

I create specific templates for Angular so I don't have to change the {{ 
and }] syntax (you can also use the {% verbatim %} tag in your templates if 
you don't want to create individual templates).

If you want to do notifications with SwampDragon there is a blog post about 
that here: 
http://wildfish.com/blog/2014/12/09/swampdragon-real-time-django-notifications/ 
(including desktop notifications from the browser) along with a Github repo 
with the source code.
You could probably take most of that code and adopt it to your own project.


On Friday, January 2, 2015 1:36:40 PM UTC+1, Shazwi Suwandi wrote:
>
> Hi group,
>
> I'd like to get some guidance on how to go about thinking about the 
> structure of the web app I'm trying to build.
> From a high level perspective, I'm trying to make a web app that 
> facilitates a small business doing camera rentals. 
>
> To give a use case, if a user makes a rental booking for a customer in the 
> web app, it'll send a notification to the user
> who is in charge of packing the items in real-time. I was searching up 
> about real-time Django and I landed onto 
> Swampdragon, which led me to learn about Angular.js (I know, I don't have 
> to use Angular for Swampdragon but I was
> kinda curious). That then led me to learn how much I can shift items like 
> validation to the client side and leave Django to 
> do the rest. 
>
> Some questions I'd like to ask: 
> 1) Am I adopting the right approach to make the app real time? In this 
> case, using Swampdragon for subscribing to messages etc.
> 2) Is django-angular an appropriate way to integrate Angular.js with 
> Django? It'd be nice to use a lot of the client side functionalities of 
> Angular.
>
> Curious and a little bit overwhelmed.
>
>
>

-- 
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/31bbb0e2-1997-40d4-87dd-0a0c61b28653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need some advice on how to go about building a real time web app.

2015-01-02 Thread Michiel Overtoom

Hi,

A little side-note...

> That then led me to learn how much I can shift items like validation to the 
> client side and leave Django to 
> do the rest. 

Even if you do client side validation, you still have to do it on the server 
side too, to protect your application from malicious attacks.

Greetings,

-- 
"You can't actually make computers run faster, you can only make them do less." 
- RiderOfGiraffes

-- 
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/E7ED8C28-6715-4D9D-B11A-FC047E52C854%40xs4all.nl.
For more options, visit https://groups.google.com/d/optout.


Need some advice on how to go about building a real time web app.

2015-01-02 Thread Shazwi Suwandi
Hi group,

I'd like to get some guidance on how to go about thinking about the 
structure of the web app I'm trying to build.
>From a high level perspective, I'm trying to make a web app that 
facilitates a small business doing camera rentals. 

To give a use case, if a user makes a rental booking for a customer in the 
web app, it'll send a notification to the user
who is in charge of packing the items in real-time. I was searching up 
about real-time Django and I landed onto 
Swampdragon, which led me to learn about Angular.js (I know, I don't have 
to use Angular for Swampdragon but I was
kinda curious). That then led me to learn how much I can shift items like 
validation to the client side and leave Django to 
do the rest. 

Some questions I'd like to ask: 
1) Am I adopting the right approach to make the app real time? In this 
case, using Swampdragon for subscribing to messages etc.
2) Is django-angular an appropriate way to integrate Angular.js with 
Django? It'd be nice to use a lot of the client side functionalities of 
Angular.

Curious and a little bit overwhelmed.


-- 
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/a8202f9a-125e-44c5-a032-621c1d239eab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-12-06 Thread graeme
If you want to do everything in Python (which I like to) my choices would 
be Django for the backend, Kivy for the mobile apps, and Django Rest 
Framework to provide APIs for the mobile apps.

If you want to keep it simpler maybe a responsive web design will be 
enough, so you only need Django, HTML, CSS and JS.

Using a JS framework on the front end (e.g. JQuery) also makes your life 
simpler.

I can understand Django looking scary at the start, but remember that there 
is a lot of documentation because Django does a LOT, and that makes your 
life easier. Learning Django may look difficult, but it is less effort than 
all the work it saves you.



On Friday, November 21, 2014 8:26:38 PM UTC+5:30, Mariusz Wilk wrote:
>
> I'm new to programming. Eventually, I'd like to make a website and an 
> android/ios app that would work together and display pretty much the same 
> content on a mobile as on the the web. Each client would log in (via mobile 
> or desktop) and continue solving some exercises from the place he 
> previously finished at. I have a potential client for this app, I don't 
> have any deadline and if it works fine I shouldn't have any problems 
> selling it to him and getting some commercial experience! So my question 
> is: *what should I be learning to eventually reach this goal?* I've done 
> a few Python tutorials/courses online, I played around with HTML, CSS and 
> JS, right now I'm learning Kivy. Django scared me a lot, but maybe I should 
> give it another try.
>

-- 
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/55e47bcc-ace1-448d-b938-9289c3e1a9f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-12-06 Thread Russell Keith-Magee
Hi Mariusz,

It depends how many sharp edges you're willing to live with. I've been
working on a project to allow users to develop native mobile apps in Python:

http://pybee.org/toga/

It's *very* early stage though - nothing close to production ready. There
isn't even really a tutorial for mobile development.

I hesitate mentioning it at all, other than to point out that it is
*possible*, and I'm looking into the space at the moment.

Yours,
Russ Magee %-)

On Fri, Dec 5, 2014 at 10:03 PM, Mariusz Wilk <szostakow...@wp.pl> wrote:

> Thanks for your advice!
> PhoneGap uses JS, HTML and CSS. Is there any way I could do this in Python
> or would it be unneccessarily complicated since maybe there's no
> PhoneGap-type-of-framework for Python?
>
>
> W dniu środa, 3 grudnia 2014 00:56:17 UTC użytkownik Cal Leeming napisał:
>>
>> Hi Mariusz,
>>
>> Short answer - Hack something together in the fastest way possible, don't
>> worry about it being clean, tidy or even tested. Because if you do, you'll
>> still be working on this project in 2 years time... Look at using something
>> like PhoneGap [8], just enjoy the experience and ship it :)
>>
>> If you genuinely want to start learning this stuff, you need to ask
>> yourself what it is you want to work on? Do you want to do backend (e.g.
>> all the server stuff, nothing visual), or do you want to do frontend (all
>> the visual/pretty stuff the user sees), or both? Are you doing this for
>> immediate financial gain [7], or a spiritual journey of self discovery and
>> learning [6]? The world of web dev is changing almost every couple of
>> months, stay on top of your game by reading blog articles from other
>> developers and keeping on top of tech new. Personally I use Feedly [9] to
>> aggregate these feeds into one place. Consider getting an internship
>> somewhere with other good programmers, learning from inspirational people
>> will speed up your personal development massively (I wish someone had told
>> me this 8 years ago).
>>
>> Long answer;
>>
>> Responsive/adaptive design does not necessarily make a good mobile
>> experience, and rarely will you find a mobile app which has the same
>> workflow as the website. Ideally you need to storyboard each experience and
>> wireframe the UX accordingly. Likewise with the UI, colors and sizes which
>> work well on desktop often won't work very well on mobile/tablet
>> (especially if you are designing your desktop site mostly towards PC users,
>> due to the variations in color display).
>>
>> There are tools out there now which allow you to package up your
>> HTML/JS/CSS/images into a native application bundle, meaning you don't have
>> to learn how to write native applications. There are a whole bunch of these
>> products out there [1], but most of them suck, here's why. Building a
>> client side JS application is *hard*, you have to understand the different
>> JS design patterns in order to write clean and stable code, whilst
>> understanding the importance of unit testing [3] and real browser testing
>> [4]. You also have to understand the impact of latency, if you don't
>> compile your assets into a local bundle (instead opting to just wrap a
>> browser window in an IOS app), then your app experience will lag between
>> clicks (because each click is a page load). To get around this you need to
>> build your client side app to be completely independent of the server side,
>> which includes maintaining a view state (e.g. changing/rendering the
>> display upon changes being made). Other libraries exist for doing this such
>> as Ember [5] and others, but they are still quite alpha and have
>> performance concerns too. Also in regards to bundling, there are very few
>> tools out there which will automate this entire process, for example
>> creating a spritesheet of UI images so you don't have to make multiple HTTP
>> asset requests, or embedding the images as base64 in your stylesheet
>> (although that has render performance concerns).
>>
>> Then you also have the API, building a clean RESTful api is difficult and
>> in actual fact may be the wrong approach for your mobile app.. why? Because
>> each API call has a lot of overhead, and this usually results in UI latency
>> if the user has poor signal. There is some work being done to use
>> websockets instead of ajax calls, but this starts to get into quite deep
>> territory.
>>
>> Gonna cut this short, as I try to limit myself to 30 minutes on any given
>> reply. Again don't worry too much about what I've put in the long answer,
>> that's just there to give you some insight into t

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-05 Thread Cal Leeming
You *could* write your JS/HTML in Python using a preprocessor such as pyjs
[1] or markup [2], but I'd *strongly* recommend against it.

This is mainly because of added complexity, you cannot guarantee your
generated code will be optimized and you will most likely encounter weird
edge cases, parser bugs or even outright incompatibility. The amount of
people using this approach will also be very minimal, so you're locking
yourself into a way of doing things which isn't "industry standard". This
might be an interesting dev/research/hobby project, but probably not
suitable for production (imho).

Cal

[1] http://pyjs.org/
[2] http://markup.sourceforge.net/




On Fri, Dec 5, 2014 at 2:03 PM, Mariusz Wilk <szostakow...@wp.pl> wrote:

> Thanks for your advice!
> PhoneGap uses JS, HTML and CSS. Is there any way I could do this in Python
> or would it be unneccessarily complicated since maybe there's no
> PhoneGap-type-of-framework for Python?
>
>
> W dniu środa, 3 grudnia 2014 00:56:17 UTC użytkownik Cal Leeming napisał:
>>
>> Hi Mariusz,
>>
>> Short answer - Hack something together in the fastest way possible, don't
>> worry about it being clean, tidy or even tested. Because if you do, you'll
>> still be working on this project in 2 years time... Look at using something
>> like PhoneGap [8], just enjoy the experience and ship it :)
>>
>> If you genuinely want to start learning this stuff, you need to ask
>> yourself what it is you want to work on? Do you want to do backend (e.g.
>> all the server stuff, nothing visual), or do you want to do frontend (all
>> the visual/pretty stuff the user sees), or both? Are you doing this for
>> immediate financial gain [7], or a spiritual journey of self discovery and
>> learning [6]? The world of web dev is changing almost every couple of
>> months, stay on top of your game by reading blog articles from other
>> developers and keeping on top of tech new. Personally I use Feedly [9] to
>> aggregate these feeds into one place. Consider getting an internship
>> somewhere with other good programmers, learning from inspirational people
>> will speed up your personal development massively (I wish someone had told
>> me this 8 years ago).
>>
>> Long answer;
>>
>> Responsive/adaptive design does not necessarily make a good mobile
>> experience, and rarely will you find a mobile app which has the same
>> workflow as the website. Ideally you need to storyboard each experience and
>> wireframe the UX accordingly. Likewise with the UI, colors and sizes which
>> work well on desktop often won't work very well on mobile/tablet
>> (especially if you are designing your desktop site mostly towards PC users,
>> due to the variations in color display).
>>
>> There are tools out there now which allow you to package up your
>> HTML/JS/CSS/images into a native application bundle, meaning you don't have
>> to learn how to write native applications. There are a whole bunch of these
>> products out there [1], but most of them suck, here's why. Building a
>> client side JS application is *hard*, you have to understand the different
>> JS design patterns in order to write clean and stable code, whilst
>> understanding the importance of unit testing [3] and real browser testing
>> [4]. You also have to understand the impact of latency, if you don't
>> compile your assets into a local bundle (instead opting to just wrap a
>> browser window in an IOS app), then your app experience will lag between
>> clicks (because each click is a page load). To get around this you need to
>> build your client side app to be completely independent of the server side,
>> which includes maintaining a view state (e.g. changing/rendering the
>> display upon changes being made). Other libraries exist for doing this such
>> as Ember [5] and others, but they are still quite alpha and have
>> performance concerns too. Also in regards to bundling, there are very few
>> tools out there which will automate this entire process, for example
>> creating a spritesheet of UI images so you don't have to make multiple HTTP
>> asset requests, or embedding the images as base64 in your stylesheet
>> (although that has render performance concerns).
>>
>> Then you also have the API, building a clean RESTful api is difficult and
>> in actual fact may be the wrong approach for your mobile app.. why? Because
>> each API call has a lot of overhead, and this usually results in UI latency
>> if the user has poor signal. There is some work being done to use
>> websockets instead of ajax calls, but this starts to get into quite deep
>> territory.
>>
>> Gonna 

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-05 Thread Mariusz Wilk
Thanks for your advice! 
PhoneGap uses JS, HTML and CSS. Is there any way I could do this in Python 
or would it be unneccessarily complicated since maybe there's no 
PhoneGap-type-of-framework for Python?


W dniu środa, 3 grudnia 2014 00:56:17 UTC użytkownik Cal Leeming napisał:
>
> Hi Mariusz,
>
> Short answer - Hack something together in the fastest way possible, don't 
> worry about it being clean, tidy or even tested. Because if you do, you'll 
> still be working on this project in 2 years time... Look at using something 
> like PhoneGap [8], just enjoy the experience and ship it :)
>
> If you genuinely want to start learning this stuff, you need to ask 
> yourself what it is you want to work on? Do you want to do backend (e.g. 
> all the server stuff, nothing visual), or do you want to do frontend (all 
> the visual/pretty stuff the user sees), or both? Are you doing this for 
> immediate financial gain [7], or a spiritual journey of self discovery and 
> learning [6]? The world of web dev is changing almost every couple of 
> months, stay on top of your game by reading blog articles from other 
> developers and keeping on top of tech new. Personally I use Feedly [9] to 
> aggregate these feeds into one place. Consider getting an internship 
> somewhere with other good programmers, learning from inspirational people 
> will speed up your personal development massively (I wish someone had told 
> me this 8 years ago).
>
> Long answer;
>
> Responsive/adaptive design does not necessarily make a good mobile 
> experience, and rarely will you find a mobile app which has the same 
> workflow as the website. Ideally you need to storyboard each experience and 
> wireframe the UX accordingly. Likewise with the UI, colors and sizes which 
> work well on desktop often won't work very well on mobile/tablet 
> (especially if you are designing your desktop site mostly towards PC users, 
> due to the variations in color display).
>
> There are tools out there now which allow you to package up your 
> HTML/JS/CSS/images into a native application bundle, meaning you don't have 
> to learn how to write native applications. There are a whole bunch of these 
> products out there [1], but most of them suck, here's why. Building a 
> client side JS application is *hard*, you have to understand the different 
> JS design patterns in order to write clean and stable code, whilst 
> understanding the importance of unit testing [3] and real browser testing 
> [4]. You also have to understand the impact of latency, if you don't 
> compile your assets into a local bundle (instead opting to just wrap a 
> browser window in an IOS app), then your app experience will lag between 
> clicks (because each click is a page load). To get around this you need to 
> build your client side app to be completely independent of the server side, 
> which includes maintaining a view state (e.g. changing/rendering the 
> display upon changes being made). Other libraries exist for doing this such 
> as Ember [5] and others, but they are still quite alpha and have 
> performance concerns too. Also in regards to bundling, there are very few 
> tools out there which will automate this entire process, for example 
> creating a spritesheet of UI images so you don't have to make multiple HTTP 
> asset requests, or embedding the images as base64 in your stylesheet 
> (although that has render performance concerns).
>
> Then you also have the API, building a clean RESTful api is difficult and 
> in actual fact may be the wrong approach for your mobile app.. why? Because 
> each API call has a lot of overhead, and this usually results in UI latency 
> if the user has poor signal. There is some work being done to use 
> websockets instead of ajax calls, but this starts to get into quite deep 
> territory.
>
> Gonna cut this short, as I try to limit myself to 30 minutes on any given 
> reply. Again don't worry too much about what I've put in the long answer, 
> that's just there to give you some insight into the things you'll start 
> thinking about as you get deeper into your journey.
>
> Hope this helps dude
>
> Cal
>
> [1] Google search for "app maker iphone"
> [2] http://addyosmani.com/resources/essentialjsdesignpatterns/book/
> [3] http://qunitjs.com/
> [4] http://www.seleniumhq.org/
> [5] http://emberjs.com/
> [6] 
> http://www.amazon.co.uk/The-Clean-Coder-Professional-Programmers/dp/0137081073
> [7] http://techcrunch.com/2012/03/25/dont-just-ship-it/
> [8] http://phonegap.com/
> [9] http://feedly.com/
>
>
>
> On Fri, Nov 21, 2014 at 2:56 PM, Mariusz Wilk <szosta...@wp.pl 
> > wrote:
>
>> I'm new to programming. Eventually, I'd like to make a website and an 
>> android/ios a

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-02 Thread Cal Leeming
Hi Mariusz,

Short answer - Hack something together in the fastest way possible, don't
worry about it being clean, tidy or even tested. Because if you do, you'll
still be working on this project in 2 years time... Look at using something
like PhoneGap [8], just enjoy the experience and ship it :)

If you genuinely want to start learning this stuff, you need to ask
yourself what it is you want to work on? Do you want to do backend (e.g.
all the server stuff, nothing visual), or do you want to do frontend (all
the visual/pretty stuff the user sees), or both? Are you doing this for
immediate financial gain [7], or a spiritual journey of self discovery and
learning [6]? The world of web dev is changing almost every couple of
months, stay on top of your game by reading blog articles from other
developers and keeping on top of tech new. Personally I use Feedly [9] to
aggregate these feeds into one place. Consider getting an internship
somewhere with other good programmers, learning from inspirational people
will speed up your personal development massively (I wish someone had told
me this 8 years ago).

Long answer;

Responsive/adaptive design does not necessarily make a good mobile
experience, and rarely will you find a mobile app which has the same
workflow as the website. Ideally you need to storyboard each experience and
wireframe the UX accordingly. Likewise with the UI, colors and sizes which
work well on desktop often won't work very well on mobile/tablet
(especially if you are designing your desktop site mostly towards PC users,
due to the variations in color display).

There are tools out there now which allow you to package up your
HTML/JS/CSS/images into a native application bundle, meaning you don't have
to learn how to write native applications. There are a whole bunch of these
products out there [1], but most of them suck, here's why. Building a
client side JS application is *hard*, you have to understand the different
JS design patterns in order to write clean and stable code, whilst
understanding the importance of unit testing [3] and real browser testing
[4]. You also have to understand the impact of latency, if you don't
compile your assets into a local bundle (instead opting to just wrap a
browser window in an IOS app), then your app experience will lag between
clicks (because each click is a page load). To get around this you need to
build your client side app to be completely independent of the server side,
which includes maintaining a view state (e.g. changing/rendering the
display upon changes being made). Other libraries exist for doing this such
as Ember [5] and others, but they are still quite alpha and have
performance concerns too. Also in regards to bundling, there are very few
tools out there which will automate this entire process, for example
creating a spritesheet of UI images so you don't have to make multiple HTTP
asset requests, or embedding the images as base64 in your stylesheet
(although that has render performance concerns).

Then you also have the API, building a clean RESTful api is difficult and
in actual fact may be the wrong approach for your mobile app.. why? Because
each API call has a lot of overhead, and this usually results in UI latency
if the user has poor signal. There is some work being done to use
websockets instead of ajax calls, but this starts to get into quite deep
territory.

Gonna cut this short, as I try to limit myself to 30 minutes on any given
reply. Again don't worry too much about what I've put in the long answer,
that's just there to give you some insight into the things you'll start
thinking about as you get deeper into your journey.

Hope this helps dude

Cal

[1] Google search for "app maker iphone"
[2] http://addyosmani.com/resources/essentialjsdesignpatterns/book/
[3] http://qunitjs.com/
[4] http://www.seleniumhq.org/
[5] http://emberjs.com/
[6]
http://www.amazon.co.uk/The-Clean-Coder-Professional-Programmers/dp/0137081073
[7] http://techcrunch.com/2012/03/25/dont-just-ship-it/
[8] http://phonegap.com/
[9] http://feedly.com/



On Fri, Nov 21, 2014 at 2:56 PM, Mariusz Wilk <szostakow...@wp.pl> wrote:

> I'm new to programming. Eventually, I'd like to make a website and an
> android/ios app that would work together and display pretty much the same
> content on a mobile as on the the web. Each client would log in (via mobile
> or desktop) and continue solving some exercises from the place he
> previously finished at. I have a potential client for this app, I don't
> have any deadline and if it works fine I shouldn't have any problems
> selling it to him and getting some commercial experience! So my question
> is: *what should I be learning to eventually reach this goal?* I've done
> a few Python tutorials/courses online, I played around with HTML, CSS and
> JS, right now I'm learning Kivy. Django scared me a lot, but maybe I should
> give it another try.
>
> --
> You received th

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-02 Thread Mariusz Wilk

>
> Thanks. But is it possible to create a pretty web/mobile app with pop-ups, 
> buttons, input boxes, pics etc in Django/Python alone?  
>
I'm asking since I'm doing Django tutorial and so far I only have a 
> raw-looking poll (as an example).   
>
When a website is made with Django does it have to be paired with a lot of 
> HTML/CSS (maybe even JavaS) to look good? 
>

Also, does it matter what languages and environments does a company for 
whom I'm creating an app uses? Assuming that there is no 
interaction between their current website, databases etc and my new 
app?  

 

-- 
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/21aebab0-81ec-4da0-be20-e477ec7b85a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-11-24 Thread Fred Stluka

+1 for writing a single RWD (Responsive Web Design) web app
using Django, instead of writing separate web, Android and iOS
apps.

If necessary, wrap the result in PhoneGap to mobile-specific
features, uploading images from the camera, capturing the
GPS location, showing maps, accessing the local file system
and contacts, etc.  But only if you need those features.

My current project uses RWD techniques to look good on
phones, tablets, and full screens.  Lots of jQuery, Ajax, HTML5
and CSS3 for a rich user experience.  Drag any of the pages
wider or narrower to see what I mean:
- http://helphopelive.org

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 11/24/14 8:37 AM, Collin Anderson wrote:

Hi,

Django can do all of those things except the native android/ios apps. 
Django specializes in websites and especially helpful for handling 
things like logging in, querying a database, processing form input, 
and generating html.


Here are some ways Django can help with your situation:
You could build native android/ios apps and use Django for the server 
side of your app, like how Instagram does it. You could handle the 
desktop side as a website made with Django. If you really wanted 
low-cost-maintenance, you could have your android and ios apps just be 
simple wrappers around a webview that's loading content from Django.


Collin


On Friday, November 21, 2014 9:56:38 AM UTC-5, Mariusz Wilk wrote:

I'm new to programming. Eventually, I'd like to make a website and
an android/ios app that would work together and display pretty
much the same content on a mobile as on the the web. Each client
would log in (via mobile or desktop) and continue solving some
exercises from the place he previously finished at. I have a
potential client for this app, I don't have any deadline and if it
works fine I shouldn't have any problems selling it to him and
getting some commercial experience! So my question is: *what
should I be learning to eventually reach this goal?* I've done a
few Python tutorials/courses online, I played around with HTML,
CSS and JS, right now I'm learning Kivy. Django scared me a lot,
but maybe I should give it another try.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/e4e4ed98-407b-41c1-841c-0d91eb70de7c%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/e4e4ed98-407b-41c1-841c-0d91eb70de7c%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 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/54737893.3080604%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: Web and mobile app with Django? Kivy? sth else?

2014-11-24 Thread Collin Anderson
Hi,

Django can do all of those things except the native android/ios apps. 
Django specializes in websites and especially helpful for handling things 
like logging in, querying a database, processing form input, and generating 
html.

Here are some ways Django can help with your situation:
You could build native android/ios apps and use Django for the server side 
of your app, like how Instagram does it. You could handle the desktop side 
as a website made with Django. If you really wanted low-cost-maintenance, 
you could have your android and ios apps just be simple wrappers around a 
webview that's loading content from Django.

Collin


On Friday, November 21, 2014 9:56:38 AM UTC-5, Mariusz Wilk wrote:
>
> I'm new to programming. Eventually, I'd like to make a website and an 
> android/ios app that would work together and display pretty much the same 
> content on a mobile as on the the web. Each client would log in (via mobile 
> or desktop) and continue solving some exercises from the place he 
> previously finished at. I have a potential client for this app, I don't 
> have any deadline and if it works fine I shouldn't have any problems 
> selling it to him and getting some commercial experience! So my question 
> is: *what should I be learning to eventually reach this goal?* I've done 
> a few Python tutorials/courses online, I played around with HTML, CSS and 
> JS, right now I'm learning Kivy. Django scared me a lot, but maybe I should 
> give it another try.
>

-- 
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/e4e4ed98-407b-41c1-841c-0d91eb70de7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Web and mobile app with Django? Kivy? sth else?

2014-11-21 Thread Mariusz Wilk
I'm new to programming. Eventually, I'd like to make a website and an 
android/ios app that would work together and display pretty much the same 
content on a mobile as on the the web. Each client would log in (via mobile 
or desktop) and continue solving some exercises from the place he 
previously finished at. I have a potential client for this app, I don't 
have any deadline and if it works fine I shouldn't have any problems 
selling it to him and getting some commercial experience! So my question 
is: *what should I be learning to eventually reach this goal?* I've done a 
few Python tutorials/courses online, I played around with HTML, CSS and JS, 
right now I'm learning Kivy. Django scared me a lot, but maybe I should 
give it another try.

-- 
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/18d268ec-e509-4d39-8d9d-ac74204123f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Enter a contest to win a free e-copy of "Web Development with Django Cookbook"

2014-11-05 Thread Aidas Bendoraitis
Hello all,

Not long ago my book "Web Development with Django Cookbook" was published 
and now you have a chance to win a free copy of it.

Check 
http://djangotricks.blogspot.de/2014/11/win-free-copies-of-web-development-with-django-cookbook.html
 
for more details.

Cheers,
Aidas Bendoraitis

-- 
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/b4e1540c-88b9-4c55-a151-95ceddd8b8b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Freelance Web Designer in Hyderabad,Rumenia,Turkey,Afganisthan,Turkisthan

2014-10-31 Thread Freelancer Web Designer
My Self Raheem Pasha, Freelance Hyderabad based Freelance Website Designer 
and Developer with Five years experience in Internet, offering high-end 
expertise solution at freelance . Offering Web designing,Seo Services,Web 
Hosting,Template designing,Logo Designing,Banner Advertisement,Flash 
Animation,Website Marketing,Graphic Designing, Ecommerce Website 
development and much More services at affordable cost

For more Details:

*Freelance Web Designer in Hyderabad 
<http://www.freelancerwebdesignerhyderabad.com/>*

Contact : +91 (0) 8897931177

E-mail : rhmpash...@gmail.com

Web:http://www.freelancerwebdesignerhyderabad.com/

-- 
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/bdfd1a3f-60d1-470a-9e9b-4b4a1457f3c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Review copies available for “Web Development with Django Cookbook”

2014-10-30 Thread Sunitha Palanna
 

We have a few e-copies of *Web Development with Django Cookbook* (
https://www.packtpub.com/web-development/web-development-django-cookbook
) available for review. 

 

If interested, just drop a line in the comments below with following 
required details:

1. Email address

2. Choice of website for posting your book-review (can be your blog or 
website, Amazon.com and/or Goodreads.com)

You can even directly send me an email at sunit...@packtpub.com

P.S: Limited copies available.

https://www.packtpub.com/web-development/web-development-django-cookbook

-- 
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/703d230d-ef7e-4cf3-9bd4-8f8174323164%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine
Hmm not sure what happened but I modified my models.py section:

class Hardwareid(models.Model):
hardwareid_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date added')
def __unicode__(self): 
return self.hardwareid_text

to match what you had recommended:

class Hardwareid(models.Model):
hardwareid_text = models.CharField(max_length=200)
pub_date = models.DateField('default=timezone.now)
def __unicode__(self): 
return self.hardwareid_text

and now it works! I can enter data to submit from that page and it ended up 
in my mysql db. Thanks for all your help Collin.

-- 
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/d8d140af-c2d0-4746-ae86-e2360c48e13c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine


On Thursday, October 16, 2014 2:28:38 PM UTC-7, Collin Anderson wrote:
>
> Hi Bovine,
>
> Your pub_date field needs a value. Maybe try this:
>
> from django.utils import timezone
>
> class MyModel(models.Model):
> pub_date = models.DateField(default=timezone.now)
>
> Collin
>
>
Thanks Collin but does this belong in  my models.py, views.py or forms.py? 
I already had the following in my models.py:

from django.db import models
from django.utils import timezone


class Hardwareid(models.Model):
hardwareid_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date added')
def __unicode__(self): 
return self.hardwareid_text

-- 
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/0a9f105f-7186-49a3-9de1-04f8f2cbd368%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Collin Anderson
Hi Bovine,

Your pub_date field needs a value. Maybe try this:

from django.utils import timezone

class MyModel(models.Model):
pub_date = models.DateField(default=timezone.now)

Collin

-- 
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/51410cf2-cebc-461a-b938-79a01c25aa93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-16 Thread Bovine Devine
.5-py2.7-win32.egg.tmp\MySQLdb\cursors.py
in execute
   1. 
  
  self.errorhandler(self, exc, value)
  
  ...
   ▶ Local vars <http://127.0.0.1:8000/get_barcode.html#>
   - 
   
c:\users\win7va~1\appdata\local\temp\easy_install-kwxg3e\MySQL_python-1.2.5-py2.7-win32.egg.tmp\MySQLdb\connections.py
in defaulterrorhandler
   1. 
  
  raise errorclass, errorvalue
  
  ...
   ▶ Local vars <http://127.0.0.1:8000/get_barcode.html#>
   


I do not remember adding this requirement so how can I add that as part of 
the form entry?

-- 
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/43500ce4-397b-44b6-b69a-75150bb21cd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-15 Thread Bovine Devine


On Tuesday, October 7, 2014 6:42:39 PM UTC-7, Collin Anderson wrote:
>
> My bad. Put your add_view in views.py (cause it's a view :)
>
> Then, you'll need to import your form into your view:
> from oneidentry.forms import HardwareidForm
>
>
Thanks  Collin I made the switch but now cannot access the page at the new 
URL directly for some reason now and getting a 404 error:


Page not found (404)Request Method:GETRequest URL:
http://127.0.0.1:8000/hardwareid/get_barcode.html

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

   1. ^oneidentry/
   2. ^admin/

The current URL, hardwareid/get_barcode.html, didn't match any of these.


-- 
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/fd5241ea-d708-448c-a591-599552a21d1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-08 Thread shmengie


On Tuesday, October 7, 2014 5:20:26 PM UTC-4, Bovine Devine wrote:
>
> Thanks for the help Collin...I need to read through more of the 
> documentation it seems! Going through the chapter am I correct in 
> understanding that using ModelForm example you listed as a view does not 
> need to be added to urls then? What is the user access page then? Sorry 
> this is all really still new to me and I do not understand why they are 
> running. I went back to review the forms documentation here: 
> https://docs.djangoproject.com/en/1.7/topics/forms/ so is this two 
> different ways to do the same thing?
>

There are many ways... There are two separate methods, in the 
documentation, which have some overlap.

Collin has been pointing you in the direction of function based views.  FBV 
are a good starting point, easier to follow the logic.

The modern method is Class Based Views.  CBV has a lot of utility with a 
tougher learning curve.  Much redundancy is managed in the base classes, 
which hides logic.

CBVs minimize coding.  The cost is the learning curve.

views.py:
from django.views.generic import ListView, TemplateView, DetailView, 
CreateView, DeleteView, UpdateView
from oneidentry.models import Hardwareid

class MyView(CreateView):
model = Hardwareid
template_name = 'base_site.html'
fields = ['hardwareid_text']

urls.py:
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from oneidentry.views import MyView

urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name="index.html"), name='index'),
url(r'^create/$', views.add_view, name='add_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/2f987232-4025-4eba-a1da-0c2c8596fe28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
My bad. Put your add_view in views.py (cause it's a view :)

Then, you'll need to import your form into your view:
from oneidentry.forms import HardwareidForm

-- 
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/5528c00e-8541-4651-b60e-5ce9a168a51c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine


On Tuesday, October 7, 2014 4:49:04 PM UTC-7, Collin Anderson wrote:
>
> > Am I correct in understanding that using ModelForm example you listed as 
> a view does not need to be added to urls then? What is the user access page 
> then?
> The add_view would need to be added to your urls.
>
> I added the add_view to teh urls.py
>

from django.conf.urls import patterns, url

from oneidentry import views

urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^$', views.add_view, name='add_view'),

But received an error that the view was not defined. I placed the code 
above into a new forms.py file:

from django import ModelForm
from oneidentry.models import Hardwareid

class HardwareidForm(forms.ModelForm):
 class Meta:
model = Hardwareid
fields = ['hardwareid_text']

def add_view(request):
form = HardwareidForm()
if request.method == 'POST':
form = HardwareidForm(request.POST)
if form.is_valid():
the_new_entry = form.save()
return redirect()  # wherever you want to go next
return render(request, 'base_site.html', {'form': form})

Is that correct? Or does this belong in views.py?

-- 
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/e6efaffc-7548-46ec-9359-9dfe359ff015%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
> Am I correct in understanding that using ModelForm example you listed as 
a view does not need to be added to urls then? What is the user access page 
then?
The add_view would need to be added to your urls.

> So is this two different ways to do the same thing?
The main difference is that it's a ModelForm rather than a Form. The Model 
form has a "class Meta" and a form.save() method which automatically 
creates the row in the database for 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8eb20c11-a771-4789-affa-d30d9a3c59fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
Thanks for the help Collin...I need to read through more of the 
documentation it seems! Going through the chapter am I correct in 
understanding that using ModelForm example you listed as a view does not 
need to be added to urls then? What is the user access page then? Sorry 
this is all really still new to me and I do not understand why they are 
running. I went back to review the forms documentation 
here: https://docs.djangoproject.com/en/1.7/topics/forms/ so is this two 
different ways to do the same thing?

-- 
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/9d830214-bb3d-41d1-be5c-8def1316981b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
Using a plan ModelForm in a few to create objects is surprisingly not well 
documented :)
https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/

Basically you do something like this:

from django import forms

class MyForm(forms.ModelForm):
class Meta:
model = MyModel
fields = ['field1', 'field2']

@login_required  # if you need it
def add_view(request):
form = MyForm()
if request.method == 'POST':
form = MyForm(request.POST)
if form.is_valid():
the_new_entry = form.save()
return redirect()  # wherever you want to go next
return render(request, 'add_template', {'form': form})


-- 
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/61fb9b6d-fe6c-4501-b562-b8805efd838b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
I have gone through the django tutorial but seem to be lost on how to 
create a simple user view page that allows me to add/post/create data 
directly to the connected mysql database. I have the models view working 
and can access and add items in admin view but not sure how/what is the 
best way or method to have an external user view only webpage to create/add 
entries. I was searching in the django 
documentation https://docs.djangoproject.com/en/1.7/topics/db/queries/ but 
it seems to have examples on how to create/add entries from python command 
line.

Any examples of this type of form would be greatly appreciated. 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/bff4c358-db23-432a-b06a-bef88270bae1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up Apache to be the web server for apache for Django 1.7 and python 3.3

2014-10-03 Thread Collin Anderson
Here's your requested document: 
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/

If you're using ubuntu (though I assume you're not, based on your python 
version,) you just run:
sudo apt-get install apache2 libapache2-mod-wsgi-py3

> What should the settings.py reflect to accept calls from Apache?
You shouldn't need to do any additional configuration in django, besides 
the usual deployment configuration:
https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

> What port should I use?
If you're using ssl, port 443 is the standard port to listen on, if that 
answers your question.

> I assume that once I use Apache I no longer need to run python manage.py 
runserver, because I will no longer be using the local server, but now the 
Apache server?
Basically, runserver is for development, apache is for production. You may 
still want to use the runserver for testing changes to your code.

> Is mod_wsgi for a medium traffic web site for https  the way to go?
If you're not going to use nginx, I'd recommend the event-mpm if you have 
the choice, which should help performance.

-- 
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/f8e9ccd4-ceb8-4b2e-aab6-13550410c307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up Apache to be the web server for apache for Django 1.7 and python 3.3

2014-10-03 Thread robert brook
The requirements of the organization is to use Apache

On Friday, October 3, 2014 8:42:29 AM UTC-4, robert brook wrote:
>
> Can someone point me to a document on how to perform a setup for Apache.
>
> What modules would it be good to install ( I presume as a site package for 
> Python)?
>
> What should the settings.py reflect to accept calls from Apache?
>
> What do I need to configure in the apache config file?
>
> What port should I use?
>
> I assume that once I use Apache I no longer need to run python manage.py 
> runserver, because I will no longer
> be using the local server, but now the Apache server?
>
> Any other suggestions would be helpful.
>
> Is mod_wsgi for a medium traffic web site for https  the way to go?
>
> 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/634381ee-57e5-49d1-91fd-aa23b392a15d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up Apache to be the web server for apache for Django 1.7 and python 3.3

2014-10-03 Thread Timothy W. Cook
Of course http://www.giyf.com/  but unless you have some very compelling
need to use Apache.  This may be a better choice.
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

I found it to be much easier to setup and maintain.



On Fri, Oct 3, 2014 at 9:42 AM, robert brook <software.by.pyt...@gmail.com>
wrote:

> Can someone point me to a document on how to perform a setup for Apache.
>
> What modules would it be good to install ( I presume as a site package for
> Python)?
>
> What should the settings.py reflect to accept calls from Apache?
>
> What do I need to configure in the apache config file?
>
> What port should I use?
>
> I assume that once I use Apache I no longer need to run python manage.py
> runserver, because I will no longer
> be using the local server, but now the Apache server?
>
> Any other suggestions would be helpful.
>
> Is mod_wsgi for a medium traffic web site for https  the way to go?
>
> 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/f5cf6b83-7a90-4ffa-84de-c41aef1c68b0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f5cf6b83-7a90-4ffa-84de-c41aef1c68b0%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

-- 
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/CA%2B%3DOU3V_FaqwM0d9D9Z67VUy55j%2Bo70GbD8t_kOTJS%3DEquVvkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Setting up Apache to be the web server for apache for Django 1.7 and python 3.3

2014-10-03 Thread robert brook
Can someone point me to a document on how to perform a setup for Apache.

What modules would it be good to install ( I presume as a site package for 
Python)?

What should the settings.py reflect to accept calls from Apache?

What do I need to configure in the apache config file?

What port should I use?

I assume that once I use Apache I no longer need to run python manage.py 
runserver, because I will no longer
be using the local server, but now the Apache server?

Any other suggestions would be helpful.

Is mod_wsgi for a medium traffic web site for https  the way to go?

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/f5cf6b83-7a90-4ffa-84de-c41aef1c68b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


<    2   3   4   5   6   7   8   9   10   11   >