[ANNOUNCE] Django 1.7 alpha 1 released

2014-01-22 Thread James Bennett
Yup, we're on the way to 1.7!

Check out the blog post (which mentions a couple of important issues to be
aware of *before* trying out the alpha):

https://www.djangoproject.com/weblog/2014/jan/22/django-17-alpha-1-released/

And the in-progress 1.7 release notes for a full rundown of what's going to
be in the final release:

https://docs.djangoproject.com/en/dev/releases/1.7/

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


Re: ec2 using bitnami djangostack: application never loads; browser just hangs

2014-01-22 Thread Dylan Bumford
Thanks. I've checked apache's error_log, and it doesn't report anything 
unusual. The access_log reports about four hundred GET requests that look 
sort of like this:

10.73.205.233 - - [22/Jan/2014:18:07:34 -0500] "GET 
/img/ami-lower-container.png HTTP/1.1" 304 -
10.73.205.233 - - [22/Jan/2014:18:07:34 -0500] "GET /img/ami-list-item.png 
HTTP/1.1" 304 -


The last two lines are:

201.249.174.162 - - [22/Jan/2014:18:09:19 -0500] "HEAD / HTTP/1.0" 200 -
120.192.101.153 - - [22/Jan/2014:19:21:28 -0500] "GET /manager/html 
HTTP/1.1" 404 210


I don't know what other logs to check. When I run the app in DEBUG=True, I 
don't see any difference. If I introduce an artificial bug in 
*/mysite/mysite/urls.py*, it reports the bug through the Django debugging 
page (and also in error_log). But when I remove the bug, it's back to 
endless waiting. How can I tell if the request is making it to modwsgi or 
it's stuck in apache? 

Dylan

On Wednesday, January 22, 2014 12:26:13 PM UTC-5, Andréas Kühne wrote:
>
> 1. Have you checked all of the access logs and error logs when the app is 
> started? Is your request getting served by modwsgi, or is it stuck in 
> apache?
> 2. Start the application with DEBUG=True in settings, to see if you get 
> any information from the app.
>
> Thats where I'd start.
>
> Regards,
>
> Andréas Kühne
>
>
> 2014/1/22 Dylan Bumford 
>
>> I used the Bitnami Djangostack AMI to set up a Django environment with 
>> apache2 and mod_wsgi on a free instance provided by Amazon's EC2. The 
>> django app is installed at /opt/bitnami/apps/django/django_projects/mysite, 
>> alongside the default Project application that comes with the stack. The 
>> app runs on my local computer on the development server without issue. When 
>> I transferred the app to the server, I ran the collectstatic script to copy 
>> all of the static files to mysite/static, and configured the server to 
>> serve STATIC_ROOT at STATIC_URL (settings and configuration details are 
>> reported below). As best I can make out, I've configured everything in 
>> accordance with the Django 
>> documentationand
>>  
>> modwsgi 
>> documentation.
>>
>> When I point my browser to the server's public address, I see the bitnami 
>> startup page, but when I point to the subdirectory mapped to the 
>> application, the browser just hangs. It acts as if it's loading a website, 
>> spins the little wheel to tell you it's loading a website, and says 
>> 'Waiting for xx.xxx.xxx.xxx..." But nothing ever happens. There are no 
>> errors reported in */opt/bitnami/apache2/logs/error_log*. But If I point 
>> instead to a random subdirectory that doesn't exist, I get a 404 page. If I 
>> point to the static subdirectory, I get a 403 Forbidden page. If I 
>> purposefully add a bug to any of the python code (in e.g. 
>> *mysite/mysite/urls.py* or *mysite/myapp/views.py*), I get a 500 
>> Internal Server Error and a message in the error_log with the expected 
>> python stack trace.
>>
>> If anyone has any suggestions, I would obviously be very grateful. I'm 
>> pretty new to this.
>>
>> Here are the relevant parts of my configuration files.
>>
>>
>> */opt/bitnami/apache2/conf/httpd.conf*
>>
>> ServerRoot "/opt/bitnami/apache2"
>> Listen 80
>> 
>> User daemon
>> Group daemon
>> 
>> ServerName localhost:80
>> DocumentRoot "/opt/bitnami/apache2/htdocs"
>> 
>> Options Indexes FollowSymLinks
>> AllowOverride None
>> 
>> LoadModule wsgi_module modules/mod_wsgi.so
>> WSGIPythonHome /opt/bitnami/python
>> Include "/opt/bitnami/apps/django/conf/mysite.conf"
>>
>>
>>
>> */opt/bitnami/apps/django/conf/mysite.conf*
>>
>> Alias /static "opt/bitnami/apps/django/django_projects/mysite/static"
>>
>> 
>> Order deny,allow
>> Allow from all
>> 
>>
>> > 'opt/bitnami/apps/django/lib/python2.7/site-packages/django/contrib/'>
>> 
>> Order allow,deny
>> Allow from all
>> 
>> = 2.3>
>> Require all granted
>> 
>> 
>>
>> WSGIScriptAlias /mysite "opt/bitnami/apps/django/scripts/mysite.wsgi"
>> WSGIPythonPath 'opt/bitnami/apps/django/django_projects/mysite/'
>>
>> 
>> 
>> Order allow,deny
>> Allow from all
>> 
>> = 2.3>
>> Require all granted
>> 
>> 
>>
>>
>>
>> */opt/bitnami/apps/django/scripts/mysite.wsgi*
>>
>> import os, sys
>>
>> sys.path.append('/opt/bitnami/apps/django/lib/python2.7/site-packages/')
>> sys.path.append('/opt/bitnami/apps/django/django_projects')
>> sys.path.append('/opt/bitnami/apps/django/django_projects/mysite')
>> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>>
>> import django.core.handlers.wsgi
>>
>> application = django.core.handlers.wsgi.WSGIHandler()
>>
>>
>>
>> */opt/bitnami/apps/django/django_projects/mysite/mysite/settings.py*
>>
>> STATIC_ROOT = '/home/bitnami/apps/django/django_projects/mysite/static/'
>> STATIC_URL = 

