How do I know if a celery task has crashed?

2014-01-28 Thread Mike
I have a model that looks something like this:

Job(models.Model):
status = models.CharField(max_length=8, choices = statuses)
jobid = models.CharField(max_length=20, db_index=True)
...

I submit tasks to celery.  The task fetches the Job object, changes its 
status to RUNNING, does the computation, then changes the status to 
FINISHED.  If the job crashes in my code I can catch the exception, set the 
status to ERROR and act accordingly, but if it crashes for some other 
reason I won't know it.  The only thing I can think of is to stop the 
celery queue, let it drain, and check the Job table for objects set to 
RUNNING.  Seems janky to me.  Is there a better way?

-- 
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/aebae6cf-de7f-4920-8731-9ce8cfd0922e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: can't compare datetime.datetime to datetime.date

2014-01-28 Thread Rafał Szymański
Thank You so much.
Best wishes
Rafal

W dniu poniedziałek, 27 stycznia 2014 15:43:59 UTC+1 użytkownik 
i...@simpler.co napisał:
>
> You're comparing pub_date, which is a datetime.date, to timezone.now(), 
> which is a datetime.datetime. Check the docs at 
> http://docs.python.org/2/library/datetime.html for more.
>
> In order to convert timezone.now() to a date, just call 
> timezone.now().date(), like:
>
> In [1]: from django.utils import timezone
>
> In [3]: timezone.now()
>
> Out[3]: datetime.datetime(2014, 1, 27, 14, 42, 29, 408491, tzinfo=)
>
> In [4]: timezone.now().date()
>
> Out[4]: datetime.date(2014, 1, 27)
>
> On Monday, January 27, 2014 5:38:20 AM UTC-8, Rafał Szymański wrote:
>>
>> Hi again
>>
>> I wolud like ask another question.
>> If someone would be so kind and help that will be great.
>> I'm in the begining of django tutorial.
>>
>> I use python3.3 and django1.6
>>
>> I get error:
>> can't compare datetime.datetime to datetime.date
>>
>> Here is my code:
>>
>> import datetime
>> from django.utils import timezone
>> from django.db import models
>>
>> class Poll(models.Model):
>> question = models.CharField(max_length=200)
>> pub_date = models.DateField('date published')
>> def was_published_recently(self):
>> return self.pub_date >= timezone.now() - 
>> datetime.timedelta(days=1)
>> def __str__(self):
>> return self.question
>>
>> class Choice(models.Model):
>> poll = models.ForeignKey(Poll)
>> choice_text = models.CharField(max_length=200)
>> votes = models.IntegerField(default=0)
>> def __str__(self):
>> return self.choice_text
>>
>> Thanks in advance
>> Rafał
>>
>

-- 
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/4614f29c-5d27-4332-b648-99c610adf626%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread Mike Dewhirst

On Monday, January 27, 2014 5:44:12 PM UTC-5, damond...@gmail.com wrote:


Hi,

I would like to know if this community is somewhat worried about the
future relevance of Django (and other purely server-side MV* Python
web app frameworks such as web2py for that matter) given the current
momentum of JavaScript (JS) everywhere?


Things do change but some things stay the same. Javascript will continue 
to be hated by lotsa people.


You wanted opinions about client-side and server-side being more or less 
integrated and you do hedge somewhat saying  "depends on the ... app 
requirements". I think while there is a performance edge to be gained by 
separate frameworks they will persist.


Large scale apps ought to be funded well enough to hire the best 
technologists who will obviously choose the best technologies for the 
specified requirements. For server-side the Django ORM does it for most 
apps while SQL rules. For client-side we'll just have to hire 
javascript/CSS/HTML5 resources.


Mozilla is working on Python in the browser built on top of the js 
engine. If that works, it is a very small step to an abstraction layer 
in all browsers so we js-haters can avoid Javascript altogether.


As soon as we can manipulate the DOM with Python there will be a 
plethora of client-side Python frameworks which integrate with 
server-side Django.


Then we'll have Python everywhere :)

... and they can do what they like with js



There are many competing architecture patterns for a WHOLE web app
today ranging:
a)  from client-heavy SPA with a client-side MVC framework
synching its models via a REST API with a server-side reduced to a
database access layer

b) to light client apps with a server-side MVC frameworks and very
little or no Ajax

c) and everything in the middle.

I guess it is not too controversial to say that which is best (or
even merely adequate) depends on the generally moving target of the
app requirements (especially the non-functional ones) and thus a
long lifecycle app can be expected to have to change pattern at some
point.


Given that:
1) full web apps following any pattern can today be developed
exclusively with JavaScript (JS) frameworks on both sides who have
incorporated most (if not all) great design ideas from Django (and
Rails)

2) IDEs ranging from Visual Studio to browser-based ones are
available to support such development

3) Python in the browser projects do not yet provide productive
debugging support (and will they ever without support from a tech
giant?)

4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering
JS framework running servers

are the productivity gains from the more legible, concise and
abstract Python code as compared to JS code really compensate the
productivity loss of having to port part of the app from one
language to other every time it must be pushed from one side (say
server) to the other (say client), or even to maintain a code base
in two languages instead of one?

Why then adopt Django (or web2py) for a new project today, instead
of going pure JS?

I am a big Python fan in terms of design and principles, but I am
fearing that it has started to lose the
popularity/adoption/community size battle against JS, which, from a
pragmatic productivity standpoint is relevant and thus potentially
snowballing after a tipping point is reached. Trends are deadly fast
in web development, cf. how quickly J2EE+static HTML, then
J2EE+Flash and .NET+Silverlight have fallen from grace.

Any thought on this?


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52E79F27.20105%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.


Commercial Django e-commerce products

2014-01-28 Thread Alex Strickland

Hi

Can anyone suggest any commercial Django e-commerce products?

--
Regards
Alex

--
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/52E7B31A.4020105%40mweb.co.za.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Commercial Django e-commerce products

2014-01-28 Thread Sergiy Khohlov
Is this one good for you ? https://www.django-cms.org/en/e-commerce/
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Tue, Jan 28, 2014 at 3:39 PM, Alex Strickland  wrote:
> Hi
>
> Can anyone suggest any commercial Django e-commerce products?
>
> --
> Regards
> Alex
>
> --
> 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/52E7B31A.4020105%40mweb.co.za.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CADTRxJNuFg9vUAm4Eoo0NBokJTovtXO44Fj9kHRc_%3Dh6o0BMHw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread graeme
On Tuesday, January 28, 2014 1:00:31 PM UTC+5:30, Avraham Serour wrote:
>
> you will eventually need to keep a couple of different codebases in some 
> different languges.
> Say you get popular enough and now you need to launch a desktop app, 
> android and iphone.
> Take dropbox for example, they have a web version, desktop, android and 
> iphone (did I miss any platform?)
> For desktop you can still use python and I don't think it is possible to 
> make a desktop application with js.
>

There are javascript bindings for GTK and QT.
 

> For android you'll need to use java and eventually you might use C++
>
 

> For iphone you're stuck with objective-c (which I hate it more than js btw)
>
 

> For mobile you could still use something like phonegap if you really love 
> js.
>
>  
Which mean means you *can* keep everything in JS.
 

> Django always took an agnostic approach to client side, in my opinion this 
> needs to change so not to risk becoming obsolete, but no need to rush.
>
> And as you said these trends come and go fast, server side js is trendy 
> right now and is relatively new, maybe it will stick around and maybe it 
> will go away, python is getting popular but is not so trendy, I believe is 
> has a more solid base.
>

Python is much nicer to develop in. JS is horrible in some ways (e.g. 
variables are global inless specifically declared local) that are hard to 
fix without breaking backward compatibility. Things like coffee script may 
help.

Unless you have a lot of code shared between the front end and backend, I 
do not see what advantage JS has.

