Re: Django CMS

2014-11-09 Thread Sergiy Khohlov
send also log from console

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sun, Nov 9, 2014 at 6:06 PM, Niall  wrote:

> Hi guys,
>
> I was hoping that someone could help me out with the following. I m
> currently trying to access Djang CMS for the first time. I have been
> following the steps on this page
> 
>  but
> it turns up with this error when I run the server and load int he browser.
>
> Would appreciate any tips please. Thanks
>
> Niall
>
> --
> 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/bc63432e-7bbe-44f9-bd56-220dc7256634%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/CADTRxJPUE1gUQqSVx%3D29pDuQbEsS-fxEypLO2sv-zxtR388TYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Loading fixtures in Django 1.7

2014-11-09 Thread Fred Stluka

Leonard,

In Django 1.4, you would add this code to the forwards()
method of the migration:

from django.core.management import call_command
call_command("loaddata", "")

--Fred

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

On 11/9/14 5:46 PM, Leonard Wayne wrote:

I am in the process of upgrading from
Django 1.6 to 1.7.

I have three fixtures.  I am trying to figure
out how I should load them.

One fixture is `initial_data.json`, and I know
that starting with Django 1.7 this special
fixture no longer gets automatically loaded
as it did when we used to run `syncdb` (i.e.,
prior to deprecation in Django 1.7).

So I know all three fixtures should be loaded
the same way as each other, whatever way that
may be.

My main question is:

Should I keep using `loaddata`, as in:

python manage.py loaddata .json

Reading the documentation I get the sense
(though I am not sure) that now the preferred
approach to load fixtures is to create a
migration to perform the loading.  But I
don't see an example of how to do this
process from beginning to end.  It looks
like the process starts with creating an
empty migration, then manually editing the
migration file to define a function like:

def load_data(apps, schema_editor):

But I don't know how to write this function
(`load_data`), and I can't find an example.
--
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/e39e44eb-66c5-4e23-89a5-c2abfae9a6ea%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/546052D0.70604%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Loading fixtures in Django 1.7

2014-11-09 Thread Leonard Wayne
I am in the process of upgrading from
Django 1.6 to 1.7.

I have three fixtures.  I am trying to figure
out how I should load them.

One fixture is `initial_data.json`, and I know
that starting with Django 1.7 this special
fixture no longer gets automatically loaded
as it did when we used to run `syncdb` (i.e.,
prior to deprecation in Django 1.7).

So I know all three fixtures should be loaded
the same way as each other, whatever way that
may be.

My main question is:

Should I keep using `loaddata`, as in:

python manage.py loaddata .json

Reading the documentation I get the sense
(though I am not sure) that now the preferred
approach to load fixtures is to create a
migration to perform the loading.  But I
don't see an example of how to do this
process from beginning to end.  It looks
like the process starts with creating an
empty migration, then manually editing the
migration file to define a function like:

def load_data(apps, schema_editor):

But I don't know how to write this function
(`load_data`), and I can't find an example.

-- 
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/e39e44eb-66c5-4e23-89a5-c2abfae9a6ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: different urls

2014-11-09 Thread Russell Keith-Magee
On Sun, Nov 9, 2014 at 4:50 PM, gerard  wrote:

> Hello all,
>
> i have an application (Django 1.4 LTS) that can be accessed with 2 urls:
> the default is https://my.app.org
> and the second is http://consult.my.app.org
>
> In the templates, i'm using:
> {% trans "Connect to see more
> features" %}
>
> and it's displayed as https://my.app.org/accounts/login if we access from
> https://my.app.org but http://consult.my.app.org/accounts/login if the
> second one.
>

Are you sure about that? The default behaviour of the {% url %} tag doesn't
include the domain - it only includes the path. The *browser* will
interpret that as a fully qualified URL on the same domain as the current
page, but the page itself should only include the "/accounts/login" part.


> For few href in templates, i need to change the rendreed url, forcing it
> to the first form or the second form, not depending on the user experience.
> I'm wondering if it is possible to change it in Django (not in apache by
> using redirection)? for instance with Sites?
> http://consult.my.app.org/, i want href login to be
> https://my.app.org/accounts/login, not http://consult.my.app.org/
> accounts/login
> or sometimes if user needs events/1352747/ical/, i want to force the
> resulting as
> http://consult.calendrier.emath.fr/events/1352747/ical/
> not https://
>

No rewriting or special tricks are needed - just prepend the domain you
want. For example, if you want to always redirect to the "my.app.org"
version of the URL, just put that URL as a prefix in the HREF:

https://my.app.org{% url 'auth_login' %}">

If referencing the site is something you're going to be doing more often
than just once to point at a login page, you could do something with a
context processor to put a specific site into the context for every page,
and then reference that site instead of using a string literal in your
template.