Django Model Primary Key help please...

2014-01-22 Thread Amit Masaun
Hi,

I am trying to port over something to Django/Postgresql that I built on 
Asp.Net/MSSQL and I was hoping someone could give me some direction on 
manual creation of Primary Key key columns in Django models.  What I would 
like is to have a BIGINT Primary Key value that is unique across all my 
models (which is what I am currently doing in Microsoft stack).  I have 
been researching for the last day and I dont see obvious pattern anywhere. 
 The closest thing I have found to what I need is django-ticketing:

https://github.com/streeter/django-ticketing

Unfortuantely it is very MySql-centric.

Are there any "best practices" for generating bigint primary keys which are 
unique accross multiple models? 

Thank you very much in advance.

--Amit

-- 
You received this message because you are subscribed 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/00652711-4efa-4064-9423-086c32dab2f5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Presentation ideas?

2014-01-22 Thread Charly Román
Needs Silverlight :(

2014/1/22 Keith Edmiston :
> John/Russell,
>
> Here's a link to my presentation in case you're interested. Thanks again for
> the leg up.
>
>
> Keith
>
>
> On Fri, Jan 17, 2014 at 12:17 PM, John DeRosa  wrote:
>>
>> I’m glad Russ answered too. I was thinking only about tutorials, but
>> neglected to explain that. Not that it was hard to figure out, I supposed.
>>
>> On Jan 16, 2014, at 8:56 PM, Keith Edmiston  wrote:
>>
>> > John/Russ,
>> >
>> > Thanks a ton for these suggestions. Great thoughts!
>> >
>> > Keith
>> >
>>
>> --
>> You received this message because you are subscribed 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/E18E4296-C681-46F6-8B06-515D901A091F%40ipstreet.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Keith Edmiston
> (512)970-7222
>
> --
> You received this message because you are subscribed 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/CAP_gv7LQd0qzhf815L4%2BUH3b%3DXfnjZjFECc5pu9z4NbgEkUBdQ%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/CABeWMUb_8arQX_S_frGMdy4ZVuRA8-Jh7bVdgvHu_%3Dh%3DS6OJaA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cannot import name execute_manager

2014-01-22 Thread Mike Dewhirst

On 23/01/2014 5:36am, Maurice J Elagu wrote:

yes, its actually 1.6.1
How could i sort this problem out??


The link opens the release note for 1.4 which itself explains what to do.

Usually when Django deprecates a method, the replacement is 
simultaneously implemented so developers can adjust their code 
immediately without waiting for it to disappear and cause an error two 
versions later.






On Wed, Jan 22, 2014 at 10:44 AM, Mike Dewhirst > wrote:

On 22/01/2014 6:36pm, Mike Dewhirst wrote:

On 22/01/2014 6:16pm, MAurice wrote:

Hello django users,
I have a problem when i try to sync my db or runserver on my
ubuntu
13.10. of cant import name execute manger
Help me out thanks


You are probably running Django 1.6.x which doesn't have
execute_manager.Here is the


er ... link


which explains that it is a deprecated method ...


https://docs.djangoproject.__com/en/dev/releases/1.4/#__django-core-management-__execute-manager




Little bit of work to do.

Hth

Mike



File "manage.py", line 2, in 
  from django.core.management import execute_manager
ImportError: cannot import name execute_manager

--
You received this message because you are subscribed to the
Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails
from it, send
an email to django-users+unsubscribe@__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/3dad08cb-__842c-4f8b-bbf7-62d3ebcd3114%__40googlegroups.com

.

For more options, visit
https://groups.google.com/__groups/opt_out
.




--

Climate Pty Ltd
PO Box 308
Mount Eliza
Vic 3930
Australia +61

T: 03 9787 6598
M: 0411 704 143



--
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/Mh6Ic-78___uw/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
django-users+unsubscribe@__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/52DF76E2.__90108%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/CAJoucbXxajco73Xa-igFYe%2BTwQjb4iUVRYn9KaTNabGUf6pNkg%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/52E03A48.6000505%40dewhirst.com.au.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Save to User table first_name and last_name from a page with a different form

2014-01-22 Thread Brad Rice
I think I figured it out. The user is on the reuqest so it was pretty easy.

def form_valid(self, form):
obj = form.save(commit=False)
obj.created_by = self.request.user
obj.application_id = self.kwargs['app_id']
u = self.request.user
u.last_name = obj.last_name;
u.first_name = obj.first_name;
obj.save()
u.save()
#reverse_lazy = lambda name=answers, *args : lazy(reverse, 
str)(name, args=args)
return HttpResponseRedirect(reverse('requestform:answers', 
kwargs={'app_id': obj.application_id}))