>
> Also I don't believe you need to be in such a hurry to jump on the server 
> js train, this is new, meaning there are still few libraries around, and 
> honestly I would first check the quality of the code of the libraries and 
> frameworks, as php js has a low entry level, many people without much idea 
> on what's going on are writing libs and releasing, this is good, people are 
> learning, but be careful before using any code you see on the internet, 
> I've seen too many spaghetti code and hacks in popular php frameworks.
>
> best regards
> Avraham
>
>
>
> On Tue, Jan 28, 2014 at 5:59 AM, Brad Moore 
> 
> > wrote:
>
>> The tech giants are pushing JavaScript more than Python these days. 
>>  JavaScript is said to be the future language for enterprise applications. 
>> I think Python will be around but will play a third place role behind 
>> JavaScript and PHP. Yes, I said PHP and I apologize but its true just look 
>> at the cloud support that is quietly being offered for PHP. I have used PHP 
>> extensively and it can be very good and very bad depending on the 
>> developer. .NET is terrible I almost quit an IT career before it started 
>> because we were forced to use Visual Studio and Microsoft technologies for 
>> web development in college. My opinion as long as good design principles 
>> are followed using an MVC approach all three are good choices. Python is 
>> not going to go away because it is being used to teach the next generation 
>> of computer scientists throughout the world. Get used to { } all over the 
>> place or just stick with Python and Django it will not matter.  
>>
>>
>> On Monday, January 27, 2014 5:44:12 PM UTC-5, damond...@gmail.com wrote:
>>>
>>> Hi,
>>>
>>> I would like to know if this community is somewhat worried about the 
>>> future relevance of Django (and other purely server-side MV* Python web 
>>> app frameworks such as web2py for that matter) given the current momentum 
>>> of JavaScript (JS) everywhere?
>>>
>>> There are many competing architecture patterns for a WHOLE web app today 
>>> ranging:
>>> a)  from client-heavy SPA with a client-side MVC framework synching its 
>>> models via a REST API with a server-side reduced to a database access layer
>>>
>>> b) to light client apps with a server-side MVC frameworks and very 
>>> little or no Ajax 
>>>
>>> c) and everything in the middle.
>>>
>>> I guess it is not too controversial to say that which is best (or even 
>>> merely adequate) depends on the generally moving target of the app 
>>> requirements (especially the non-functional ones) and thus a long 
>>> lifecycle app can be expected to have to change pattern at some point.
>>>
>>>
>>> Given that:
>>> 1) full web apps following any pattern can today be developed 
>>> exclusively with JavaScript (JS) frameworks on both sides who have 
>>> incorporated most (if not all) great design ideas from Django (and 
>>> Rails)
>>>
>>> 2) IDEs ranging from Visual Studio to browser-based ones are available 
>>> to support such development
>>>
>>> 3) Python in the browser projects do not yet provide productive 
>>> debugging support (and will they ever without support from a tech giant?)
>>>
>>> 4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering JS 
>>> framework 
>>> running servers
>>>
>>> are the productivity gains from the more legible, concise and abstract 
>>> Python code as compared to

Implementing detailed access rights for users of different elements.

2014-01-28 Thread Anders
Dear Django developers,
I need a bit of advice on how to solve an authorization problem.

My site is a is still being designed in my mind but think of it as a
portal of mini-facebooks (Gang);
In each Gang there functions such as write on wall, upload pictures,
share links, sell/buy stuff, discuss and so on.

I see 3 basic roles;
 Admin (can do/see everything in a Gang)
 Users (can't edit/see configurations)
 Guest (can access a Gang if invited but only read)

A user can be a User in one Gang, a Guest in a second and Admin of a third.


The above, I guess could solve by simply having three ManyToMany-fields
(admins,users,guests) on each Gang-model, referencing the User table.


However I would like something more fine-grained, and see the roles as
"templates of accessrights".
E.g. the access rights should be as detailed as "Allow Create Gang",
"Allow Invite to Gang", "Allow Write on Wall" and so on.

And of course, these access rights are only relevant for a particular
user in a specific Gang (with the exception of the first).

Maybe it's too complicated and not worth it, but I am willing to try and
of course listen to the opinions of the experienced crowd here. :)


Another issue that bothers me is minor, but how to use these acessrights
in the template system to "hide" elements on the page for users who are
not allowed to interact with them.

Thank you for reading so far.

Regards
A.

-- 
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/52E7D3C6.4040005%40x76.eu.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Need Help Moving Database to production server

2014-01-28 Thread Mark Phillips
On Mon, Jan 27, 2014 at 11:51 PM, Mike Dewhirst wrote:

> On 28/01/2014 4:51pm, Mark Phillips wrote:
>
>> I have a django project running on my laptop. I have (finally) managed
>> to get it to work with apache on a production server. However, I still
>> have a problem. When I access the admin site and login as the superuser,
>> I get "you don't have permission to do anything" message.
>>
>
> I don't think this is a Django problem because the superuser doesn't need
> any permissions.


I am pretty sure it is a setup problem, from moving from development to
production in a different machine.


> Presumably this is after a successful login - you don't quite specify
> this.


Yes. I can login as the super user using the django admin login form, but I
cannot edit or see any tables in the admin page. Just the you can't edit
anything.

>
>
>
>> To migrate the database, I did a mysqldump to a file on the development
>> machine, then added it to the mysql server running on the production
>> machine. The only change was in the database name, none of the tables
>> changed. Is this the problem? Or, am I missing something else.
>>
>
> Did you also change the database name in your production settings.py?
>

Yesor I would not be able to login.

>
> Otherwise, I'd suspect a mismatch somewhere. For my own setups I always
> have the same user as the the database owner in Postgres and the superuser
> in Django. Dunno whether that has shielded me from this sort of problem or
> not.
>

I discovered the problem, but not the solution. I have the following lines
in my urls.py -

from django.contrib import admin
admin.autodiscover()

which work as expected in my development site. However, in my production
site if I leave the admin.autodiscover() in the urls.py, I get this error
message:

ImproperlyConfigured at /inventory
The included urlconf inventory_project.urls doesn't have any patterns in it

When I comment out the admin.autodiscovery(), the site works as expected,
except for the admin pages.

So, what do I need to do to make admin.autodiscovery() work in my
production site - Apache, mod_wsgi, and a virtual environment the same as
my development machine?

Thanks,

Mark

>
> hth
>
> Mike
>
>
>> Thanks!
>>
>> Mark
>>
>> --
>> 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/
>> CAEqej2NgioCC8csFPhJonZtnHL7bzbdLMYaQtzPwCVcY_0fumQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
> --
> 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/52E7535D.7030400%40dewhirst.com.au.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAEqej2MT5Xjxp-GXpY9mfahif%3D-brkWkxZWr5yo7tVUsGRfG0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread Cal Leeming [Simplicity Media Ltd]
It makes for an interesting debate and food for thought.

Python has a lot of libraries and user contributions which can speed up
development, but like every language, has it's good sides and bad sides.

Django holds a strong position, libraries such as south, pipeline,
mongoengine, uWSGI and the Django ORM itself make it incredibly easy to get
clean code quickly out the door.

Personally I think the biggest risk to Django's future is lack of public
contributions (separate debate), and evolution being held back for
backwards compatibility reasons (again, separate debate), rather than any
threat from new kids on the block. I would be quite surprised if NodeJS (as
an example) overtook Django in terms of functionality and popularity.

Disclaimer: I'm +1 python and -0 JS, and thus slightly biased.

Cal





On Mon, Jan 27, 2014 at 10:44 PM,  wrote:

