Re: getting 500 131 error on page not found

2014-10-22 Thread Sabine Maennel
Dear Tom,  Thanks for your reply, but I did not have DEBUG=True on. With 
DEBUG=True the program behaves as expected. Things go wrong just when I set 
DEBUG=False. But thanks anyway for your reply.

Am Dienstag, 21. Oktober 2014 21:02:48 UTC+2 schrieb Tom Evans:
>
> On Tue, Oct 21, 2014 at 4:19 PM, Sabine Maennel 
> > wrote: 
> > I really do not understand what is happening. I have a 404.html along 
> with a 
> > 500.html in my template directory. They are both simple and look like 
> this: 
> > 
> > 404.html: 
> > 
> > Server Error 404! 
> > Das netTeachers-Team ist informiert und kümmert sich darum. 
> > Wir hoffen auf Ihr Verständnis. 
> > 
> > 500.html: 
> > 
> > Server Error 500! 
> > Das netTeachers-Team ist informiert und kümmert sich darum. 
> > Wir hoffen auf Ihr Verständnis. 
> > 
> > When I put in a non existent url on runserver and DEBUG=False, I get 
> this 
> > error in my log: [21/Oct/2014 16:08:56] "GET /x HTTP/1.1" 500 131 
> > 
> > It seems like he does not find my 404.html Template but why??? 
> > 
> > My settings.py looks like this in the part of template directories: 
> > 
> > import os 
> > BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 
> > 
> > ROOT_URLCONF = 'netteachers.urls' 
> > 
> > TEMPLATE_DIRS = ( 
> > os.path.join(BASE_DIR, 'templates'), 
> > ) 
> > 
> > CRISPY_TEMPLATE_PACK = 'bootstrap3' 
> > 
> > TEMPLATE_CONTEXT_PROCESSORS = ( 
> > "django.contrib.auth.context_processors.auth", 
> > "django.core.context_processors.debug", 
> > "django.core.context_processors.i18n", 
> > "django.core.context_processors.media", 
> > 'django.core.context_processors.request', 
> > "django.contrib.messages.context_processors.messages", 
> > "core.context_processors.resolvermatch", 
> > ) 
> > 
> > Please can anybody tell me what I am doing wrong! Thanks in advance! 
> > 
>
> You have DEBUG=True on, so you will never see your custom 404 page: 
>
> https://docs.djangoproject.com/en/1.7/ref/views/#http-not-found-view 
>
> Cheers 
>
> Tom 
>

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


Re: getting 500 131 error on page not found

2014-10-22 Thread Sabine Maennel
Dear Collin,

you hit the nail right right on top. That was it! I feel so thankful 
towards you! I would never have thought about the context processors. 

I am so thankful to everybody here in the Django User group to always 
taking the time and helping me out. I will try to give back, as soon as I 
get to be more experienced! 

I have the ADMINS setting in place in my production settings file, Collin. 
I was just trying to understand the error in my local environment first, 
since it occurred even there.

You have been helping me out quite a lot lately. Where are you located? How 
long have you been doing Django?
   Thanks again and with kind regards
 Sabine Maennel 
  

Am Dienstag, 21. Oktober 2014 19:22:56 UTC+2 schrieb Collin Anderson:
>
> Hi Sabine,
>
> It may be an issue with your core.context_processors.resolvermatch.
>
> I recommend setting ADMINS so you get the error emailed to you.
>
> https://docs.djangoproject.com/en/dev/howto/deployment/checklist/#admins-and-managers
> https://docs.djangoproject.com/en/dev/ref/settings/#admins
>
> Collin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14eadcc7-8f85-46de-9e7c-7068db818683%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ImportError cannot import name

2014-10-22 Thread Juan Carlos
Hi everyone,

When I execute the command:

python manage.py runserver &

The response is:

Traceback (most recent call last):
  File "../manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
385, in execute_from_command_line
utility.execute()
  File 
"/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
354, in execute
django.setup()
  File "/usr/lib/python2.7/site-packages/django/__init__.py", line 21, in 
setup
apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 85, 
in populate
app_config = AppConfig.create(entry)
  File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 120, 
in create
"cannot import name '%s' from '%s'" % (cls_name, mod_path))
ImportError: cannot import name 'example' from 'exsite'

In *settings.py* I have:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'exsite.example',
)

If I comment (#) the last line, the bug dissapears.  ¿What can I do?  I 
have Django 1.7 with Python 2.7.  Thanks for your attention.

Regards,
Juan

-- 
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/63cd3a9b-d677-4e32-baec-7751320bdf40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ImportError failure

2014-10-22 Thread Juan Carlos
Hi everyone,

When I execute
python manage.py runserver

it appers:
ImportError: cannot import name 'example' from 'exsite'

The relative code in the settings.py file is:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'exsite.example',
)

What can I do?

My django version is 1.7, with Python 2.7.  I'm new in this interesting 
world of Django.  Thanks for your help, and time.

Regards,
Juan

-- 
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/13bae8aa-77d9-4ba6-b038-d9ce37a37c9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Working with Google Analytics API

2014-10-22 Thread Muhammed Tüfekyapan
Hi Everyone,



I want to make an app. User come on site, they signed in and give access to 
their google analytics account.

And I generate some reports for them.

I try to use Google Analytics API but I think I use the wrong one. 
https://developers.google.com/analytics/


Which one I should use? Is there any library for that?

-- 
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/f2ad4ecb-7f90-4898-9cd2-b91ea9adef51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError cannot import name

2014-10-22 Thread Sabine Maennel
Hello Juan, if your project is "exsite" and your app is "example" then you 
should probably just add "example" to the list of installed apps. Try it, 
hope it works.
with kind regards
Sabine