On Wednesday, January 22, 2014 9:48:27 AM UTC-5, Brad Rice wrote:
>
> I have a registration and login page that only takes username and 
> password. After they register or login, they are taken to a profile form 
> where they can provide additional information such as address and phone 
> numbers. I'm using a Model Form CreateView there. On that page I want the 
> First Name and Last Name fields to  save to the auth_user table rather than 
> that Profile Form model. How do I have two fields submit data to the 
> auth_user table and the other fields submit to the Profile table?
>

-- 
You received this message because you are subscribed 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/dcf1ea7c-92fb-405b-885d-9656c91d782f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Presentation ideas?

2014-01-22 Thread Keith Edmiston
John/Russell,

Here's a 
linkto
my presentation in case you're interested. Thanks again for the leg
up.


Keith


On Fri, Jan 17, 2014 at 12:17 PM, John DeRosa  wrote:

> I'm glad Russ answered too. I was thinking only about tutorials, but
> neglected to explain that. Not that it was hard to figure out, I supposed.
>
> On Jan 16, 2014, at 8:56 PM, Keith Edmiston  wrote:
>
> > John/Russ,
> >
> > Thanks a ton for these suggestions. Great thoughts!
> >
> > Keith
> >
>
> --
> You received this message because you are subscribed 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/E18E4296-C681-46F6-8B06-515D901A091F%40ipstreet.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Keith Edmiston
(512)970-7222

-- 
You received this message because you are subscribed 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/CAP_gv7LQd0qzhf815L4%2BUH3b%3DXfnjZjFECc5pu9z4NbgEkUBdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Error in Django Admin When I try to add.

2014-01-22 Thread Jonathan Pentecost
Is your "API_dispatcher" url before or after the admin url?