> Hi,
>
> I would like to know if this community is somewhat worried about the
> future relevance of Django (and other purely server-side MV* Python web
> app frameworks such as web2py for that matter) given the current momentum
> of JavaScript (JS) everywhere?
>
> There are many competing architecture patterns for a WHOLE web app today
> ranging:
> a)  from client-heavy SPA with a client-side MVC framework synching its
> models via a REST API with a server-side reduced to a database access layer
>
> b) to light client apps with a server-side MVC frameworks and very little
> or no Ajax
>
> c) and everything in the middle.
>
> I guess it is not too controversial to say that which is best (or even
> merely adequate) depends on the generally moving target of the app
> requirements (especially the non-functional ones) and thus a long
> lifecycle app can be expected to have to change pattern at some point.
>
>
> Given that:
> 1) full web apps following any pattern can today be developed exclusively
> with JavaScript (JS) frameworks on both sides who have incorporated most
> (if not all) great design ideas from Django (and Rails)
>
> 2) IDEs ranging from Visual Studio to browser-based ones are available to
> support such development
>
> 3) Python in the browser projects do not yet provide productive debugging
> support (and will they ever without support from a tech giant?)
>
> 4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering JS framework
> running servers
>
> are the productivity gains from the more legible, concise and abstract
> Python code as compared to JS code really compensate the productivity
> loss of having to port part of the app from one language to other every
> time it must be pushed from one side (say server) to the other (say
> client), or even to maintain a code base in two languages instead of one?
>
> Why then adopt Django (or web2py) for a new project today, instead of
> going pure JS?
>
> I am a big Python fan in terms of design and principles, but I am fearing
> that it has started to lose the popularity/adoption/community size battle
> against JS, which, from a pragmatic productivity standpoint is relevant
> and thus potentially snowballing after a tipping point is reached. Trends
> are deadly fast in web development, cf. how quickly J2EE+static HTML, then
> J2EE+Flash and .NET+Silverlight have fallen from grace.
>
> Any thought on this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f01c1f78-aac4-467c-a777-a70ecd0de61e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAHKQagGvjtxt9wL727rKYpV2_QJWuYP0%3DAhY7xE7uZ%3D7gjwC4g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Commercial Django e-commerce products

2014-01-28 Thread donarb
On Tuesday, January 28, 2014 5:39:38 AM UTC-8, Alex Strickland wrote:
>
>
> Can anyone suggest any commercial Django e-commerce products? 
>
>
The only commercial one written in Django that I know of is WebCube. I know 
nothing about them, so can't make a suggestion.

www.getwebcube.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/2417d062-b5fa-4b86-92d1-c688bf317a65%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread James
This is something I've been thinking about myself lately.

I'm working on a side project right now that is extremely JS heavy on the 
client side. I eventually found myself saying screw it, and am now in the 
process of rewriting the client side using backbone. Django is more or less 
becoming a restful endpoint for me that communicates to my various 
datastores.

In my professional life this is pretty much the same, start with django / 
jinja templates and then once the jquery gets crazy, move to a real client 
side framework (such as backbone, angular, ember, etc). The next app we 
build is going to be backbone from the ground up on the client side. For 
anything much more complicated than some calender widgets this is going to 
be the pattern. For this app, we see something like 45% of our traffic 
coming from phones and other mobile devices, so creating views in django 
that are more rest based than page based makes a lot of sense and just let 
the client decide what to draw on the page, rather than the server.

I think in the next year or two we will be talking about a MV > MVC 
paradigm. Where the MV is django / rails / flask / node  and where the MVC 
is the client side. Right now the only MVC client side frameworks are 
written in javascript because the only way to manipulate the DOM is with 
JS. Therefore, if you are a startup or even an established company and you 
need to go out and hire some resources, it's more cost effective in the 
beginning to hire one person who knows javascript will and through them 
into node.js and backbone (or whatever).

That said, this doesn't really conflict with django's mission to "receive 
an http request and send an http response". Templating in Django has always 
been more of a batteries included feature more than a core feature, at 
least for me.

That said, right now node and js in general just aren't there yet to 
replace django / python or rails / ruby as a full on server side language 
for anything more complicated than ToDoMVC in my opinion. Considering in 
django it's easy for me to hook up to mysql, postgres, memcached, mongo, 
elasticsearch and rabbitmq all in the same app, and usually not much more 
config than a single line and pip install xyz. To my understanding, you 
don't get much of this in node.

That could change in the future of course, but at the end of the day, JS is 
not a pure OOP language while python and ruby are, even though it does a 
good job at trying to get most of the way there via prototype. What's more, 
I just don't think there is a way to do serious numerical heavy lifting in 
server side JS like I can get with numpy / scipy - and be performant by 
modern web standards.

I think the Dart project is interesting to give JS some competition on the 
client side, but I don't know a single dev who uses it in production. I 
didn't know about the mozilla project with python, but that sounds 
interesting. Maybe some day we will talk about dart being used on the 
server and client at the same time.

For now, I don't see python or ruby going very far for serious server side 
development. For simple ecommerce stuff or blog like apps, node might gain 
some share.








On Monday, January 27, 2014 5:44:12 PM UTC-5, damond...@gmail.com wrote:
>
> Hi,
>
> I would like to know if this community is somewhat worried about the 
> future relevance of Django (and other purely server-side MV* Python web 
> app frameworks such as web2py for that matter) given the current momentum 
> of JavaScript (JS) everywhere?
>
> There are many competing architecture patterns for a WHOLE web app today 
> ranging:
> a)  from client-heavy SPA with a client-side MVC framework synching its 
> models via a REST API with a server-side reduced to a database access layer
>
> b) to light client apps with a server-side MVC frameworks and very little 
> or no Ajax 
>
> c) and everything in the middle.
>
> I guess it is not too controversial to say that which is best (or even 
> merely adequate) depends on the generally moving target of the app 
> requirements (especially the non-functional ones) and thus a long 
> lifecycle app can be expected to have to change pattern at some point.
>
>
> Given that:
> 1) full web apps following any pattern can today be developed exclusively 
> with JavaScript (JS) frameworks on both sides who have incorporated most 
> (if not all) great design ideas from Django (and Rails)
>
> 2) IDEs ranging from Visual Studio to browser-based ones are available to 
> support such development
>
> 3) Python in the browser projects do not yet provide productive debugging 
> support (and will they ever without support from a tech giant?)
>
> 4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering JS framework 
> running servers
>
> are the productivity gains from the more legible, concise and abstract 
> Python code as compared to JS code really compensate the productivity 
> loss of having to port part of the app from one language to other every

Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread James Turley
I'm not sure I buy this stuff about JS taking over everything. The reason
is that client and server are different domains, and we might reasonably
expect - even in a pure JS-only shop - people to specialise anyway. Apart
from the tiniest start-ups, there isn't really an evolutionary advantage to
having the same language on both ends. Rather than people who know x
language, you primarily want people with familiarity with the
domain-specific problems.

It's worth noting that the JS hype is not the only thing at the moment:
among functional programming evangelists, there is a sense that "their time
has come" after years on the CS-boffin fringe. The theory goes like this -
nowadays, major web apps are deployed on enormous server clusters,
sometimes with enormous numbers of virtual or real CPU cores, database
sharding and so forth. The key problems facing server-side dev work - at
least at the top end of the web - have to do with handling all this,
parallelism, async, race conditions and so forth. A relatively 'pure' FP
language like Haskell, with its divine commandments against mutable state
and focus on pure functions, has a headstart on OOP languages like Python &
Ruby in this domain.

JS is *sort of *an FP language, and can be used to write pure code, but has
hitherto been used almost exclusively as a simple interface to that great
clump of mutable global state called the DOM; it certainly does not enforce
good FP practices or anything like that. The Node model of event-driven IO
is obviously directed at this group of problems, but it's very much a work
in progress, despite all the hype. (This is also a problem I have with
client-side MV* frameworks, BTW: I'm promised that picking up Ember is a
breeze, but major parts of the API change so frequently that it gives me
actual nightmares.)

Meanwhile, we've got the Async IO library coming in Python 3.4; and, as
others have pointed out, a headstart on big data crunching thanks to
Python's excellent math/science ecosystem. I'm sure the Ruby people have
tricks up their sleeve. And there's Go. And Scala. And Clojure. And ...

The point is: there's an enormous explosion of new tools around, plus
serious improvements in old favourites. Devs who know what's good for them
will use the correct tool for the job at hand; the cognitive convenience of
working in one language only is a part of that decision, but only a part.