Hope that helps!

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


Re: Django strange behaviour

2014-11-09 Thread Scot Hacker


On Saturday, November 8, 2014 9:07:04 AM UTC-8, monoBOT monoBOT wrote:
>
> Lists are inmutable 
>
Lists are absolutely mutable in Python - hence the availability of 
`result.append()`. 

Perhaps you're thinking of tuples, which are not mutable and have no 
methods for alteration. 

./s




>>  

-- 
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/3a17280a-ca43-448c-af2a-973e48db9207%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


求解答 说是找不到'hello', 我看Python的搜索path 也对啊 附件是程序 我是第一次接触Django

2014-11-09 Thread zhoumingxing985
NameError at /

name 'hello' is not defined

  Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 
1.7.1 Exception Type: NameError Exception Value: 

name 'hello' is not defined

 Exception Location: E:\djcode\mysite\mysite\urls.py in , line 5 Python 
Executable: C:\Python27\python.exe Python Version: 2.7.6 Python Path: 

['E:\\djcode\\mysite',
 'C:\\Python27\\lib\\site-packages\\setuptools-1.1.4-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\swampy-2.1.7-py2.7.egg',
 'C:\\Python27\\lib\\site-packages\\django-1.7.1-py2.7.egg',
 'C:\\windows\\system32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages']

-- 
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/80dc76f9-f88e-40e1-a439-acb4fc994417%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from django.http import HttpResponse

def hello(request):
return HttpResponse("Hello world")
from django.conf.urls import *
#from django.contrib import admin

urlpatterns = patterns('',
   ('^hello/$', hello),
# Examples:
# url(r'^$', 'mysite.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),

#url(r'^admin/', include(admin.site.urls)),
)


Re: createsuperuser tells me its been skipped due to not running in a tty and then tells me i can do it manually by running createsuperuser. Very confused

2014-11-09 Thread Fred Stluka

On 11/8/14 6:54 PM, James Schneider wrote:
If you are running them directly via one-time SSH commands (ie $ ssh 
host 'command'),  note that SSH does not request a full TTY and runs 
everything inside of a channel, which may also pose problems. 

In which case, you can resolve the issue by using ssh -t as
I've often had to do when running sudo via ssh.

See:
- http://bristle.com/Tips/Unix.htm#sudo_via_ssh

--Fred

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



-James

On Nov 8, 2014 2:47 PM, "Andri Sigurðsson" > wrote:


Ok i'm running this on a cygwin zsh shell.

with python 3.4.1 and Django 1.7.1

I've been running the first app Tutorial on the Django site and
its all been going perfectly right up to this moment and i'm
absolutely stumped.

When i try to run "./manage.py createsuperuser"  it gives me this
error.

"Superuser creation skipped due to not running in a TTY. You can
run `manage.py createsuperuser` in your project to create one
manually."

I havn't been able to find any posts on this particular issue,
 any ideas? :(

-- 
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/448a6acf-6497-4708-9f28-26d7abad043e%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/CA%2Be%2BciXdEatKM2MgY11OC57TS%3Do8Am4SrfGrdtomj191%3DGsg3Q%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/545F88BF.6070507%40bristle.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where does django store auth migrations?

2014-11-09 Thread Cal Leeming [iops.io]
Sounds like a bit of a weird edge case, I've had all sorts of problems
previously when moving to custom user models from an app with existing
migration data.

Personally I'd say get rid of the migration data for that specific model
and re-initialize, it's just not worth trying to figure out why the magic
is broken (imho).

Cal

On Fri, Nov 7, 2014 at 8:50 AM, Dr Ed  wrote:

> Hi all,
>
> I feel a bit embarrassed even asking this question, because it must have
> an obvious answer... but when I do "./manage.py migrate -l" I see:
>
>
> *admin*
>
>  [X] 0001_initial
>
> *auth*
>
>  [X] 0001_initial
>
>  [X] 0002_customer_payingcustomer_projectmanager_staff
>
>  [X] 0003_auto_20141107_0803
>
> *contenttypes*
>
>  [X] 0001_initial
>
> *portal*
>
>  [X] 0001_initial
>
>  [X] 0002_auto_20141008_2032
>
>  [X] 0003_auto_20141008_2058
>
>  [X] 0004_auto_20141008_2100
>
>  [X] 0005_auto_20141008_2102
>
>  [X] 0006_auto_20141008_2259
>
>  [X] 0007_project_project_video_url
>
> *sessions*
>
>  [X] 0001_initial
>
>
>
> *Where do I find the auth migrations?* I've used grep, find and
> Spotlight... I've searched the repository. I just can't find them! What am
> I missing?
>
> As a bit of background - the reason I'm doing this is we want to migrate
> to custom user models (removing username and just using email). However
> when I do this, I get "TypeError: Staff cannot proxy the swapped model
> 'emailcustomuser.User'.
> "
>
> We don't actually need the proxy users, so I tried deleting them, but this
> didn't change anything (possibly because of these migrations I can't find).
>
> Cheers,
>
> Ed
>
>  --
> 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/ce688047-4e81-4ad8-bd71-115e9ca05ef9%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/CAHKQagGZbVf96-HraFpSFqNqV2FG1nX7ryOyQWOvd6p_jRHqXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where does django store auth migrations?