On Wednesday, 22 January 2014 08:50:14 UTC+11, Dharwin Perez wrote:
>
> I was trying to make a API Dispatcher, but when i try to add anything in 
> Django Admin, run APIdispatcher and return Bad Request. I think that is 
> some in the URL because when i comment those line, Django Admin works 
> correctly.
>
> urls.py
>
> url(r'^(?P.*)/(?P.*)/(?P.*)/(?P.*)/$',
>  
> 'People.views.APIdispatcher', name='API_dispatcher')
>
> views.py
>
> @csrf_exempt
> def APIdispatcher(request,version,table,secret_key,mac_address):
> # Verificamos que sea una peticion POST
> if request.method == 'POST':
>
> if _version == 'V0.9' or _version == 'v0.9':
> apiV09()
> elif _version == 'V1.0' or _version == 'v1.0':
> apiV10( )
> return HttpResponse(status=200) 
>
> else:
> return HttpResponseBadRequest()
> else:
> return HttpResponseBadRequest()
>
> admin.py
>
> admin.site.register(Application)
>>
>
> models.py
>
> class Application(models.Model):
>
>
>> application_id = models.AutoField(
>
> primary_key = True )
>
>
>> name = models.CharField(
>
> max_length = 200,
>
> blank = False,
>
> null = False,
>
> unique  = True )
>
>
>> secret_key = models.CharField(
>
> max_length = 150,
>
> blank = True,
>
> null = True,
>
> unique  = True )
>
>
>>
>> creation_date = models.DateField( auto_now_add = True )
>
> creation_ts = models.DateTimeField( auto_now_add = True )
>
> modification_date = models.DateField( auto_now = True )
>
> modification_ts = models.DateTimeField( auto_now = True )
>
> status  = models.CharField(
>
> max_length  = 20,
>
> choices = (
>
> ('1','ACTIVA'),
>
> ('2','SUSPENDIDA'),
>
> ('3','MANTENIMIENTO'),
>
> ('4','ELIMINADA')
>
> ),
>
> default = '1'
>
> ) 
>
>  
>
> class Meta:
>
> db_table = 'Applications'
>
> verbose_name = 'Application'
>
> verbose_name_plural = 'Applications'
>
>
>> def __unicode__(self):
>
> return self.name
>
>  
>

-- 
You received this message because you are subscribed 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/7c4977b5-915b-4ea6-a972-f19aa44a76ae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cannot import name execute_manager

2014-01-22 Thread Maurice J Elagu
yes, its actually 1.6.1
How could i sort this problem out??


On Wed, Jan 22, 2014 at 10:44 AM, Mike Dewhirst wrote:

> On 22/01/2014 6:36pm, Mike Dewhirst wrote:
>
>> On 22/01/2014 6:16pm, MAurice wrote:
>>
>>> Hello django users,
>>> I have a problem when i try to sync my db or runserver on my ubuntu
>>> 13.10. of cant import name execute manger
>>> Help me out thanks
>>>
>>
>> You are probably running Django 1.6.x which doesn't have
>> execute_manager.Here is the
>>
>
> er ... link
>
>
>  which explains that it is a deprecated method ...
>>
>> https://docs.djangoproject.com/en/dev/releases/1.4/#
>> django-core-management-execute-manager
>>
>>
>> Little bit of work to do.
>>
>> Hth
>>
>> Mike
>>
>>
>>>
>>> File "manage.py", line 2, in 
>>>  from django.core.management import execute_manager
>>> ImportError: cannot import name execute_manager
>>>
>>> --
>>> You received this message because you are subscribed 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/3dad08cb-
>>> 842c-4f8b-bbf7-62d3ebcd3114%40googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>
> --
>
> Climate Pty Ltd
> PO Box 308
> Mount Eliza
> Vic 3930
> Australia +61
>
> T: 03 9787 6598
> M: 0411 704 143
>
>
>
> --
> 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/Mh6Ic-78_uw/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/52DF76E2.90108%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/CAJoucbXxajco73Xa-igFYe%2BTwQjb4iUVRYn9KaTNabGUf6pNkg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


debugging