On Tue, Jan 28, 2014 at 4:27 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> It makes for an interesting debate and food for thought.
>
> Python has a lot of libraries and user contributions which can speed up
> development, but like every language, has it's good sides and bad sides.
>
> Django holds a strong position, libraries such as south, pipeline,
> mongoengine, uWSGI and the Django ORM itself make it incredibly easy to get
> clean code quickly out the door.
>
> Personally I think the biggest risk to Django's future is lack of public
> contributions (separate debate), and evolution being held back for
> backwards compatibility reasons (again, separate debate), rather than any
> threat from new kids on the block. I would be quite surprised if NodeJS (as
> an example) overtook Django in terms of functionality and popularity.
>
> Disclaimer: I'm +1 python and -0 JS, and thus slightly biased.
>
> Cal
>
>
>
>
>
> On Mon, Jan 27, 2014 at 10:44 PM,  wrote:
>
>> Hi,
>>
>> I would like to know if this community is somewhat worried about the
>> future relevance of Django (and other purely server-side MV* Python web
>> app frameworks such as web2py for that matter) given the current momentum
>> of JavaScript (JS) everywhere?
>>
>> There are many competing architecture patterns for a WHOLE web app today
>> ranging:
>> a)  from client-heavy SPA with a client-side MVC framework synching its
>> models via a REST API with a server-side reduced to a database access layer
>>
>> b) to light client apps with a server-side MVC frameworks and very
>> little or no Ajax
>>
>> c) and everything in the middle.
>>
>> I guess it is not too controversial to say that which is best (or even
>> merely adequate) depends on the generally moving target of the app
>> requirements (especially the non-functional ones) and thus a long
>> lifecycle app can be expected to have to change pattern at some point.
>>
>>
>> Given that:
>> 1) full web apps following any pattern can today be developed exclusively
>> with JavaScript (JS) frameworks on both sides who have incorporated most
>> (if not all) great design ideas from Django (and Rails)
>>
>> 2) IDEs ranging from Visual Studio to browser-based ones are available
>> to support such development
>>
>> 3) Python in the browser projects do not yet provide productive debugging
>> support (and will they ever without support from a tech giant?)
>>
>> 4) Cloud giants (Amazon, Google, Heroku, Microsoft) all offering JS framework
>> running servers
>>
>> are the productivity gains from the more legible, co

We're about to start hiring Python/Django developers, where should we advertise?

2014-01-28 Thread Stephen Hawkes
So,

Sitting here in our new offices in Solihull (UK), I've exhausted the 
uni-mates, contacts from past projects, now I need to know where to focus 
the search next.

We're looking for people to help us build apps for our clients, people like 
Greenpeace, Tearfund, Macmillan and others.
One in every 10 projects, we do for free for good-causes, so the 
recruitment agent route felt a little evil to us...

- UK developers seem light on the ground this month.

Where do you look for the next big job?

Any help here would be had! Shout if you know someone too!

~Steve

--
Director @ Blanc
http://blanc.ltd.uk

-- 
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/a09c5534-ebb7-48ca-9ab9-e940ad3a5ae4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


moving from sqlite3 to mysql

2014-01-28 Thread Malik Rumi
This is somewhat like the question in "need help moving to production 
server" but I think the right procedure is to start a new thread. So I 
think I have done well for just starting out. With your help I've gotten 
Django running on Windows, and I completed a tutorial and got my site 
working locally with the admin. thank you.

So I thought I was ready to move up to MySQL for some heavy lifting. I 
followed the instructions I got here 
http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html.
 
I did not know what to do with the NAME part, so I put in 'django-1', and 
promptly got the error message 'unknown database 'django-1'. I thought that 
made sense because I hadn’t created this database in mysql already, but I 
was just blindly following along. Having to CREATE DATABASE doesn’t make 
sense, I thought, because it defeats the purpose of Django abstraction in 
the first place. Besides, when I syncdb, it should take whatever name I 
gave it when I was using sqlite3, right?

Wrong. When I ran syncdb, this time with NAME: ' ', I got :   File 
"C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default 
terror handlerraise errorclass, errorvalue 
django.db.utils.OperationalError: (1046, 'No database selected').

So, what am I missing here? There almost certainly is an easy solution I'm 
not seeing. Do I need to create a database in mysql? If so, must it have 
the same name as it had in sqlite3? I know that name was made from putting 
the model name together with something else, but I don't actually remember 
what it was, and it seems like a lot of extra work to install an sqlite 
browser just to get that name right. If that's what I need to do, maybe I 
can just open that file with notepad? 

Or can I create the database, (presumably directly in the shell), and then 
empty it, as these instructions say, and that will take care of it? I 
frankly didn't understand why I would need to 'empty' a new and empty 
database, but that's what it says. 

Any and all helpful advise welcome and appreciated. 

-- 
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/f4a6d446-7cf8-498a-8ba5-04e339dd80b9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-01-28 Thread donarb
On Tuesday, January 28, 2014 9:17:32 AM UTC-8, Malik Rumi wrote:
>
> This is somewhat like the question in "need help moving to production 
> server" but I think the right procedure is to start a new thread. So I 
> think I have done well for just starting out. With your help I've gotten 
> Django running on Windows, and I completed a tutorial and got my site 
> working locally with the admin. thank you.
>
> So I thought I was ready to move up to MySQL for some heavy lifting. I 
> followed the instructions I got here 
> http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html.
>  
> I did not know what to do with the NAME part, so I put in 'django-1', and 
> promptly got the error message 'unknown database 'django-1'. I thought that 
> made sense because I hadn’t created this database in mysql already, but I 
> was just blindly following along. Having to CREATE DATABASE doesn’t make 
> sense, I thought, because it defeats the purpose of Django abstraction in 
> the first place. Besides, when I syncdb, it should take whatever name I 
> gave it when I was using sqlite3, right?
>
> Wrong. When I ran syncdb, this time with NAME: ' ', I got :   File 
> "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default 
> terror handlerraise errorclass, errorvalue 
> django.db.utils.OperationalError: (1046, 'No database selected').
>
> So, what am I missing here? There almost certainly is an easy solution I'm 
> not seeing. Do I need to create a database in mysql? If so, must it have 
> the same name as it had in sqlite3? I know that name was made from putting 
> the model name together with something else, but I don't actually remember 
> what it was, and it seems like a lot of extra work to install an sqlite 
> browser just to get that name right. If that's what I need to do, maybe I 
> can just open that file with notepad? 
>
> Or can I create the database, (presumably directly in the shell), and then 
> empty it, as these instructions say, and that will take care of it? I 
> frankly didn't understand why I would need to 'empty' a new and empty 
> database, but that's what it says. 
>
> Any and all helpful advise welcome and appreciated. 
>

You should go through the tutorial, which explains how to create a project.

>From the database setup page:

*"If you’re using PostgreSQL or MySQL, make sure you’ve created a database 
by this point. Do that with “CREATE DATABASE database_name;” within your 
database’s interactive prompt.*

*If you’re using SQLite, you don’t need to create anything beforehand - the 
database file will be created automatically when it is needed." *

https://docs.djangoproject.com/en/1.6/intro/tutorial01/#database-setup


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c991d28f-720e-495a-b7ae-3e8d7e52dcef%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Implementing detailed access rights for users of different elements.

2014-01-28 Thread Malik Rumi
I don't have any solutions for you, but I am VERY interested in the 
responses, since you describe some of the same issues I will have soon but 
have not gotten to yet - especially the last one, which I don't think is 
'minor' at all. So, how about it, all you experienced users out there? 
Answer this one and you get a twofer!

On Tuesday, January 28, 2014 9:59:02 AM UTC-6, Anders wrote:
>
> Dear Django developers, 
> I need a bit of advice on how to solve an authorization problem. 
>
> My site is a is still being designed in my mind but think of it as a 
> portal of mini-facebooks (Gang); 
> In each Gang there functions such as write on wall, upload pictures, 
> share links, sell/buy stuff, discuss and so on. 
>
> I see 3 basic roles; 
>  Admin (can do/see everything in a Gang) 
>  Users (can't edit/see configurations) 
>  Guest (can access a Gang if invited but only read) 
>
> A user can be a User in one Gang, a Guest in a second and Admin of a 
> third. 
>
>
> The above, I guess could solve by simply having three ManyToMany-fields 
> (admins,users,guests) on each Gang-model, referencing the User table. 
>
>
> However I would like something more fine-grained, and see the roles as 
> "templates of accessrights". 
> E.g. the access rights should be as detailed as "Allow Create Gang", 
> "Allow Invite to Gang", "Allow Write on Wall" and so on. 
>
> And of course, these access rights are only relevant for a particular 
> user in a specific Gang (with the exception of the first). 
>
> Maybe it's too complicated and not worth it, but I am willing to try and 
> of course listen to the opinions of the experienced crowd here. :) 
>
>
> Another issue that bothers me is minor, but how to use these acessrights 
> in the template system to "hide" elements on the page for users who are 
> not allowed to interact with them. 
>
> Thank you for reading so far. 
>
> Regards 
> A. 
>
>