2014-11-09 Thread Daniel Roseman
On Sunday, 9 November 2014 13:40:12 UTC, Dr Ed wrote:
>
> Okay, I'm confused. I found it, in here:
> /Users//.virtualenvs//lib/python2.7/site-
> packages/django/contrib/auth/migrations
>
> Why are app related migrations being stored in this location?
>
> Cheers,
>
> Ed
>

What? Migrations related to Django's auth app are, not surprisingly, stored 
alongside the code to that app. Why does this puzzle you? 
--
DR.

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


Re: Where does django store auth migrations?

2014-11-09 Thread Dr Ed
Okay, I'm confused. I found it, in here:
/Users//.virtualenvs//lib/python2.7/site-
packages/django/contrib/auth/migrations

Why are app related migrations being stored in this location?

Cheers,

Ed


On Friday, 7 November 2014 09:50:47 UTC+1, Dr Ed wrote:
>
> Hi all,
>
> I feel a bit embarrassed even asking this question, because it must have 
> an obvious answer... but when I do "./manage.py migrate -l" I see:
>
>
> *admin*
>
>  [X] 0001_initial
>
> *auth*
>
>  [X] 0001_initial
>
>  [X] 0002_customer_payingcustomer_projectmanager_staff
>
>  [X] 0003_auto_20141107_0803
>
> *contenttypes*
>
>  [X] 0001_initial
>
> *portal*
>
>  [X] 0001_initial
>
>  [X] 0002_auto_20141008_2032
>
>  [X] 0003_auto_20141008_2058
>
>  [X] 0004_auto_20141008_2100
>
>  [X] 0005_auto_20141008_2102
>
>  [X] 0006_auto_20141008_2259
>
>  [X] 0007_project_project_video_url
>
> *sessions*
>
>  [X] 0001_initial
>
>
>
> *Where do I find the auth migrations?* I've used grep, find and 
> Spotlight... I've searched the repository. I just can't find them! What am 
> I missing?
>
> As a bit of background - the reason I'm doing this is we want to migrate 
> to custom user models (removing username and just using email). However 
> when I do this, I get "TypeError: Staff cannot proxy the swapped model 
> 'emailcustomuser.User'.
> "
>
> We don't actually need the proxy users, so I tried deleting them, but this 
> didn't change anything (possibly because of these migrations I can't find). 
>
> Cheers,
>
> Ed
>
>

-- 
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/8d890e5a-7016-40c2-94bf-ab66716fdb06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Useing non-ascii character in django

2014-11-09 Thread Hossein Rashnoo
Writing my code with linux editor cause the problem,I wrote that with 
notepad and save it as 'utf8' and my problem solved.

On Saturday, November 8, 2014 11:49:10 AM UTC+3:30, Hossein Rashnoo wrote:
>
> When i return Persian characters in view.py (same as Arabic characters) i 
> got an error , So i add this line to top of view.py:
> # encoding=utf-8
>
> And now my Persian word is like this :
> �
> And when i add 'u' before my word again i got error,I run django on Linux 
> with Apache. Please help me and sorry for my terrible English.  
>

-- 
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/2845f768-703c-4568-87ed-9eec6d97bfb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


different urls

2014-11-09 Thread gerard

Hello all,

i have an application (Django 1.4 LTS) that can be accessed with 2 urls:
the default is https://my.app.org
and the second is http://consult.my.app.org

In the templates, i'm using:
{% trans "Connect to see more 
features" %}


and it's displayed as https://my.app.org/accounts/login if we access 
from https://my.app.org but http://consult.my.app.org/accounts/login if 
the second one.


For few href in templates, i need to change the rendreed url, forcing it 
to the first form or the second form, not depending on the user experience.
I'm wondering if it is possible to change it in Django (not in apache by 
using redirection)? for instance with Sites?

http://consult.my.app.org/, i want href login to be 
https://my.app.org/accounts/login, not 
http://consult.my.app.org/accounts/login
or sometimes if user needs events/1352747/ical/, i want to force the 
resulting as

http://consult.calendrier.emath.fr/events/1352747/ical/
not https://


Thans in advance for help,

--
Gérard Henry

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