2014-01-22 Thread Ankit Singh
i got this error when trying to use* pyhto**b**n manage.py syncdb* what 
does it mean?
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 399, in execute_from_command_line
utility.execute()
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 280, in execute
translation.activate('en-us')
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/translation/__init__.py",
 
line 130, in activate
return _trans.activate(language)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 188, in activate
_active.value = translation(language)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py",
 
line 159, in _fetch
app = import_module(appname)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py",
 
line 6, in 
from django.contrib.admin.sites import AdminSite, site
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/contrib/admin/sites.py",
 
line 4, in 
from django.contrib.admin.forms import AdminAuthenticationForm
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/contrib/admin/forms.py",
 
line 6, in 
from django.contrib.auth.forms import AuthenticationForm
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/contrib/auth/forms.py", 
line 17, in 
from django.contrib.auth.models import User
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/contrib/auth/models.py",
 
line 48, in 
class Permission(models.Model):
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/models/base.py", 
line 96, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/models/base.py", 
line 264, in add_to_class
value.contribute_to_class(cls, name)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/models/options.py", 
line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length())
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/__init__.py", 
line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File 
"/home/anky/it/local/lib/python2.7/site-packages/django/db/utils.py", line 
198, in __getitem__
backend = load_backend(db['ENGINE'])
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/utils.py", line 
113, in load_backend
return import_module('%s.base' % backend_name)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File 
"/home/user/it/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
 
line 17, in 
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: 
No module named MySQLdb

-- 
You received this message because you are subscribed 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/f7dfd7df-3d4c-4259-a8ef-233c695669fc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: debugging

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 10:18 AM, Ankit Singh  wrote:
> i got this error when trying to use pyhtobn manage.py syncdb what does it
> mean?
> File
> "/home/user/it/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
> line 17, in 
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> No module named MySQLdb

That you don't have MySQLdb installed. You need to install that:

https://pypi.python.org/pypi/MySQL-python/1.2.4

-- 
You received this message because you are subscribed 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/CACwCsY4GWNH43Pq%3DD0qPAgVmsps-TopfN4uQKg856BQBGYDGjw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ec2 using bitnami djangostack: application never loads; browser just hangs

2014-01-22 Thread Andreas Kuhne
1. Have you checked all of the access logs and error logs when the app is
started? Is your request getting served by modwsgi, or is it stuck in
apache?
2. Start the application with DEBUG=True in settings, to see if you get any
information from the app.

Thats where I'd start.

Regards,

Andréas Kühne


2014/1/22 Dylan Bumford 