-- 
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/988c4489-aa28-4b32-884a-ededf531090b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-28 Thread Cal Leeming [Simplicity Media Ltd]
+1 well said.

Cal


On Tue, Jan 28, 2014 at 4:59 PM, James Turley <
jamesturley1...@googlemail.com> wrote:

> I'm not sure I buy this stuff about JS taking over everything. The reason
> is that client and server are different domains, and we might reasonably
> expect - even in a pure JS-only shop - people to specialise anyway. Apart
> from the tiniest start-ups, there isn't really an evolutionary advantage to
> having the same language on both ends. Rather than people who know x
> language, you primarily want people with familiarity with the
> domain-specific problems.
>
> It's worth noting that the JS hype is not the only thing at the moment:
> among functional programming evangelists, there is a sense that "their time
> has come" after years on the CS-boffin fringe. The theory goes like this -
> nowadays, major web apps are deployed on enormous server clusters,
> sometimes with enormous numbers of virtual or real CPU cores, database
> sharding and so forth. The key problems facing server-side dev work - at
> least at the top end of the web - have to do with handling all this,
> parallelism, async, race conditions and so forth. A relatively 'pure' FP
> language like Haskell, with its divine commandments against mutable state
> and focus on pure functions, has a headstart on OOP languages like Python &
> Ruby in this domain.
>
> JS is *sort of *an FP language, and can be used to write pure code, but
> has hitherto been used almost exclusively as a simple interface to that
> great clump of mutable global state called the DOM; it certainly does not
> enforce good FP practices or anything like that. The Node model of
> event-driven IO is obviously directed at this group of problems, but it's
> very much a work in progress, despite all the hype. (This is also a problem
> I have with client-side MV* frameworks, BTW: I'm promised that picking up
> Ember is a breeze, but major parts of the API change so frequently that it
> gives me actual nightmares.)
>
> Meanwhile, we've got the Async IO library coming in Python 3.4; and, as
> others have pointed out, a headstart on big data crunching thanks to
> Python's excellent math/science ecosystem. I'm sure the Ruby people have
> tricks up their sleeve. And there's Go. And Scala. And Clojure. And ...
>
> The point is: there's an enormous explosion of new tools around, plus
> serious improvements in old favourites. Devs who know what's good for them
> will use the correct tool for the job at hand; the cognitive convenience of
> working in one language only is a part of that decision, but only a part.
>
>
> On Tue, Jan 28, 2014 at 4:27 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> It makes for an interesting debate and food for thought.
>>
>> Python has a lot of libraries and user contributions which can speed up
>> development, but like every language, has it's good sides and bad sides.
>>
>> Django holds a strong position, libraries such as south, pipeline,
>> mongoengine, uWSGI and the Django ORM itself make it incredibly easy to get
>> clean code quickly out the door.
>>
>> Personally I think the biggest risk to Django's future is lack of public
>> contributions (separate debate), and evolution being held back for
>> backwards compatibility reasons (again, separate debate), rather than any
>> threat from new kids on the block. I would be quite surprised if NodeJS (as
>> an example) overtook Django in terms of functionality and popularity.
>>
>> Disclaimer: I'm +1 python and -0 JS, and thus slightly biased.
>>
>> Cal
>>
>>
>>
>>
>>
>> On Mon, Jan 27, 2014 at 10:44 PM,  wrote:
>>
>>> Hi,
>>>
>>> I would like to know if this community is somewhat worried about the
>>> future relevance of Django (and other purely server-side MV* Python web
>>> app frameworks such as web2py for that matter) given the current momentum
>>> of JavaScript (JS) everywhere?
>>>
>>> There are many competing architecture patterns for a WHOLE web app today
>>> ranging:
>>> a)  from client-heavy SPA with a client-side MVC framework synching its
>>> models via a REST API with a server-side reduced to a database access layer
>>>
>>> b) to light client apps with a server-side MVC frameworks and very
>>> little or no Ajax
>>>
>>> c) and everything in the middle.
>>>
>>> I guess it is not too controversial to say that which is best (or even
>>> merely adequate) depends on the generally moving target of the app
>>> requirements (especially the non-functional ones) and thus a long
>>> lifecycle app can be expected to have to change pattern at some point.
>>>
>>>
>>> Given that:
>>> 1) full web apps following any pattern can today be developed
>>> exclusively with JavaScript (JS) frameworks on both sides who have
>>> incorporated most (if not all) great design ideas from Django (and
>>> Rails)
>>>
>>> 2) IDEs ranging from Visual Studio to browser-based ones are available
>>> to support such development
>>>
>>> 3) Python in the browser projects do not yet provid

Django models design for ride share application

2014-01-28 Thread Kannan
I am working on a ride share application. I need help on designing the
models for private messages.

I have designed the below models, its look like complex in querying them in
views. can you guys help me in design a better and easy one!

class Ride(models.Model):
type = models.BooleanField(default=False)
add_source = models.ForeignKey(Address, related_name='source')
add_destination = models.ForeignKey(Address, related_name='destination')
ride_startDateTime = models.DateTimeField(default=
datetime.datetime.now, blank=True)
ride_startPref = models.CharField(max_length=10, choices=CHOICES,
default='None')
class Conversation(models.Model):
ride_id = models.ForeignKey(Ride)
class Messages(models.Model):
conversation_id = models.ForeignKey(Conversation)
ride_id = models.ForeignKey(Ride)
sender_id = models.ForeignKey(User, related_name='sender')
receiver_id = models.ForeignKey(User, related_name='receiver')
Content = models.TextField(max_length=1000,blank=True)
timestamp = models.DateTimeField(default= datetime.datetime.now, blank=True)
status = models.CharField(max_length=10,blank=True)

User model is django inbuilt. Please consider the following use cases:

1) A Conversation has to integrate with Ride, For Ex: User X is a owner of
ride 3, User Y can contact X for this ride(3), then the new conversation
id(77) will be generated. After that whatever messages sent between them
should be under the same conversation id(77). If another user Z is trying
to contact the user X for the same ride 3, then a new conversation ID(33)
has to generated.

2) If the user X having another ride called 4, then if user Y contact the
User X through the other ride means, it has to generate new conversation
id(99) and all the messages sent between them on the ride should come under
the same conversation id(99).

-- 
With regards,

Kannan. R. P,
Blog @: http://kannan4k.wordpress.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/CAL4xV_BpNS1%3DQN1aaugBDbDyQ0TCTf3cMc2YRjWd21A%3DYT8XLg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: overlay esri shapefiles from database in googlemap

2014-01-28 Thread Alex Mandel
On 01/26/2014 07:07 PM, jenelyn refamonte wrote:
> hello everyone,. i am developing dynamic web mapping application using 
> geodjango framework.. i already displayed a googlemap as my basemap. It is 
> for public users not in the admin interface,.. now, i want to 
> display/overlay my esri shapefiles stored in my postgis databsase to the 
> googlemap.. Its very hard for me. its my first time.. please help me.. is 
> there any tutorial or article that i can base of,.? im stucked here for 
> almost 3 weeks., please please please help.. thanks in advance :)
> 

Try the django olwidget (openlayers widget), it's one of the simpler
ways to get started.

The other tool I use all the time is the python vectorformats library to
convert a django model to geojson which can be passed to a leaflet or
openlayers front end.

Enjoy,
Alex