Am Mittwoch, 22. Oktober 2014 06:16:25 UTC+2 schrieb Juan Carlos:
>
> Hi everyone,
>
> When I execute the command:
>
> python manage.py runserver &
>
> The response is:
>
> Traceback (most recent call last):
>   File "../manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 385, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
> 354, in execute
> django.setup()
>   File "/usr/lib/python2.7/site-packages/django/__init__.py", line 21, in 
> setup
> apps.populate(settings.INSTALLED_APPS)
>   File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 
> 85, in populate
> app_config = AppConfig.create(entry)
>   File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 120, 
> in create
> "cannot import name '%s' from '%s'" % (cls_name, mod_path))
> ImportError: cannot import name 'example' from 'exsite'
>
> In *settings.py* I have:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'exsite.example',
> )
>
> If I comment (#) the last line, the bug dissapears.  ¿What can I do?  I 
> have Django 1.7 with Python 2.7.  Thanks for your attention.
>
> Regards,
> Juan
>

-- 
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/df1d736d-8af4-42bd-b52a-4b489f867c05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I make the field layout of a model form dynamic?

2014-10-22 Thread DJ-Tom
Hi,

I have a model that contains either a text or a numerical information, 
based on the type of the entry:

equipment = models.ForeignKey(equipment)
number = models.DecimalField('Amount/number', max_digits=6, 
decimal_places=2, blank=True, null=False, default=0)
text = models.TextField("Text", blank=True, null=True, default='')

Based on that model I created a model form:

class RoomsetupEquipmentForm(ModelForm):
equipment = 
forms.ModelChoiceField(queryset=equipment.activeobjects.order_by('category__name',
 
'name'))

def __init__(self, *args, **kwargs):
super(RoomsetupEquipmentForm, self).__init__(*args, **kwargs)
self.fields['equipment'].choices = equipment_as_choices()

class Meta:
model = roomsetup_equipments
fields = ('equipment', 'number', 'text')

I'm looking for a way to selectively show either the number or the text 
field when the form is created.

Thomas


-- 
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/138b45bd-ad73-4d5b-ac7f-27530b8e4e0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError failure

2014-10-22 Thread Serdar Dalgic
Hi Juan,

I believe you might have a problem while importing "example". Can you
check the line you're importing example and where did you put this
"exsite.example" module?

Your directory structure should be like this:

mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
wsgi.py
exsite/
__init__.py
example.py
another_app/
__init__.py
   another_module.py

So that you can import exsite.example in your another_module.py like:

from exsite.example import AnyClassYouWantToImport

I hope this helps.

p.s. mind the "__init__.py"s on the modules you want to import. There
must be one in your "exsite" dir.
p.s.2. Instead of an example.py file under exsite dir, you may have
written it under __init__.py file as

mysite/
...
mysite/
__init__.py
...

in this __init__.py, you may have
class Example(object):
...
...

this is OK either ;)


- Serdar Dalgıç 
FLOSS Developer, Life & Nature Hacker
twitter:
https://twitter.com/serdaroncode
https://twitter.com/serdarintowild


On Wed, Oct 22, 2014 at 5:35 AM, Juan Carlos  wrote:
> Hi everyone,
>
> When I execute
> python manage.py runserver
>
> it appers:
> ImportError: cannot import name 'example' from 'exsite'
>
> The relative code in the settings.py file is:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'exsite.example',
> )
>
> What can I do?
>
> My django version is 1.7, with Python 2.7.  I'm new in this interesting
> world of Django.  Thanks for your help, and time.
>
> Regards,
> Juan
>
> --
> 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/13bae8aa-77d9-4ba6-b038-d9ce37a37c9c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


no module in error log django-1.3.7

2014-10-22 Thread Kakar Nyori
Hello,
I am trying to run a python app in pythonanywhere.com. If I run the project
through the bash it runs without any error. But when I see it in the
browser with the name like myproject.pythonanywhere.com, it display
"something went wrong".
And when I check in the error log, it show me this:

no module named appname.

What went wrong?

This is the path structure of the project:

projectname
--__init__.py
--manage.py
--settings.py
--urls.py
--appname
--__init__.py
--admin.py
--forms.py
--models.py
--views.py
--tests.py
--static
--css
--style.css
--js
--ui.js
--templates
--index.html

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


Re: Django tutorial with eCommerce solution

2014-10-22 Thread willyhakim
Hi Mudassar,

How are you doing?
Have you looked into django oscar? Google it and take it from there. It is 
the best django ecommerce package.

On Tuesday, October 21, 2014 9:11:15 PM UTC-5, Ezequiel Bertti wrote:
>
> Try this:
>
> http://www.getlfs.com/
>
> On Tue, Oct 21, 2014 at 11:28 PM, Mudassar Hashmi  > wrote:
>
>> I am looking for a django project based tutorial with fully developed 
>> eStore or a commerce solution.
>>
>> Please advise. 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3df5aebe-22c0-4d2e-ab6a-245e71062b16%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Ezequiel Bertti
> E-Mail: ebe...@gmail.com 
> Cel: (21) 99188-4860
>  

-- 
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/89c71450-05b6-4ac2-8f31-05e82ff8528f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django tutorial with eCommerce solution

2014-10-22 Thread Gladson Simplício Brito
http://tangentlabs.github.io/django-oscar/

http://www.satchmoproject.com/

http://satchless.com/

https://www.django-cms.org/en/e-commerce/

http://cartridge.jupo.org/

2014-10-21 22:10 GMT-04:00 Ezequiel Bertti :

> Try this:
>
> http://www.getlfs.com/
>
> On Tue, Oct 21, 2014 at 11:28 PM, Mudassar Hashmi <
> mudassarhashm...@gmail.com> wrote:
>
>> I am looking for a django project based tutorial with fully developed
>> eStore or a commerce solution.
>>
>> Please advise.
>>
>> --
>> 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/3df5aebe-22c0-4d2e-ab6a-245e71062b16%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Ezequiel Bertti
> E-Mail: eber...@gmail.com
> Cel: (21) 99188-4860
>
> --
> 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/CACrQMYqT%3Dn_QsBgaMVT9Ct2hcDs-buOX2yTUWuL7n%2Br1BQWQkw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


django 1.7 migrations: changes detected while nothing has changed ?

2014-10-22 Thread Michael
Hi,

Does anybody know how are changes detected by the ```makemigrations``` 
command in django 1.7?
It seems that I have a bug. The original post is on stackoverflow 

 
but no one has replied so I am trying here.


I have the issue that it always tells me there are changes for one of my 
field whereas there are not. When I run the command, it just writes the 
same migration file over and over with no changes.

The field is a custom field on which I implemented the deconstruct method 
and have some parameters that are objects so I used the deconstructible 
decorator.

I created a project on github that replicates the issue: 
https://github.com/YAmikep/django-testmigrations

What did I do wrong? Is this a bug?


Here is what I ran:

/projects/testmigrations$ python manage.py makemigrations app1
Migrations for 'app1':
  0001_initial.py:
- Create model ModelA
/projects/testmigrations$ python manage.py migrate
Operations to perform:
  Apply all migrations: admin, contenttypes, auth, app1, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying app1.0001_initial... OK
  Applying sessions.0001_initial... OK
/projects/testmigrations$ python manage.py makemigrations
Migrations for 'app1':
  0002_auto_20141014_2123.py:
- Alter field field1 on modela
/projects/testmigrations$ python manage.py makemigrations
Migrations for 'app1':
  0003_auto_20141014_2123.py:
- Alter field field1 on modela


The migration files 0002_auto_20141014_2123.py and 
0003_auto_20141014_2123.py contain the exact same operations:

operations = [
migrations.AlterField(
model_name='modela',
name='field1',
field=app1.models.CustomField(max_length=50, 
value_manager=app1.models.ValueManager(values=[app1.models.Value(val=1), 
app1.models.Value(val=2)])),
),
]


Thanks
Mike

-- 
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/bd651fde-425d-4493-85bf-2a1e17ad5765%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Installing django on red hat linux box

2014-10-22 Thread robert brook

I have alot of experience installing packages on windows and mac and it 
goes very smoothly.
I do not have alot of experience doing the installs on a Linux box.

I am running into problems installing 4 packages.

The Lan team tried yum, but the basic django packages were not available.

Then I tried installing pip and I got proxy errors using the get-pip.py 
script

So I fell back to installing the dowloaded packages with the old standy 
 setup.py install which fails.

I am attaching the top of the log

Anyone have any suggestions how to proceed?

**

running install

running bdist_egg

running egg_info

writing pyodbc.egg-info/PKG-INFO

writing top-level names to pyodbc.egg-info/top_level.txt

writing dependency_links to pyodbc.egg-info/dependency_links.txt

reading manifest file 'pyodbc.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching 'tests/*'

writing manifest file 'pyodbc.egg-info/SOURCES.txt'

installing library code to build/bdist.linux-x86_64/egg

running install_lib

running build_ext

building 'pyodbc' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
-DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
-D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
-I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
-o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
-Wno-write-strings

In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:

/home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such file 
or directory

/home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No such 
file or directory

/home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
file or directory

*


-- 
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/83a1d410-9cc1-4841-a517-1895ba220179%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 migrations: changes detected while nothing has changed ?

2014-10-22 Thread Markus Holtermann
Hey Michael,

The problem seems to be the same as in #23473 
https://code.djangoproject.com/ticket/23473 . Try adding a __eq__ method on the 
classes marked as deconstructible.

/Markus

On October 22, 2014 6:11:39 PM CEST, Michael  
wrote:
>Hi,
>
>Does anybody know how are changes detected by the ```makemigrations``` 
>command in django 1.7?
>It seems that I have a bug. The original post is on stackoverflow 
>
>
>but no one has replied so I am trying here.
>
>
>I have the issue that it always tells me there are changes for one of
>my 
>field whereas there are not. When I run the command, it just writes the
>
>same migration file over and over with no changes.
>
>The field is a custom field on which I implemented the deconstruct
>method 
>and have some parameters that are objects so I used the deconstructible
>
>decorator.
>
>I created a project on github that replicates the issue: 
>https://github.com/YAmikep/django-testmigrations
>
>What did I do wrong? Is this a bug?
>
>
>Here is what I ran:
>
>/projects/testmigrations$ python manage.py makemigrations app1
>Migrations for 'app1':
>  0001_initial.py:
>- Create model ModelA
>/projects/testmigrations$ python manage.py migrate
>Operations to perform:
>  Apply all migrations: admin, contenttypes, auth, app1, sessions
>Running migrations:
>  Applying contenttypes.0001_initial... OK
>  Applying auth.0001_initial... OK
>  Applying admin.0001_initial... OK
>  Applying app1.0001_initial... OK
>  Applying sessions.0001_initial... OK
>/projects/testmigrations$ python manage.py makemigrations
>Migrations for 'app1':
>  0002_auto_20141014_2123.py:
>- Alter field field1 on modela
>/projects/testmigrations$ python manage.py makemigrations
>Migrations for 'app1':
>  0003_auto_20141014_2123.py:
>- Alter field field1 on modela
>
>
>The migration files 0002_auto_20141014_2123.py and 
>0003_auto_20141014_2123.py contain the exact same operations:
>
>operations = [
>migrations.AlterField(
>model_name='modela',
>name='field1',
>field=app1.models.CustomField(max_length=50, 
>value_manager=app1.models.ValueManager(values=[app1.models.Value(val=1),
>
>app1.models.Value(val=2)])),
>),
>]
>
>
>Thanks
>Mike
>
>-- 
>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/bd651fde-425d-4493-85bf-2a1e17ad5765%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
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/3B0E03C9-C486-40A0-83DC-FE48FBB5262D%40markusholtermann.eu.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread Tom Lockhart
On Oct 22, 2014, at 9:12 AM, robert brook  wrote:

> 
> I have alot of experience installing packages on windows and mac and it goes 
> very smoothly.
> I do not have alot of experience doing the installs on a Linux box.
> 
> I am running into problems installing 4 packages.
> 
> The Lan team tried yum, but the basic django packages were not available.

Use yum to install python and virtualenv and the rest should go easily using a 
virtualenv setup.

This is commonly recommended for the other platforms also.

hth

- Tom

> 
> Then I tried installing pip and I got proxy errors using the get-pip.py script
> 
> So I fell back to installing the dowloaded packages with the old standy  
> setup.py install which fails.
> 
> I am attaching the top of the log
> 
> Anyone have any suggestions how to proceed?
> 
> **
> running install
> 
> running bdist_egg
> 
> running egg_info
> 
> writing pyodbc.egg-info/PKG-INFO
> 
> writing top-level names to pyodbc.egg-info/top_level.txt
> 
> writing dependency_links to pyodbc.egg-info/dependency_links.txt
> 
> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
> 
> reading manifest template 'MANIFEST.in'
> 
> warning: no files found matching 'tests/*'
> 
> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
> 
> installing library code to build/bdist.linux-x86_64/egg
> 
> running install_lib
> 
> running build_ext
> 
> building 'pyodbc' extension
> 
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 
> -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
> -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
> -fPIC -DPYODBC_VERSION=3.0.7 -I/usr/include/python2.6 -c 
> /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp -o 
> build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
> -Wno-write-strings
> 
> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
> 
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such file 
> or directory
> 
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No such 
> file or directory
> 
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
> file or directory
> 
> *
> 
> 
> 
> 
> -- 
> 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/83a1d410-9cc1-4841-a517-1895ba220179%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Please consider the environment before printing this message.
This message may be privileged and/or confidential, and the sender does not 
waive any related rights and obligations.  Any distribution, use or copying of 
this message or the information it contains by other than an intended recipient 
is unauthorized.  If you received this message in error, please immediately 
advise me by return e-mail or phone.  All information, references, images, 
programs, source code, or other materials whatsoever contained in, or supplied 
with, this document are TRADE SECRETS and governed by the Uniform Trade Secrets 
Act.  User assumes all direct and consequential liabilities and costs that 
result from any unauthorized disclosure or use of this information.

-- 
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/9024F5F1-3977-4494-ABE4-041A5DE24B14%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread Pat Claffey
Hi,
I assume you have python installed successfully.  What version?  If you 
install python 3.4 then pip should install automatically (unless  3.4. is a 
second python install in which case pip does not install)

You should be able to see the python (and pip) executables in /usr/bin or 
/usr/local/bin.  For example on my system I see python2.6 and pip installed 
on /usr/bin (python is just a link to python2.6).  I manually installed 
python3.4 and pip3.4.  I see these executables in /usr/local/bin.

python2.6 was pre-installed on my linux box (red hat).  I installed 
python3.4 and pip3.4 manually.



On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>
>
> I have alot of experience installing packages on windows and mac and it 
> goes very smoothly.
> I do not have alot of experience doing the installs on a Linux box.
>
> I am running into problems installing 4 packages.
>
> The Lan team tried yum, but the basic django packages were not available.
>
> Then I tried installing pip and I got proxy errors using the get-pip.py 
> script
>
> So I fell back to installing the dowloaded packages with the old standy 
>  setup.py install which fails.
>
> I am attaching the top of the log
>
> Anyone have any suggestions how to proceed?
>
> **
>
> running install
>
> running bdist_egg
>
> running egg_info
>
> writing pyodbc.egg-info/PKG-INFO
>
> writing top-level names to pyodbc.egg-info/top_level.txt
>
> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>
> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> reading manifest template 'MANIFEST.in'
>
> warning: no files found matching 'tests/*'
>
> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> installing library code to build/bdist.linux-x86_64/egg
>
> running install_lib
>
> running build_ext
>
> building 'pyodbc' extension
>
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
> -Wno-write-strings
>
> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
> file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
> such file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
> file or directory
>
> *
>
>
>

-- 
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/a7e2f47b-5c89-4ee0-b97d-639be2d04f6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread robert brook
I have installed a virtualenv on my local machine to do the development.

On the development web server using a virutal environment is not really 
important.

The packages that I am interested in are not available through yum.

Trying to install the packages locally displays header errors.

Any suggestions around this?




On Wednesday, October 22, 2014 12:12:10 PM UTC-4, robert brook wrote:
>
>
> I have alot of experience installing packages on windows and mac and it 
> goes very smoothly.
> I do not have alot of experience doing the installs on a Linux box.
>
> I am running into problems installing 4 packages.
>
> The Lan team tried yum, but the basic django packages were not available.
>
> Then I tried installing pip and I got proxy errors using the get-pip.py 
> script
>
> So I fell back to installing the dowloaded packages with the old standy 
>  setup.py install which fails.
>
> I am attaching the top of the log
>
> Anyone have any suggestions how to proceed?
>
> **
>
> running install
>
> running bdist_egg
>
> running egg_info
>
> writing pyodbc.egg-info/PKG-INFO
>
> writing top-level names to pyodbc.egg-info/top_level.txt
>
> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>
> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> reading manifest template 'MANIFEST.in'
>
> warning: no files found matching 'tests/*'
>
> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> installing library code to build/bdist.linux-x86_64/egg
>
> running install_lib
>
> running build_ext
>
> building 'pyodbc' extension
>
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
> -Wno-write-strings
>
> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
> file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
> such file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
> file or directory
>
> *
>
>
>

-- 
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/e142631b-c0f9-4296-9a35-2dbe295196b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread Pat Claffey
once I got pip sorted out it was really easy install django (just pip 
install django)  - so advise is to get pip working.  You will need it for 
other python packages also.

On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>
>
> I have alot of experience installing packages on windows and mac and it 
> goes very smoothly.
> I do not have alot of experience doing the installs on a Linux box.
>
> I am running into problems installing 4 packages.
>
> The Lan team tried yum, but the basic django packages were not available.
>
> Then I tried installing pip and I got proxy errors using the get-pip.py 
> script
>
> So I fell back to installing the dowloaded packages with the old standy 
>  setup.py install which fails.
>
> I am attaching the top of the log
>
> Anyone have any suggestions how to proceed?
>
> **
>
> running install
>
> running bdist_egg
>
> running egg_info
>
> writing pyodbc.egg-info/PKG-INFO
>
> writing top-level names to pyodbc.egg-info/top_level.txt
>
> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>
> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> reading manifest template 'MANIFEST.in'
>
> warning: no files found matching 'tests/*'
>
> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> installing library code to build/bdist.linux-x86_64/egg
>
> running install_lib
>
> running build_ext
>
> building 'pyodbc' extension
>
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
> -Wno-write-strings
>
> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
> file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
> such file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
> file or directory
>
> *
>
>
>

-- 
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/e43b6af2-c505-43de-a6ef-4d6da1322dd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread robert brook
I have python 3.3.

Had to coerce red hat to do allow the install  3.3.  Must have been  a 
stripped down version.
version 6 came with python 2.6 installed.

Must be a stripped down version as pip does not come with python 3.3

I believe I need the package , python3.3-dev, to get the headers to utilize 
the std   setup.py install

I am going to follow up with Red Hat.

Thanks


On Wednesday, October 22, 2014 12:53:08 PM UTC-4, Pat Claffey wrote:
>
> Hi,
> I assume you have python installed successfully.  What version?  If you 
> install python 3.4 then pip should install automatically (unless  3.4. is a 
> second python install in which case pip does not install)
>
> You should be able to see the python (and pip) executables in /usr/bin or 
> /usr/local/bin.  For example on my system I see python2.6 and pip installed 
> on /usr/bin (python is just a link to python2.6).  I manually installed 
> python3.4 and pip3.4.  I see these executables in /usr/local/bin.
>
> python2.6 was pre-installed on my linux box (red hat).  I installed 
> python3.4 and pip3.4 manually.
>
>
>
> On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>>
>>
>> I have alot of experience installing packages on windows and mac and it 
>> goes very smoothly.
>> I do not have alot of experience doing the installs on a Linux box.
>>
>> I am running into problems installing 4 packages.
>>
>> The Lan team tried yum, but the basic django packages were not available.
>>
>> Then I tried installing pip and I got proxy errors using the get-pip.py 
>> script
>>
>> So I fell back to installing the dowloaded packages with the old standy 
>>  setup.py install which fails.
>>
>> I am attaching the top of the log
>>
>> Anyone have any suggestions how to proceed?
>>
>> **
>>
>> running install
>>
>> running bdist_egg
>>
>> running egg_info
>>
>> writing pyodbc.egg-info/PKG-INFO
>>
>> writing top-level names to pyodbc.egg-info/top_level.txt
>>
>> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>>
>> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>>
>> reading manifest template 'MANIFEST.in'
>>
>> warning: no files found matching 'tests/*'
>>
>> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>>
>> installing library code to build/bdist.linux-x86_64/egg
>>
>> running install_lib
>>
>> running build_ext
>>
>> building 'pyodbc' extension
>>
>> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
>> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
>> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
>> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
>> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
>> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
>> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
>> -Wno-write-strings
>>
>> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
>> file or directory
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
>> such file or directory
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No 
>> such file or directory
>>
>> *
>>
>>
>>

-- 
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/38b5e63d-7f1b-4564-8c53-3bb99ab3020d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread robert brook
I am a contractor in a large organziation.  They must have everything 
locked down.

I downloaded get-pip.py and got errors that seemed to be proxy, firewall 
security issues, that is why I fell back to implementing through setup.py
and ran into the header issues.

Thanks

On Wednesday, October 22, 2014 12:55:26 PM UTC-4, Pat Claffey wrote:
>
> once I got pip sorted out it was really easy install django (just pip 
> install django)  - so advise is to get pip working.  You will need it for 
> other python packages also.
>
> On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>>
>>
>> I have alot of experience installing packages on windows and mac and it 
>> goes very smoothly.
>> I do not have alot of experience doing the installs on a Linux box.
>>
>> I am running into problems installing 4 packages.
>>
>> The Lan team tried yum, but the basic django packages were not available.
>>
>> Then I tried installing pip and I got proxy errors using the get-pip.py 
>> script
>>
>> So I fell back to installing the dowloaded packages with the old standy 
>>  setup.py install which fails.
>>
>> I am attaching the top of the log
>>
>> Anyone have any suggestions how to proceed?
>>
>> **
>>
>> running install
>>
>> running bdist_egg
>>
>> running egg_info
>>
>> writing pyodbc.egg-info/PKG-INFO
>>
>> writing top-level names to pyodbc.egg-info/top_level.txt
>>
>> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>>
>> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>>
>> reading manifest template 'MANIFEST.in'
>>
>> warning: no files found matching 'tests/*'
>>
>> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>>
>> installing library code to build/bdist.linux-x86_64/egg
>>
>> running install_lib
>>
>> running build_ext
>>
>> building 'pyodbc' extension
>>
>> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
>> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
>> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
>> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
>> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
>> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
>> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
>> -Wno-write-strings
>>
>> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
>> file or directory
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
>> such file or directory
>>
>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No 
>> such file or directory
>>
>> *
>>
>>
>>

-- 
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/47e63372-fc69-4d3f-9753-5b12a5a69a9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANNOUNCE] Bugfix releases issued

2014-10-22 Thread James Bennett
The first bugfix release in the 1.7 series is out, along with bugfix
releases for the supported 1.4 and 1.6 release series, and what will
hopefully be the final release of the 1.5 series, which is now past
end-of-life.

Full details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2014/oct/22/bugfix-releases-issued/

-- 
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-9u3UFxtxY%3Dh-q-D8uJwmQ0s_b4cB1KP%2BZeOpv%2B8HoxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


problem with TransactionTestCase and sqlite

2014-10-22 Thread Tim Court
Hi,

I'm having a problem using a TransactionTestCase with a sqlite database and 
was hoping someone could tell me where I've gone wrong.

I'm porting a project from Django 1.6 to 1.7 that uses LiveServerTestCase 
with a sqlite test database. I converted all of my initial_data fixtures to 
be proper data migrations. When I did that my live server tests started 
failing until I stumbled upon the serialized_rollback option to 
TransactionTestCase. However now I get the following error instead:


Traceback (most recent call last):
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/test/testcases.py",
 
line 182, in __call__
self._pre_setup()
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/test/testcases.py",
 
line 754, in _pre_setup
self._fixture_setup()
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/test/testcases.py",
 
line 797, in _fixture_setup
connections[db_name]._test_serialized_contents
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/backends/creation.py",
 
line 428, in deserialize_db_from_string
obj.save()
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/core/serializers/base.py",
 
line 173, in save
models.Model.save_base(self.object, using=using, raw=True)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/base.py",
 
line 618, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, 
update_fields)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/base.py",
 
line 699, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, 
raw)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/base.py",
 
line 732, in _do_insert
using=using, raw=raw)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/manager.py",
 
line 92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/query.py",
 
line 921, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
 
line 920, in execute_sql
cursor.execute(sql, params)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py",
 
line 65, in execute
return self.cursor.execute(sql, params)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/utils.py", 
line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py",
 
line 65, in execute
return self.cursor.execute(sql, params)
  File 
"/tmp/djangomigrate/venv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py",
 
line 485, in execute
return Database.Cursor.execute(self, query, params)
IntegrityError: columns app_label, model are not unique


I did some digging and it looks like the django.contrib.contenttypes app 
has a post-migrate script that populates the content type table. However, 
using the serialized_rollback option to refresh my migrated data also 
inserts saved duplicates into the content type table, which results in this 
exception.

I've created a minimal project that demonstrates the problem here: 
https://github.com/tctimmeh/djangomigrate

Is there any way to get my tests working? Any advice would be appreciated.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75968f10-7ffa-4c32-8093-d25999cff83d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing django on red hat linux box

2014-10-22 Thread Pat Claffey
One final suggestion...

If you are using python3.3 then pip may be called pip3.3

You could try "which python3.3"  or  "which python" (if python points to 
python3.3).  This should give you path to python executable directory.  If 
you look there you may be lucky
and see a pip executable - perhaps pip3.3

Regards,
pat

On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>
>
> I have alot of experience installing packages on windows and mac and it 
> goes very smoothly.
> I do not have alot of experience doing the installs on a Linux box.
>
> I am running into problems installing 4 packages.
>
> The Lan team tried yum, but the basic django packages were not available.
>
> Then I tried installing pip and I got proxy errors using the get-pip.py 
> script
>
> So I fell back to installing the dowloaded packages with the old standy 
>  setup.py install which fails.
>
> I am attaching the top of the log
>
> Anyone have any suggestions how to proceed?
>
> **
>
> running install
>
> running bdist_egg
>
> running egg_info
>
> writing pyodbc.egg-info/PKG-INFO
>
> writing top-level names to pyodbc.egg-info/top_level.txt
>
> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>
> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> reading manifest template 'MANIFEST.in'
>
> warning: no files found matching 'tests/*'
>
> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>
> installing library code to build/bdist.linux-x86_64/egg
>
> running install_lib
>
> running build_ext
>
> building 'pyodbc' extension
>
> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
> -Wno-write-strings
>
> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
> file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
> such file or directory
>
> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No such 
> file or directory
>
> *
>
>
>

-- 
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/ebcc8cb8-17b4-4d01-a61f-b1447fba17a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 migrations: changes detected while nothing has changed ?

2014-10-22 Thread Michael
Thanks, that fixed it.


Le mercredi 22 octobre 2014 11:20:43 UTC-5, Markus Holtermann a écrit :
>
> Hey Michael,
>
> The problem seems to be the same as in #23473 
> https://code.djangoproject.com/ticket/23473 . Try adding a __eq__ method 
> on the classes marked as deconstructible.
>
> /Markus
>
> On October 22, 2014 6:11:39 PM CEST, Michael  > wrote:
>>
>> Hi,
>>
>> Does anybody know how are changes detected by the ```makemigrations``` 
>> command in django 1.7?
>> It seems that I have a bug. The original post is on stackoverflow 
>> 
>>  
>> but no one has replied so I am trying here.
>>
>>
>> I have the issue that it always tells me there are changes for one of my 
>> field whereas there are not. When I run the command, it just writes the 
>> same migration file over and over with no changes.
>>
>> The field is a custom field on which I implemented the deconstruct method 
>> and have some parameters that are objects so I used the deconstructible 
>> decorator.
>>
>> I created a project on github that replicates the issue: 
>> https://github.com/YAmikep/django-testmigrations
>>
>> What did I do wrong? Is this a bug?
>>
>>
>> Here is what I ran:
>>
>> /projects/testmigrations$ python manage.py makemigrations app1
>> Migrations for 'app1':
>>   0001_initial.py:
>> - Create model ModelA
>> /projects/testmigrations$ python manage.py migrate
>> Operations to perform:
>>   Apply all migrations: admin, contenttypes, auth, app1, sessions
>> Running migrations:
>>   Applying contenttypes.0001_initial... OK
>>   Applying auth.0001_initial... OK
>>   Applying admin.0001_initial... OK
>>   Applying app1.0001_initial... OK
>>   Applying sessions.0001_initial... OK
>> /projects/testmigrations$ python manage.py makemigrations
>> Migrations for 'app1':
>>   0002_auto_20141014_2123.py:
>> - Alter field field1 on modela
>> /projects/testmigrations$ python manage.py makemigrations
>> Migrations for 'app1':
>>   0003_auto_20141014_2123.py:
>> - Alter field field1 on modela
>>
>>
>> The migration files 0002_auto_20141014_2123.py and 
>> 0003_auto_20141014_2123.py contain the exact same operations:
>>
>> operations = [
>> migrations.AlterField(
>> model_name='modela',
>> name='field1',
>> field=app1.models.CustomField(max_length=50, 
>> value_manager=app1.models.ValueManager(values=[app1.models.Value(val=1), 
>> app1.models.Value(val=2)])),
>> ),
>> ]
>>
>>
>> Thanks
>> Mike
>>
>>  
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>

-- 
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/2c4c4bf4-ff2b-473b-85f6-6b24d92ebaa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-admin creates the views.py files in the wrong place!

2014-10-22 Thread Aliane Abdelouahab
Hi,
Django 1.7 when a beginner runs the first tutorial, he has to change the 
views.py file outside the app to the whole project itself.
i found 
this, 
http://stackoverflow.com/questions/22011791/importerror-no-module-named-views 
and it seems it is related to Django 1.6 too?

-- 
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/8e24669e-eb24-4817-a394-9a7c2e37a8de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I display list of pages with a ListView object?

2014-10-22 Thread Daniel Grace
Hi,
How do I display list of pages with a ListView object?  For example display 
a link for each page (except maybe the current page):
previous 1 2 3 4 next

Currently I use the following in a view to display "previous" and "next":
{% if page_obj.has_previous %}
previous
{% endif %}
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
{% if page_obj.has_next %}
next
{% endif %}

I tried using a for loop with a template tag and a reference to page_obj, 
but I could not get it to work.  Any ideas?

Thanks

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


Re: How do I display list of pages with a ListView object?

2014-10-22 Thread Daniel Grace
I found a solution by writing a custom template tag, passing in the current 
page and number of pages from page_obj.
Is that an acceptable solution or can this be done without a custom tag?

-- 
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/01510699-cd13-4ba1-9a64-85709d1a6db0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I make the field layout of a model form dynamic?

2014-10-22 Thread Bill Freeman
Perhaps the most djangoish way would be to create two model forms, with
different fields excluded, and choose which to render in the template.

Or you could render CSS style information to hide one or the other.

Or you could use JavaScript to hide one or the other based on something
else that you render.

Or write the template code to render the fields instead of using .as_p, etc.

On Wed, Oct 22, 2014 at 7:48 AM, DJ-Tom  wrote:

> Hi,
>
> I have a model that contains either a text or a numerical information,
> based on the type of the entry:
>
> equipment = models.ForeignKey(equipment)
> number = models.DecimalField('Amount/number', max_digits=6,
> decimal_places=2, blank=True, null=False, default=0)
> text = models.TextField("Text", blank=True, null=True, default='')
>
> Based on that model I created a model form:
>
> class RoomsetupEquipmentForm(ModelForm):
> equipment =
> forms.ModelChoiceField(queryset=equipment.activeobjects.order_by('category__name',
> 'name'))
>
> def __init__(self, *args, **kwargs):
> super(RoomsetupEquipmentForm, self).__init__(*args, **kwargs)
> self.fields['equipment'].choices = equipment_as_choices()
>
> class Meta:
> model = roomsetup_equipments
> fields = ('equipment', 'number', 'text')
>
> I'm looking for a way to selectively show either the number or the text
> field when the form is created.
>
> Thomas
>
>
>  --
> 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/138b45bd-ad73-4d5b-ac7f-27530b8e4e0c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Is there a way to supress blank lines in the HTML?

2014-10-22 Thread Daniel Grace
Hi,
Is there a way to suppress blank lines in the HTML?
I tried using the spaceless tag but it is overkill for what I want.
I just want to suppress the blank lines from the HTML and not all space.

Any ideas?

Thanks

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


Re: Import error in settings.py

2014-10-22 Thread Felix Unchained
Just thought you might get a kick out of the fact that I just found this 
very useful – 4 years later. Thanks.

On Tuesday, February 12, 2008 7:27:45 PM UTC-8, Julien wrote:
>
> Great! Thanks a lot, it worked! 
>
> Here's a little function that I made and that is quite helpful: 
>
> def get_class(class_path): 
> i = class_path.rfind('.') 
> module_path, class_name = class_path[:i], class_path[i+1:] 
> module = __import__(module_path, globals(), locals(), 
> [class_name]) 
> return getattr(module, class_name) 
>
> Thanks again for your help. That wasn't easy, but that made me visit 
> some parts of Python and Django that I didn't know about. And it does 
> demystify a lot of things! 
>
> On Feb 13, 1:40 pm, Malcolm Tredinnick  
> wrote: 
> > On Tue, 2008-02-12 at 18:30 -0800, Julien wrote: 
> > > Hello, 
> > 
> > > The module was not compiled, because it was the __import__ function 
> > > itself that raised an exception and so didn't have the chance to do 
> > > the compilation. 
> > 
> > > As you've suggested, I tried: 
> > 
> > > klass = __import__("myapp", {}, {}, ['']) 
> > > -> Works, returns  
> > 
> > > klass = __import__("myapp.forms", {}, {}, ['']) 
> > > -> Works, returns , and compiles "forms.pyc"!! 
> > 
> > > klass = __import__("myapp.forms", {}, {}, ['MyModelForm']) 
> > > -> Works, and returns the same thing as above:  
> > 
> > > But, although the module is now compiled, the following still doesn't 
> > > work: 
> > > klass = __import__("myapp.forms.MyModelForm", {}, {}, ['']) 
> > 
> > > For info, MyModelForm is an instance of ModelFormMetaclass. I also 
> > > tried importing another model, still in vain: 
> > > klass = __import__("myapp.models.MyOtherModel", {}, {}, ['']) 
> > 
> > Oh, doh! I'm an idiot. The answer was there all along. 
> > 
> > You can't do "import myapp.models.MyOtherModel", because MyOtherModel 
> > isn't a *module*. It's something inside a module. That's just normal 
> > Python behaviour. 
> > 
> > So you have to do 
> > 
> > module = __import__("myapp.forms", {}, {}, ['MyModelForm']) 
> > 
> > (using either 'MyModelForm' or '' in the last component). Then 
> > 
> > klass = module.MyModelForm 
> > 
> > Of course, in your case, that means splitting off the last dotted piece 
> > of the string to work out the form class. This is exactly what we do in 
> > django.template.loader.find_template_source(), for example, to separate 
> > the template loader function from the model it's contained in. 
> > 
> > I'm so sorry for misleading you for a little while there. Complete brain 
> > failure on my part. But it all makes perfect sense now. 
> > 
> > Regards, 
> > Malcolm 
> > 
> > -- 
> > Depression is merely anger without enthusiasm.
> http://www.pointy-stick.com/blog/

-- 
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/f637d7c0-65ad-4eac-bc33-b6efe2ef5c6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AppConfig where to execute initialization queries?

2014-10-22 Thread Oliver George
Did you find a good solution for this?

On Monday, October 6, 2014 11:56:15 PM UTC+11, Marc Aymerich wrote:
>
> Hi,
> I have been bitten by unexpected behaviors when running tests because on 
> AppConfig.ready() I was initializing some stuff that depends on DB stored 
> data. Reading the django docs I've found a warning that specifically 
> suggests not to do this [1]. But then I wonder where this kind of 
> initialization logic should go? any suggestion?
>
> [1] 
> https://docs.djangoproject.com/en/1.7/ref/applications/#django.apps.AppConfig.ready
>
> Although you can access model classes as described above, avoid 
> interacting with the database in your ready() 
> implementation.
>  
> This includes model methods that execute queries (save() 
> 
> , delete() 
> ,
>  
> manager methods etc.), and also raw SQL queries via django.db.connection. 
> Your ready() 
> 
>  method 
> will run during startup of every management command. For example, even 
> though the test database configuration is separate from the production 
> settings, manage.py test would still execute some queries against your 
> *production* database!
>
> -- 
> Marc 
>

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


Re: Installing django on red hat linux box

2014-10-22 Thread Kelvin Wong
Take a look at the Software Collections (ver 1.1 works on RHEL 7)

http://developerblog.redhat.com/2013/01/28/software-collections-on-red-hat-enterprise-linux/


$ sudo yum install python33-python-devel
$ scl enable python33 bash

You can then install everything locally in your application user's home 
directory.

This snip is from a virtualenv build script. I use virtualenvs on my 
deployments.

$ curl https://bootstrap.pypa.io/get-pip.py | python3.3 - --user
$ echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.bash_profile
$ source ~/.bash_profile
$ which pip
/home/youruser/.local/bin/pip

$ pip install --user virtualenv virtualenvwrapper
$ echo 'source $HOME/.local/bin/virtualenvwrapper.sh' >> $HOME/.bash_profile
$ source ~/.bash_profile

K



On Wednesday, October 22, 2014 9:59:32 AM UTC-7, robert brook wrote:
>
> I am a contractor in a large organziation.  They must have everything 
> locked down.
>
> I downloaded get-pip.py and got errors that seemed to be proxy, firewall 
> security issues, that is why I fell back to implementing through setup.py
> and ran into the header issues.
>
> Thanks
>
> On Wednesday, October 22, 2014 12:55:26 PM UTC-4, Pat Claffey wrote:
>>
>> once I got pip sorted out it was really easy install django (just pip 
>> install django)  - so advise is to get pip working.  You will need it for 
>> other python packages also.
>>
>> On Wednesday, October 22, 2014 5:12:10 PM UTC+1, robert brook wrote:
>>>
>>>
>>> I have alot of experience installing packages on windows and mac and it 
>>> goes very smoothly.
>>> I do not have alot of experience doing the installs on a Linux box.
>>>
>>> I am running into problems installing 4 packages.
>>>
>>> The Lan team tried yum, but the basic django packages were not available.
>>>
>>> Then I tried installing pip and I got proxy errors using the get-pip.py 
>>> script
>>>
>>> So I fell back to installing the dowloaded packages with the old standy 
>>>  setup.py install which fails.
>>>
>>> I am attaching the top of the log
>>>
>>> Anyone have any suggestions how to proceed?
>>>
>>> **
>>>
>>> running install
>>>
>>> running bdist_egg
>>>
>>> running egg_info
>>>
>>> writing pyodbc.egg-info/PKG-INFO
>>>
>>> writing top-level names to pyodbc.egg-info/top_level.txt
>>>
>>> writing dependency_links to pyodbc.egg-info/dependency_links.txt
>>>
>>> reading manifest file 'pyodbc.egg-info/SOURCES.txt'
>>>
>>> reading manifest template 'MANIFEST.in'
>>>
>>> warning: no files found matching 'tests/*'
>>>
>>> writing manifest file 'pyodbc.egg-info/SOURCES.txt'
>>>
>>> installing library code to build/bdist.linux-x86_64/egg
>>>
>>> running install_lib
>>>
>>> running build_ext
>>>
>>> building 'pyodbc' extension
>>>
>>> gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall 
>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
>>> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv 
>>> -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
>>> -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic 
>>> -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=3.0.7 
>>> -I/usr/include/python2.6 -c /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp 
>>> -o build/temp.linux-x86_64-2.6/home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.o 
>>> -Wno-write-strings
>>>
>>> In file included from /home/rbrook/pyodbc-3.0.7/src/pyodbcmodule.cpp:12:
>>>
>>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:41:20: error: Python.h: No such 
>>> file or directory
>>>
>>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:42:25: error: floatobject.h: No 
>>> such file or directory
>>>
>>> /home/rbrook/pyodbc-3.0.7/src/pyodbc.h:43:24: error: longobject.h: No 
>>> such file or directory
>>>
>>> *
>>>
>>>
>>>

-- 
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/0543f7d8-fce6-458c-ac76-b7605145ef37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django REST Framework

2014-10-22 Thread Max Nathaniel Ho
Hi all,

I just came across Django REST Framework. From what I have read up so far, 
its a Web API framework.

What does it do and what is the difference between this and the regular 
Django Web Framework?

Thanks! 

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


Re: Django REST Framework

2014-10-22 Thread Russell Keith-Magee
Hi Max,

Django ReST Framework, as the name suggests, is a framework for building
ReST APIs in Django.

It's not officially part of the Django framework, but it's creator and
principle maintainer - Tom Christie - is a member of the Django core team.
Tom recently held a Kickstarter to fund v3 of the framework; that
Kickstarter was extraordinarily successful due to the support of the
community.

If you need to write a ReSTful API for your Django app, it's well worth
your time to take a look at it.

Yours,
Russ Magee %-)

On Thu, Oct 23, 2014 at 11:14 AM, Max Nathaniel Ho 
wrote:

> Hi all,
>
> I just came across Django REST Framework. From what I have read up so far,
> its a Web API framework.
>
> What does it do and what is the difference between this and the regular
> Django Web Framework?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/94c429f5-6028-4e17-9839-4e5c76f99a6d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: ImportError cannot import name

2014-10-22 Thread Sabine Maennel
Hello Juan,

I think your settings file should look like this:
In *settings.py* I have:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'example',
)

but to be sure I would need to see you directory structure. Hope this 
helps. 
with kind regards
 Sabine



Am Mittwoch, 22. Oktober 2014 13:38:24 UTC+2 schrieb Sabine Maennel:
>
> Hello Juan, if your project is "exsite" and your app is "example" then you 
> should probably just add "example" to the list of installed apps. Try it, 
> hope it works.
> with kind regards
> Sabine
>
> Am Mittwoch, 22. Oktober 2014 06:16:25 UTC+2 schrieb Juan Carlos:
>>
>> Hi everyone,
>>
>> When I execute the command:
>>
>> python manage.py runserver &
>>
>> The response is:
>>
>> Traceback (most recent call last):
>>   File "../manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 385, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 
>> 354, in execute
>> django.setup()
>>   File "/usr/lib/python2.7/site-packages/django/__init__.py", line 21, in 
>> setup
>> apps.populate(settings.INSTALLED_APPS)
>>   File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 
>> 85, in populate
>> app_config = AppConfig.create(entry)
>>   File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 
>> 120, in create
>> "cannot import name '%s' from '%s'" % (cls_name, mod_path))
>> ImportError: cannot import name 'example' from 'exsite'
>>
>> In *settings.py* I have:
>>
>> INSTALLED_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'exsite.example',
>> )
>>
>> If I comment (#) the last line, the bug dissapears.  ¿What can I do?  I 
>> have Django 1.7 with Python 2.7.  Thanks for your attention.
>>
>> Regards,
>> Juan
>>
>

-- 
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/e49bec3e-d757-4335-aab0-78faeb316638%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ImportError failure

2014-10-22 Thread Juan Carlos
Hi Serdar,
Sure, you're right.
Thanks, thank you very much!
Regards,
Juan

El miércoles, 22 de octubre de 2014 06:53:06 UTC-5, Serdar Dalgic escribió:
>
> Hi Juan, 
>
> I believe you might have a problem while importing "example". Can you 
> check the line you're importing example and where did you put this 
> "exsite.example" module? 
>
> Your directory structure should be like this: 
>
> mysite/ 
> manage.py 
> mysite/ 
> __init__.py 
> settings.py 
> urls.py 
> wsgi.py 
> exsite/ 
> __init__.py 
> example.py 
> another_app/ 
> __init__.py 
>another_module.py 
>
> So that you can import exsite.example in your another_module.py like: 
>
> from exsite.example import AnyClassYouWantToImport 
>
> I hope this helps. 
>
> p.s. mind the "__init__.py"s on the modules you want to import. There 
> must be one in your "exsite" dir. 
> p.s.2. Instead of an example.py file under exsite dir, you may have 
> written it under __init__.py file as 
>
> mysite/ 
> ... 
> mysite/ 
> __init__.py 
> ... 
>
> in this __init__.py, you may have 
> class Example(object): 
> ... 
> ... 
>
> this is OK either ;) 
>
>
> - Serdar Dalgıç > 
> FLOSS Developer, Life & Nature Hacker 
> twitter: 
> https://twitter.com/serdaroncode 
> https://twitter.com/serdarintowild 
>
>
> On Wed, Oct 22, 2014 at 5:35 AM, Juan Carlos  > wrote: 
> > Hi everyone, 
> > 
> > When I execute 
> > python manage.py runserver 
> > 
> > it appers: 
> > ImportError: cannot import name 'example' from 'exsite' 
> > 
> > The relative code in the settings.py file is: 
> > 
> > INSTALLED_APPS = ( 
> > 'django.contrib.admin', 
> > 'django.contrib.auth', 
> > 'django.contrib.contenttypes', 
> > 'django.contrib.sessions', 
> > 'django.contrib.messages', 
> > 'django.contrib.staticfiles', 
> > 'exsite.example', 
> > ) 
> > 
> > What can I do? 
> > 
> > My django version is 1.7, with Python 2.7.  I'm new in this interesting 
> > world of Django.  Thanks for your help, and time. 
> > 
> > Regards, 
> > Juan 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/13bae8aa-77d9-4ba6-b038-d9ce37a37c9c%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/59475bc6-8e4e-466d-9db9-1ecb7a4e4b9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.