> I used the Bitnami Djangostack AMI to set up a Django environment with
> apache2 and mod_wsgi on a free instance provided by Amazon's EC2. The
> django app is installed at /opt/bitnami/apps/django/django_projects/mysite,
> alongside the default Project application that comes with the stack. The
> app runs on my local computer on the development server without issue. When
> I transferred the app to the server, I ran the collectstatic script to copy
> all of the static files to mysite/static, and configured the server to
> serve STATIC_ROOT at STATIC_URL (settings and configuration details are
> reported below). As best I can make out, I've configured everything in
> accordance with the Django 
> documentationand
> modwsgi 
> documentation.
>
> When I point my browser to the server's public address, I see the bitnami
> startup page, but when I point to the subdirectory mapped to the
> application, the browser just hangs. It acts as if it's loading a website,
> spins the little wheel to tell you it's loading a website, and says
> 'Waiting for xx.xxx.xxx.xxx..." But nothing ever happens. There are no
> errors reported in */opt/bitnami/apache2/logs/error_log*. But If I point
> instead to a random subdirectory that doesn't exist, I get a 404 page. If I
> point to the static subdirectory, I get a 403 Forbidden page. If I
> purposefully add a bug to any of the python code (in e.g.
> *mysite/mysite/urls.py* or *mysite/myapp/views.py*), I get a 500 Internal
> Server Error and a message in the error_log with the expected python stack
> trace.
>
> If anyone has any suggestions, I would obviously be very grateful. I'm
> pretty new to this.
>
> Here are the relevant parts of my configuration files.
>
>
> */opt/bitnami/apache2/conf/httpd.conf*
>
> ServerRoot "/opt/bitnami/apache2"
> Listen 80
> 
> User daemon
> Group daemon
> 
> ServerName localhost:80
> DocumentRoot "/opt/bitnami/apache2/htdocs"
> 
> Options Indexes FollowSymLinks
> AllowOverride None
> 
> LoadModule wsgi_module modules/mod_wsgi.so
> WSGIPythonHome /opt/bitnami/python
> Include "/opt/bitnami/apps/django/conf/mysite.conf"
>
>
>
> */opt/bitnami/apps/django/conf/mysite.conf*
>
> Alias /static "opt/bitnami/apps/django/django_projects/mysite/static"
>
> 
> Order deny,allow
> Allow from all
> 
>
>  'opt/bitnami/apps/django/lib/python2.7/site-packages/django/contrib/'>
> 
> Order allow,deny
> Allow from all
> 
> = 2.3>
> Require all granted
> 
> 
>
> WSGIScriptAlias /mysite "opt/bitnami/apps/django/scripts/mysite.wsgi"
> WSGIPythonPath 'opt/bitnami/apps/django/django_projects/mysite/'
>
> 
> 
> Order allow,deny
> Allow from all
> 
> = 2.3>
> Require all granted
> 
> 
>
>
>
> */opt/bitnami/apps/django/scripts/mysite.wsgi*
>
> import os, sys
>
> sys.path.append('/opt/bitnami/apps/django/lib/python2.7/site-packages/')
> sys.path.append('/opt/bitnami/apps/django/django_projects')
> sys.path.append('/opt/bitnami/apps/django/django_projects/mysite')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
>
> */opt/bitnami/apps/django/django_projects/mysite/mysite/settings.py*
>
> STATIC_ROOT = '/home/bitnami/apps/django/django_projects/mysite/static/'
> STATIC_URL = '/static/'
>
>  --
> You received this message because you are subscribed 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/30d5dba3-a001-4dae-b8be-6ea7a575037e%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/CALXYUb%3DzK6zfRk95yHcUCuFfg7KpOawMAL6TC0G3Srifxdw8TQ%40mail.gmail.com.
For more options, visit 

ec2 using bitnami djangostack: application never loads; browser just hangs

2014-01-22 Thread Dylan Bumford
I used the Bitnami Djangostack AMI to set up a Django environment with 
apache2 and mod_wsgi on a free instance provided by Amazon's EC2. The 
django app is installed at /opt/bitnami/apps/django/django_projects/mysite, 
alongside the default Project application that comes with the stack. The 
app runs on my local computer on the development server without issue. When 
I transferred the app to the server, I ran the collectstatic script to copy 
all of the static files to mysite/static, and configured the server to 
serve STATIC_ROOT at STATIC_URL (settings and configuration details are 
reported below). As best I can make out, I've configured everything in 
accordance with the Django 
documentationand
 
modwsgi 
documentation.

When I point my browser to the server's public address, I see the bitnami 
startup page, but when I point to the subdirectory mapped to the 
application, the browser just hangs. It acts as if it's loading a website, 
spins the little wheel to tell you it's loading a website, and says 
'Waiting for xx.xxx.xxx.xxx..." But nothing ever happens. There are no 
errors reported in */opt/bitnami/apache2/logs/error_log*. But If I point 
instead to a random subdirectory that doesn't exist, I get a 404 page. If I 
point to the static subdirectory, I get a 403 Forbidden page. If I 
purposefully add a bug to any of the python code (in e.g. 
*mysite/mysite/urls.py* or *mysite/myapp/views.py*), I get a 500 Internal 
Server Error and a message in the error_log with the expected python stack 
trace.

If anyone has any suggestions, I would obviously be very grateful. I'm 
pretty new to this.

Here are the relevant parts of my configuration files.


*/opt/bitnami/apache2/conf/httpd.conf*

ServerRoot "/opt/bitnami/apache2"
Listen 80

User daemon
Group daemon

ServerName localhost:80
DocumentRoot "/opt/bitnami/apache2/htdocs"

Options Indexes FollowSymLinks
AllowOverride None

LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/bitnami/python
Include "/opt/bitnami/apps/django/conf/mysite.conf"



*/opt/bitnami/apps/django/conf/mysite.conf*

Alias /static "opt/bitnami/apps/django/django_projects/mysite/static"