-- 
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/52E82660.7080403%40wildintellect.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Need Help Moving Database to production server

2014-01-28 Thread Alex Mandel
On 01/28/2014 08:15 AM, Mark Phillips wrote:
> On Mon, Jan 27, 2014 at 11:51 PM, Mike Dewhirst wrote:
> 
>> On 28/01/2014 4:51pm, Mark Phillips wrote:
>>
>>> I have a django project running on my laptop. I have (finally) managed
>>> to get it to work with apache on a production server. However, I still
>>> have a problem. When I access the admin site and login as the superuser,
>>> I get "you don't have permission to do anything" message.
>>>
>>
>> I don't think this is a Django problem because the superuser doesn't need
>> any permissions.
> 
> 
> I am pretty sure it is a setup problem, from moving from development to
> production in a different machine.
> 
> 
>> Presumably this is after a successful login - you don't quite specify
>> this.
> 
> 
> Yes. I can login as the super user using the django admin login form, but I
> cannot edit or see any tables in the admin page. Just the you can't edit
> anything.
> 
>>
>>
>>
>>> To migrate the database, I did a mysqldump to a file on the development
>>> machine, then added it to the mysql server running on the production
>>> machine. The only change was in the database name, none of the tables
>>> changed. Is this the problem? Or, am I missing something else.
>>>
>>
>> Did you also change the database name in your production settings.py?
>>
> 
> Yesor I would not be able to login.
> 
>>
>> Otherwise, I'd suspect a mismatch somewhere. For my own setups I always
>> have the same user as the the database owner in Postgres and the superuser
>> in Django. Dunno whether that has shielded me from this sort of problem or
>> not.
>>
> 
> I discovered the problem, but not the solution. I have the following lines
> in my urls.py -
> 
> from django.contrib import admin
> admin.autodiscover()
> 
> which work as expected in my development site. However, in my production
> site if I leave the admin.autodiscover() in the urls.py, I get this error
> message:
> 
> ImproperlyConfigured at /inventory
> The included urlconf inventory_project.urls doesn't have any patterns in it
> 
> When I comment out the admin.autodiscovery(), the site works as expected,
> except for the admin pages.
> 
> So, what do I need to do to make admin.autodiscovery() work in my
> production site - Apache, mod_wsgi, and a virtual environment the same as
> my development machine?
> 

Did you enable the admin in the settings.py and urls.py of the
production server?

Thanks,
Alex

-- 
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/52E827BA.708%40wildintellect.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Need Help Moving Database to production server

2014-01-28 Thread Mark Phillips
On Tue, Jan 28, 2014 at 2:57 PM, Alex Mandel wrote:

> On 01/28/2014 08:15 AM, Mark Phillips wrote:
> > On Mon, Jan 27, 2014 at 11:51 PM, Mike Dewhirst  >wrote:
> >
> >> On 28/01/2014 4:51pm, Mark Phillips wrote:
> >>
> >>> I have a django project running on my laptop. I have (finally) managed
> >>> to get it to work with apache on a production server. However, I still
> >>> have a problem. When I access the admin site and login as the
> superuser,
> >>> I get "you don't have permission to do anything" message.
> >>>
> >>
> >> I don't think this is a Django problem because the superuser doesn't
> need
> >> any permissions.
> >
> >
> > I am pretty sure it is a setup problem, from moving from development to
> > production in a different machine.
> >
> >
> >> Presumably this is after a successful login - you don't quite specify
> >> this.
> >
> >
> > Yes. I can login as the super user using the django admin login form,
> but I
> > cannot edit or see any tables in the admin page. Just the you can't edit
> > anything.
> >
> >>
> >>
> >>
> >>> To migrate the database, I did a mysqldump to a file on the development
> >>> machine, then added it to the mysql server running on the production
> >>> machine. The only change was in the database name, none of the tables
> >>> changed. Is this the problem? Or, am I missing something else.
> >>>
> >>
> >> Did you also change the database name in your production settings.py?
> >>
> >
> > Yesor I would not be able to login.
> >
> >>
> >> Otherwise, I'd suspect a mismatch somewhere. For my own setups I always
> >> have the same user as the the database owner in Postgres and the
> superuser
> >> in Django. Dunno whether that has shielded me from this sort of problem
> or
> >> not.
> >>
> >
> > I discovered the problem, but not the solution. I have the following
> lines
> > in my urls.py -
> >
> > from django.contrib import admin
> > admin.autodiscover()
> >
> > which work as expected in my development site. However, in my production
> > site if I leave the admin.autodiscover() in the urls.py, I get this error
> > message:
> >
> > ImproperlyConfigured at /inventory
> > The included urlconf inventory_project.urls doesn't have any patterns in
> it
> >
> > When I comment out the admin.autodiscovery(), the site works as expected,
> > except for the admin pages.
> >
> > So, what do I need to do to make admin.autodiscovery() work in my
> > production site - Apache, mod_wsgi, and a virtual environment the same as
> > my development machine?
> >
>
> Did you enable the admin in the settings.py and urls.py of the
> production server?
>
> As far as I know, I did. The code base runs on the development machine,
and I did not make any changes to it for the production machine.

Thanks,

Mark

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


moving from sqlite3 to mysql

2014-01-28 Thread Daniel Roseman
You're confusing databases with tables.
 Django will create the tables for you, but they need a database to go in
 You need to create that yourself with the simple CREATE DATABASE command in 
mysql.
--
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/01407d51-e1bd-4ed6-a141-bc5ba454922a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-01-28 Thread Ariel E. Isidro
"Or can I create the database, (presumably directly in the shell), and then
empty it, as these instructions say, and that will take care of it? I
frankly didn't understand why I would need to 'empty' a new and empty
database, but that's what it says. "

With sql lite, everything will be created for you.
While with MySQL,  you should create the database directly in the shell,
and this should give you an empty database.  The Django tables will be
created after configuring your settings, and running  syncdb.




On Wed, Jan 29, 2014 at 1:17 AM, Malik Rumi  wrote:

> This is somewhat like the question in "need help moving to production
> server" but I think the right procedure is to start a new thread. So I
> think I have done well for just starting out. With your help I've gotten
> Django running on Windows, and I completed a tutorial and got my site
> working locally with the admin. thank you.
>
> So I thought I was ready to move up to MySQL for some heavy lifting. I
> followed the instructions I got here
> http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html.
> I did not know what to do with the NAME part, so I put in 'django-1', and
> promptly got the error message 'unknown database 'django-1'. I thought that
> made sense because I hadn't created this database in mysql already, but I
> was just blindly following along. Having to CREATE DATABASE doesn't make
> sense, I thought, because it defeats the purpose of Django abstraction in
> the first place. Besides, when I syncdb, it should take whatever name I
> gave it when I was using sqlite3, right?
>
> Wrong. When I ran syncdb, this time with NAME: ' ', I got :   File
> "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default
> terror handlerraise errorclass, errorvalue
> django.db.utils.OperationalError: (1046, 'No database selected').
>
> So, what am I missing here? There almost certainly is an easy solution I'm
> not seeing. Do I need to create a database in mysql? If so, must it have
> the same name as it had in sqlite3? I know that name was made from putting
> the model name together with something else, but I don't actually remember
> what it was, and it seems like a lot of extra work to install an sqlite
> browser just to get that name right. If that's what I need to do, maybe I
> can just open that file with notepad?
>
> Or can I create the database, (presumably directly in the shell), and then
> empty it, as these instructions say, and that will take care of it? I
> frankly didn't understand why I would need to 'empty' a new and empty
> database, but that's what it says.
>
> Any and all helpful advise welcome and appreciated.
>
>   --
> 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/f4a6d446-7cf8-498a-8ba5-04e339dd80b9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Ariel E. Isidro*
Backup your important files, click here  

DISCLAIMER: This message is for the designated recipient only and may
contain confidential and/or privileged information. If you have received it
in error, please delete it and advise the sender immediately. You should
not copy or use it for any other purpose, nor disclose its contents to any
other person.

-- 
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/CAECOjiZL2Jx0M%2BYVdpX45TQDfQBGNgzMGGmOo6XiGb6JtwVkgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


virtualenv on Windows

2014-01-28 Thread Mike Dewhirst
A little while ago I suggested to someone using Windows to implement 
virtualenv "later". So I thought I'd document my experience here.


In summary, it probably works well if you have Visual Studio. The 
process outlined below shows a clumsy workaround if you don't.


Hope it helps someone

Mike

- - - - - -

$pip install virtualenv # first step (requires pip obviously)

$mkdir c:\users\miked\env

$virtualenv --no-site-packages c:\users\miked\env\proj-x
New python executable in c:\users\miked\env\proj-x\Scripts\python.exe
Installing setuptools, pip...done.

Now copy your "myproject-x" into c:\users\miked\env\proj-x\myproject-x

At this point on Linux one would install virtualenv-wrapper but that is 
unfortunately not available for Windows so a simple workaround is ...


1. mkdir \users\miked\bin # could be anything eg \users\miked\bat

2. Add C:\users\miked\bin to the path environment variable

3. Create a batch file called C:\users\miked\bin\proj-x.bat containing:

cd \users\miked\env\proj-x\myproject-x
..\Scripts\activate

4. Create another batch file 
C:\users\miked\env\proj-x\myproject-x\exit.bat containing:


cd \users\miked\
\users\miked\env\proj-x\Scripts\deactivate

5. Test the workaround by opening a command prompt somewhere and 
entering proj-x. You should see:


C:\Documents and Settings\Mike Dewhirst\Desktop>cd 
\users\miked\env\proj-x\myproject-x


C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
(proj-x) C:\users\miked\env\proj-x\myproject-x>

6. Test the exit batch file by entering exit at that command prompt:

C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
(proj-x) C:\users\miked\env\proj-x\myproject-x>exit

(proj-x) C:\users\miked\env\proj-x\myproject-x>cd \users\miked\

(proj-x) C:\users\miked>\users\miked\env\proj-x\Scripts\deactivate
C:\users\miked>

This should let you get into and out of the virtualenv quite easily.

Now comes the difficult bit for Windows - installing stuff in the new 
Python's site-packages. First, though, discover what you already have 
installed in your main site-packages:


pip freeze > requirements.txt  # lists existing site-packages

Here is mine, most of which I don't want in proj-x

Django==1.5.4
Jinja2==2.7.1
MarkupSafe==0.18
Pygments==1.6
South==0.7.6
Sphinx==1.1.3
coverage==3.7
django-discover-runner==1.0
docutils==0.9.1
filemov==1.1.1-2728-py2.7
pillow==2.3.0
pss==1.38
psycopg2==2.4.5
py2exe==0.6.9
pytz==2012h
pywin32==218
virtualenv==1.11.2

So I edit it down to the following, create a directory and save it as 
C:\users\miked\env\proj-x\requirements\requirements.txt


Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0
pillow==2.3.0
psycopg2==2.4.5
pytz==2013.9

pip install -r C:\users\miked\env\proj-x\requirements\requirements.txt

And this where (my) problems start. First pip will download the packages 
successfully but I don't have Visual Studio installed so those packages 
requiring compilation don't get installed. Here is a snippet of pip 
output after the downloads:


Installing collected packages: Django, South, coverage, 
django-discover-runner, pillow, psycopg2, pytz

  Running setup.py install for Django

... and so on until errors start to appear. In my case the signal is:

error: Unable to find vcvarsall.bat

Afterwards, pip freeze shows:

(proj-x) C:\users\miked\env\proj-x>pip freeze
Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0

... which indicates pillow, psycopg2 and pytz did not install.

But how come they were installed in the main site-packages? That's 
because they were originally downloaded from 
http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed manually.


However, even after downloading from that site they cannot be installed 
manually into a virtualenv! Only pip can do that. The only workaround I 
have found is to manually copy them from the main site-packages to the 
new virtualenv site-packages. Clumsy.


My proj-x requirements.txt file now looks like this ...

Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0
# pillow==2.3.0 http://www.lfd.uci.edu/~gohlke/pythonlibs/
# psycopg2==2.4.5 http://www.lfd.uci.edu/~gohlke/pythonlibs/
# pytz==2013.9 http://www.lfd.uci.edu/~gohlke/pythonlibs/

After the above clumsy workaround everything works well and pip freeze 
displays ...


Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0
pillow==2.3.0
psycopg2==2.4.5
pytz==2013.9



--
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/52E86DE2.5010907%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.


Re: virtualenv on Windows

2014-01-28 Thread Sam Lai
> However, even after downloading from that site they cannot be installed 
> manually into a virtualenv! Only pip can do that.

You can install the packages from
http://www.lfd.uci.edu/~gohlke/pythonlibs/ by simply running -

pip install 

... from inside your virtualenv. Those .exe files are pip-compatible
ZIP archives

On 29 January 2014 13:56, Mike Dewhirst  wrote:
> A little while ago I suggested to someone using Windows to implement
> virtualenv "later". So I thought I'd document my experience here.
>
> In summary, it probably works well if you have Visual Studio. The process
> outlined below shows a clumsy workaround if you don't.
>
> Hope it helps someone
>
> Mike
>
> - - - - - -
>
> $pip install virtualenv # first step (requires pip obviously)
>
> $mkdir c:\users\miked\env
>
> $virtualenv --no-site-packages c:\users\miked\env\proj-x
> New python executable in c:\users\miked\env\proj-x\Scripts\python.exe
> Installing setuptools, pip...done.
>
> Now copy your "myproject-x" into c:\users\miked\env\proj-x\myproject-x
>
> At this point on Linux one would install virtualenv-wrapper but that is
> unfortunately not available for Windows so a simple workaround is ...
>
> 1. mkdir \users\miked\bin # could be anything eg \users\miked\bat
>
> 2. Add C:\users\miked\bin to the path environment variable
>
> 3. Create a batch file called C:\users\miked\bin\proj-x.bat containing:
>
> cd \users\miked\env\proj-x\myproject-x
> ..\Scripts\activate
>
> 4. Create another batch file C:\users\miked\env\proj-x\myproject-x\exit.bat
> containing:
>
> cd \users\miked\
> \users\miked\env\proj-x\Scripts\deactivate
>
> 5. Test the workaround by opening a command prompt somewhere and entering
> proj-x. You should see:
>
> C:\Documents and Settings\Mike Dewhirst\Desktop>cd
> \users\miked\env\proj-x\myproject-x
>
> C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
> (proj-x) C:\users\miked\env\proj-x\myproject-x>
>
> 6. Test the exit batch file by entering exit at that command prompt:
>
> C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
> (proj-x) C:\users\miked\env\proj-x\myproject-x>exit
>
> (proj-x) C:\users\miked\env\proj-x\myproject-x>cd \users\miked\
>
> (proj-x) C:\users\miked>\users\miked\env\proj-x\Scripts\deactivate
> C:\users\miked>
>
> This should let you get into and out of the virtualenv quite easily.
>
> Now comes the difficult bit for Windows - installing stuff in the new
> Python's site-packages. First, though, discover what you already have
> installed in your main site-packages:
>
> pip freeze > requirements.txt  # lists existing site-packages
>
> Here is mine, most of which I don't want in proj-x
>
> Django==1.5.4
> Jinja2==2.7.1
> MarkupSafe==0.18
> Pygments==1.6
> South==0.7.6
> Sphinx==1.1.3
> coverage==3.7
> django-discover-runner==1.0
> docutils==0.9.1
> filemov==1.1.1-2728-py2.7
> pillow==2.3.0
> pss==1.38
> psycopg2==2.4.5
> py2exe==0.6.9
> pytz==2012h
> pywin32==218
> virtualenv==1.11.2
>
> So I edit it down to the following, create a directory and save it as
> C:\users\miked\env\proj-x\requirements\requirements.txt
>
> Django==1.5.4
> South==0.7.6
> coverage==3.7
> django-discover-runner==1.0
> pillow==2.3.0
> psycopg2==2.4.5
> pytz==2013.9
>
> pip install -r C:\users\miked\env\proj-x\requirements\requirements.txt
>
> And this where (my) problems start. First pip will download the packages
> successfully but I don't have Visual Studio installed so those packages
> requiring compilation don't get installed. Here is a snippet of pip output
> after the downloads:
>
> Installing collected packages: Django, South, coverage,
> django-discover-runner, pillow, psycopg2, pytz
>   Running setup.py install for Django
>
> ... and so on until errors start to appear. In my case the signal is:
>
> error: Unable to find vcvarsall.bat
>
> Afterwards, pip freeze shows:
>
> (proj-x) C:\users\miked\env\proj-x>pip freeze
> Django==1.5.4
> South==0.7.6
> coverage==3.7
> django-discover-runner==1.0
>
> ... which indicates pillow, psycopg2 and pytz did not install.
>
> But how come they were installed in the main site-packages? That's because
> they were originally downloaded from
> http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed manually.
>
> However, even after downloading from that site they cannot be installed
> manually into a virtualenv! Only pip can do that. The only workaround I have
> found is to manually copy them from the main site-packages to the new
> virtualenv site-packages. Clumsy.
>
> My proj-x requirements.txt file now looks like this ...
>
> Django==1.5.4
> South==0.7.6
> coverage==3.7
> django-discover-runner==1.0
> # pillow==2.3.0 http://www.lfd.uci.edu/~gohlke/pythonlibs/
> # psycopg2==2.4.5 http://www.lfd.uci.edu/~gohlke/pythonlibs/
> # pytz==2013.9 http://www.lfd.uci.edu/~gohlke/pythonlibs/
>
> After the above clumsy workaround everything works well and pip freeze
> displays ...
>
> Django==1.5.4
> South==0.7.6
> coverage==3.7
> django-discover-runner==1.0
> pillow==2.3.0
> psyc