Order deny,allow
Allow from all




Order allow,deny
Allow from all

= 2.3>
Require all granted



WSGIScriptAlias /mysite "opt/bitnami/apps/django/scripts/mysite.wsgi"
WSGIPythonPath 'opt/bitnami/apps/django/django_projects/mysite/'



Order allow,deny
Allow from all

= 2.3>
Require all granted





*/opt/bitnami/apps/django/scripts/mysite.wsgi*

import os, sys

sys.path.append('/opt/bitnami/apps/django/lib/python2.7/site-packages/')
sys.path.append('/opt/bitnami/apps/django/django_projects')
sys.path.append('/opt/bitnami/apps/django/django_projects/mysite')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()



*/opt/bitnami/apps/django/django_projects/mysite/mysite/settings.py*

STATIC_ROOT = '/home/bitnami/apps/django/django_projects/mysite/static/'
STATIC_URL = '/static/'

-- 
You received this message because you are subscribed 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/30d5dba3-a001-4dae-b8be-6ea7a575037e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Save to User table first_name and last_name from a page with a different form

2014-01-22 Thread Brad Rice
I have a registration and login page that only takes username and password. 
After they register or login, they are taken to a profile form where they 
can provide additional information such as address and phone numbers. I'm 
using a Model Form CreateView there. On that page I want the First Name and 
Last Name fields to  save to the auth_user table rather than that Profile 
Form model. How do I have two fields submit data to the auth_user table and 
the other fields submit to the Profile table?

-- 
You received this message because you are subscribed 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/9ee380ec-3f2d-465c-a784-5b44518cc655%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Read geometry column in geography field

2014-01-22 Thread jorgearevalo
Hello,

I want to read a PostGIS geometry column using a model that contains a
geography field. Is it possible?

The reason why I need to do it that way is because I just have read
access to that table, and I need to run distance queries using it. I'd
prefer to avoid writing raw queries, and use GeoDjango (more info at
http://gis.stackexchange.com/questions/83783/geodjango-read-geometry-column-in-geography-field
)

Anyway, many thanks in advance

-- 
You received this message because you are subscribed 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/7c4c0e6c-e8c1-4c8f-af2a-204ce00097b7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django with no relational db?

2014-01-22 Thread Tim Chase
On 2014-01-22 09:07, Rafael E. Ferrero wrote:
>>  I will have web pages, d3.js, authenticated users and sessions.
>
> Are you tried nikola ? maybe works for
> you... its for flatpages.

While I will say that I love a lot of things about Nikola, it doesn't
meet the OP's requirement for authenticated users and sessions.

However, if the OP only needs those for commenting purposes, Nikola
does allow you to outsource those to an external service like Disqus
(several are supported).  But if the auth/sessions run more deeply in
the requirements, Nikola won't likely do.

-tkc



-- 
You received this message because you are subscribed 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/20140122052055.0c3bfaaa%40bigbox.christie.dr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Saving models with NOT NULL ForeignKeys referencing each other

2014-01-22 Thread antialiasis
It didn't occur to me that this could be done with transactions, but in 
retrospect it seems obvious. Thanks for the quick response.

On Tuesday, January 21, 2014 12:43:28 PM UTC, Russell Keith-Magee wrote:
>
>
> On Tue, Jan 21, 2014 at 6:54 PM, antialiasis  > wrote:
>
>> Hi,
>>
>> I just bumped into this issue. Say I have the following models:
>>
>>
>> class Foo(models.Model):
>> bar = models.ForeignKey('Bar', related_name='foos')
>>
>> class Bar(models.Model):
>> default_foo = models.ForeignKey(Foo, related_name='+')
>>
>>
>> Basically, the idea is that each bar has many foos, but one of them is 
>> the bar's default foo. Every foo must have an associated bar, and each bar 
>> must have a default foo, so both of the ForeignKey fields are NOT NULL.
>>
>> This was working great until I realized that now I can't actually create 
>> any Foo or Bar objects, because I can't save a Foo object without setting 
>> its bar_id, and I can't save a Bar object without setting its foo_id.
>>
>> Does Django have any kind of way around this, or is the solution just to 
>> allow null for one of them (dangerous for data integrity)? Or should I 
>> perhaps just not use this kind of circular reference altogether and instead 
>> go with something like an is_default field on the Foo model?
>>
>
> This is what database transactions are for. A transaction is a way to make 
> a series of individual changes as a single atomic change in the database. 
>
> In Django 1.6, the main way to implement transactional behaviour is to use 
> the atomic decorator:
>
>
> https://docs.djangoproject.com/en/1.6/topics/db/transactions/#django.db.transaction.atomic
>
> The only place this doesn't work is with MySQL, because it has a broken 
> implementation of referential integrity. If you're using PostgreSQL (which 
> implements referential integrity at the transaction boundary) or SQLite 
> (which doesn't have referential integrity), a transaction will do the job.
>
> If you have to use MySQL (and personally, I'd really recommend you don't), 
> the approach you've described of making one of the fields nullable is what 
> you have to do.
>
> Yours,
> Russ Magee %-)
>
>
>