Re: virtualenv on Windows

2014-01-28 Thread Mike Dewhirst

On 29/01/2014 2:23pm, Sam Lai wrote:

However, even after downloading from that site they cannot be installed 
manually into a virtualenv! Only pip can do that.


You can install the packages from
http://www.lfd.uci.edu/~gohlke/pythonlibs/ by simply running -

pip install 


I did try that earlier but had no luck. Maybe I got the incantation wrong?

(proj-x) C:\users\miked\env\proj-x>pip install 
C:\install_kits\python\postgresql\psycopg2-2.4.5.win32-py2.7.exe


Exception:
Traceback
...
ValueError: ('Missing distribution spec', 
'\\install_kits\\python\\postgresql\\psycopg2-2.4.5.win32-py2.7.exe')


Mike



... from inside your virtualenv. Those .exe files are pip-compatible
ZIP archives

On 29 January 2014 13:56, Mike Dewhirst  wrote:

A little while ago I suggested to someone using Windows to implement
virtualenv "later". So I thought I'd document my experience here.

In summary, it probably works well if you have Visual Studio. The process
outlined below shows a clumsy workaround if you don't.

Hope it helps someone

Mike

- - - - - -

$pip install virtualenv # first step (requires pip obviously)

$mkdir c:\users\miked\env

$virtualenv --no-site-packages c:\users\miked\env\proj-x
New python executable in c:\users\miked\env\proj-x\Scripts\python.exe
Installing setuptools, pip...done.

Now copy your "myproject-x" into c:\users\miked\env\proj-x\myproject-x

At this point on Linux one would install virtualenv-wrapper but that is
unfortunately not available for Windows so a simple workaround is ...

1. mkdir \users\miked\bin # could be anything eg \users\miked\bat

2. Add C:\users\miked\bin to the path environment variable

3. Create a batch file called C:\users\miked\bin\proj-x.bat containing:

cd \users\miked\env\proj-x\myproject-x
..\Scripts\activate

4. Create another batch file C:\users\miked\env\proj-x\myproject-x\exit.bat
containing:

cd \users\miked\
\users\miked\env\proj-x\Scripts\deactivate

5. Test the workaround by opening a command prompt somewhere and entering
proj-x. You should see:

C:\Documents and Settings\Mike Dewhirst\Desktop>cd
\users\miked\env\proj-x\myproject-x

C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
(proj-x) C:\users\miked\env\proj-x\myproject-x>

6. Test the exit batch file by entering exit at that command prompt:

C:\users\miked\env\proj-x\myproject-x>..\Scripts\activate
(proj-x) C:\users\miked\env\proj-x\myproject-x>exit

(proj-x) C:\users\miked\env\proj-x\myproject-x>cd \users\miked\

(proj-x) C:\users\miked>\users\miked\env\proj-x\Scripts\deactivate
C:\users\miked>

This should let you get into and out of the virtualenv quite easily.

Now comes the difficult bit for Windows - installing stuff in the new
Python's site-packages. First, though, discover what you already have
installed in your main site-packages:

pip freeze > requirements.txt  # lists existing site-packages

Here is mine, most of which I don't want in proj-x

Django==1.5.4
Jinja2==2.7.1
MarkupSafe==0.18
Pygments==1.6
South==0.7.6
Sphinx==1.1.3
coverage==3.7
django-discover-runner==1.0
docutils==0.9.1
filemov==1.1.1-2728-py2.7
pillow==2.3.0
pss==1.38
psycopg2==2.4.5
py2exe==0.6.9
pytz==2012h
pywin32==218
virtualenv==1.11.2

So I edit it down to the following, create a directory and save it as
C:\users\miked\env\proj-x\requirements\requirements.txt

Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0
pillow==2.3.0
psycopg2==2.4.5
pytz==2013.9

pip install -r C:\users\miked\env\proj-x\requirements\requirements.txt

And this where (my) problems start. First pip will download the packages
successfully but I don't have Visual Studio installed so those packages
requiring compilation don't get installed. Here is a snippet of pip output
after the downloads:

Installing collected packages: Django, South, coverage,
django-discover-runner, pillow, psycopg2, pytz
   Running setup.py install for Django

... and so on until errors start to appear. In my case the signal is:

error: Unable to find vcvarsall.bat

Afterwards, pip freeze shows:

(proj-x) C:\users\miked\env\proj-x>pip freeze
Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0

... which indicates pillow, psycopg2 and pytz did not install.

But how come they were installed in the main site-packages? That's because
they were originally downloaded from
http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed manually.

However, even after downloading from that site they cannot be installed
manually into a virtualenv! Only pip can do that. The only workaround I have
found is to manually copy them from the main site-packages to the new
virtualenv site-packages. Clumsy.

My proj-x requirements.txt file now looks like this ...

Django==1.5.4
South==0.7.6
coverage==3.7
django-discover-runner==1.0
# pillow==2.3.0 http://www.lfd.uci.edu/~gohlke/pythonlibs/
# psycopg2==2.4.5 http://www.lfd.uci.edu/~gohlke/pythonlibs/
# pytz==2013.9 http://www.lfd.uci.edu/~gohlke/pythonlibs/

After the above clumsy workaround everything works we

Problems with admin.autodiscover()

2014-01-28 Thread Mark Phillips
I have a site built using django 1.6. It runs as expected with runserver on
my Debian laptop in a virtual env based on Python 2.7 (development
machine). I copied the site to another Debian server (production), created
the same virtual environment, and am trying to use Apache and mod-wsgi to
serve the site. I have run into a wierd (for me, a django beginner) problem.

In my top level urls.py, I have

from django.contrib import admin
admin.autodiscover()

which works just as expected when I use runserver in my development
machine. I can access the admin pages as superuser and edit the data.

When I run the same site on the production machine using apache and wsgi I
either get a segmentation fault or, if I comment out the line
admin.autodiscover() I can run the site without errors. However, when I log
into the admin part of the site, my superuser account does not have
permission to change any of the tables, nor do any of the tables appear in
the admin site (although the login is correct and the page looks like an
admin page).

Any suggestions on the cause of the problem and a possible fix? I am not
sure what other information to provide.

Thanks,

Mark

-- 
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/CAEqej2MaQ9NGHBEp8EQ3_O8nPAJTD8EV5S_uwMT%2BGwAG60dKHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.