-- 
You received this message because you are subscribed 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/79b485d9-ceb8-45b0-8d99-67797559a0e0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django with no relational db?

2014-01-22 Thread Rafael E. Ferrero
Are you tried nikola ? maybe works for you... its
for flatpages. Also you can find his author on pyar google
groups

See you

Saludos Cordiales,
--
Rafael E. Ferrero


2014/1/22 graeme 

> You do lose a lot without a relational DB: model forms, auth, admin. I
> think sessions should work as long as you do not use the DB backend.
>
> You could try django-nonrel: http://django-nonrel.org/ I have never tried
> it myself but from the documentation it seems to keep a lot more of the
> functionality of Django than just using Django without a relational DB.
>
> There are plenty of other Python frameworks. Flask is worth a look.
>
> You may get a better answer if we knew why you are using the file system
> and nosql.
>
>
> On Wednesday, January 22, 2014 8:26:49 AM UTC+5:30, devash wrote:
>>
>>
>>  I am building an app with no relational DB. All data will be in flat
>> files now and nosql dbs in future.
>>
>>  I plan to use django-tastypie for rest api and mostly pure python from
>> rest api code to connect to file system and non relational backend python
>> api. I do not plan to use Django ORM.
>>
>>  I will have web pages, d3.js, authenticated users and sessions.
>>
>>  1) Is it even possible to use Django without relational DB?
>>
>>  I noticed many of Django's core app like auth and session depend on
>> having relational DB. Am i correct?
>>
>>  2) Does it even make sense to use Django here? Is Django appropriate
>> technology/framework to use here? or any other python alternatives I should
>> look at?
>>
>  --
> You received this message because you are subscribed 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/85bd3a1b-41bc-40ce-954d-cb33060de572%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/CAJJc_8V3Hm1P%2BXYcmCRcY0pmOomJpC7owByx7hbAmH%3DyXJ_XHA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django with no relational db?

2014-01-22 Thread graeme
You do lose a lot without a relational DB: model forms, auth, admin. I 
think sessions should work as long as you do not use the DB backend.

You could try django-nonrel: http://django-nonrel.org/ I have never tried 
it myself but from the documentation it seems to keep a lot more of the 
functionality of Django than just using Django without a relational DB.

There are plenty of other Python frameworks. Flask is worth a look.

You may get a better answer if we knew why you are using the file system 
and nosql. 

On Wednesday, January 22, 2014 8:26:49 AM UTC+5:30, devash wrote:
>
>
>  I am building an app with no relational DB. All data will be in flat 
> files now and nosql dbs in future. 
>
>  I plan to use django-tastypie for rest api and mostly pure python from 
> rest api code to connect to file system and non relational backend python 
> api. I do not plan to use Django ORM. 
>
>  I will have web pages, d3.js, authenticated users and sessions. 
>
>  1) Is it even possible to use Django without relational DB? 
>
>  I noticed many of Django's core app like auth and session depend on 
> having relational DB. Am i correct?
>
>  2) Does it even make sense to use Django here? Is Django appropriate 
> technology/framework to use here? or any other python alternatives I should 
> look at?
>

-- 
You received this message because you are subscribed 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/85bd3a1b-41bc-40ce-954d-cb33060de572%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.