Re: Django 1.6 test cases for code which calls transaction.set_autocommit()

2014-03-06 Thread Anssi Kääriäinen
On Friday, March 7, 2014 12:11:59 AM UTC+2, Justin Michalicek wrote:
>
> It appears that due to test cases running in an atomic block, testing 
> methods which use transaction.set_autocommit() all fail.  I've got a small 
> handful of test cases around methods which need to use manual transaction 
> management and they are definitely working when I actually use the site, 
> but in test cases they all fail and raise the exception 
> "TransactionManagementError: This is forbidden when an 'atomic' block is 
> active." at the line where I call transaction.set_autocommit(False)
>
> Is there something I'm missing here?
>

Django's default TestCase runs the whole test inside a transaction, thus 
code trying to manage transactions fail. The reason for this is that if the 
tests are ran inside transactions, there is no need to clean up the 
database after the test, as doing rollback at the end of the test will 
guarantee clean state. If you need to test transactional code, use 
TransactionTestCase.

 - Anssi 

-- 
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/80596e57-ec2f-44c7-bd89-2eb2990d2d3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trying to set up hashed versioning in Django for static files

2014-03-06 Thread Vernon Burt
Hello all,

I've pretty quikly found out in my DJango adventure that I need to have 
some kind of versioning for my static css and javascript files. After 
talking to some web developers I was directed to use Django's 
CachedStaticFilesStorage app to append an md5 hash to the static files 
path. No matter how I set my static settings the files don't seem to get 
the has appended and  I can no longer link to any of my static files, 
either directly or using the static directive. I was wondering if anyone 
might know what I am doing wrong.

My  Settings:

STATIC_ROOT = 'staticfiles'

STATIC_URL = ''
# Additional locations of static files
STATICFILES_DIRS = ()

STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',)

STATICFILES_STORAGE = 
'django.contrib.staticfiles.storage.CachedStaticFilesStorage'


My Template entry:

{% block cssfiles %}{% load static%}{% endblock %}

Anything that can point me in the right direction would help.If intrested, I've 
also had this question up on StackOverflow for a few days: 
http://stackoverflow.com/questions/22130697/djangos-cachedstaticfilesstorage-not-hashing-file-urls
 

-- 
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/4ee50ecb-4f5b-4e6d-a683-d0c7bd7a979d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using inlines on a one to many but not seeing "add another" link

2014-03-06 Thread Dennis Marwood
I found the answer to my issue, posting it here in case others have the 
same issue. 

The problem was caused by an old version of inline.js being loaded. I ran 
collectstatic at some point and a version of the script from 1.3 was saved.

On Saturday, 1 March 2014 15:53:41 UTC-8, Dennis Marwood wrote:
>
> Hello. 
> Here are my models and admin.py  dpaste.de 
> And here is the what I am referring to 
> https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-form
> But I my not seeing the link to add another. 
>
> 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/6733723e-271c-4762-9424-bd00b6de8e92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pandas in Django

2014-03-06 Thread judy wawira
Hello 

I have a CSV file that i wish to manipulate based on user inputs and show 
this on a Djnago project

I dont necessarily wish to save the data in the model 

Can anyone point me to a direction on how to do this 

I have tried creating a normal app like below but it says listmethod not 
found 

mydf = pd.read_csv(file,header=1)

#get header
cols = list(mydf.columns.values)
colheader = cols.tolist()

-- 
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/1318658c-2d52-40e5-a636-13cb7a1953c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Code Layout with an Apache Server

2014-03-06 Thread Tom Browder
On Thu, Mar 6, 2014 at 7:29 PM, Tom Browder  wrote:
> On Thu, Mar 6, 2014 at 5:24 PM, Tom Browder  wrote:
>> I am working on my first Django project and would like to get comments
>> on a reasonable layout for a single Django instance used with several
> ...
>
> In the attached file there were a couple of mistakes.  In the macro
> definition directive the file shows:
>
>   

Note that mod_macro is a new feature in  Apache 2.4--a good reason to
upgrade IMHO.

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


Re: Code Layout with an Apache Server

2014-03-06 Thread Tom Browder
On Thu, Mar 6, 2014 at 5:24 PM, Tom Browder  wrote:
> I am working on my first Django project and would like to get comments
> on a reasonable layout for a single Django instance used with several
...

In the attached file there were a couple of mistakes.  In the macro
definition directive the file shows:

  

and in the macro body a typical use is:

  ServerName  ${project}.${tld}

However the macro does not expand as I'm used to in shell and other
macro programming, so that

  $project

is not the same as

  ${project}

so the macro definition directive should have been:

  

Then the use of "${project}" and "${tld}" in the macro body is correct.

I have now successfully used such macros and they are a real boon for
using multiple virtual hosts.

Best regards,

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


Code Layout with an Apache Server

2014-03-06 Thread Tom Browder
I am working on my first Django project and would like to get comments
on a reasonable layout for a single Django instance used with several
Django projects where:

1. each project is a single web site on a unique virtual host (vhost)
2. all virtual hosts are on a single, real server running Debian 7
3. the real server is running a single Apache 2.4.7 (soon to be 2.4.8) instance
4. each virtual host using Django will be SSL/TLS only or non-SSL/TLS
(i.e., no mixed traffic ports at any one vhost)

Basically I would like to associate the project names with the virtual
host domain names, for example:

domain  =>  project

domain1.com => domain1
domain2.com => domain2

I would also like to share common things between sites as much as possible.

Attached is a file showing the appropriate Apache httpd.conf section
illustrating my proposed vhost macro.

Note that the projects are all under:

  /web-sites/${project}.${tld}/cgi-bin/${project}

so that that the Python base project name does not have a dot to
confuse Python treatment as a module.

Does anyone see any problems with this layout (except obvious lack of
common Python code treatment)?

I think it will be fairly easy to re-factor common code later.

Comments welcome.

Best regards,

-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/CAFMGiz86WywcSsS-kVV_cZK%2Bjzg6OKfDpTe%2BE%3DqGwEni7mmtQA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
# use Apache's mod_macro:
#   define a VHost Macro for repetitive configurations
#   domain name convention: ${project}.${tld} (e.g., "example.com")


  # A Django site using mod_wsgi
  ServerName  ${project}.${tld}
  ServerAlias www.${project}.${tld}

  DocumentRoot /web-sites/${project}.${tld}/public

  # serving static files
  Alias /robots.txt  /web-sites/${project}.${tld}/public/robots.txt
  Alias /favicon.ico /web-sites/${project}.${tld}/public/favicon.ico

  AliasMatch ^/([^/]*\.css) /web-sites/${project}.${tld}/public/styles/$1

  Alias /media/  /web-sites/${project}.${tld}/public/media/
  Alias /static/ /web-sites/${project}.${tld}/pubic/static/
  Alias /admin/  
/virtualenvs/myfirstenv/lib/python2.7/site-packages/django/contrib/admin/static/admin/

  
Order deny,allow
Require all granted
  

  
Order deny,allow
Require all granted
  

  # mod_wsgi handles below here
  # See notes in:
  #   http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
  #   http://code.google.com/p/modwsgi/wiki/ConfigurationIssues
  #   https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi
  WSGIScriptAlias / /web-sites/${project}.${tld}/${project}/wsgi.py
  # using daemon mode
  WSGIDaemonProcess ${project}.${tld} 
python-path=/web-sites/${project}.${tld}/cgi-bin/${project} 
python-home=/virtualenvs/myfirstenv/lib/python2.7
  WSGIProcessGroup  ${project}.${tld}

  WSGIProcessGroup %{GLOBAL}
  WSGIApplicationGroup %{GLOBAL}

  
AuthType Basic
AuthName "Top Secret"
Require valid-user
AuthBasicProvider wsgi
WSGIAuthUserScript /web-sites/${project}.${tld}/cgi-bin/${project}/wsgi.py
  

  

  Order deny,allow
  Require all granted

  




Use VHOST_NONSSL domain1 com
Use VHOST_NONSSL domani2 org
UndefMacro VHOST_NONSSL


Re: "Authenticating Users" where should I put the code?

2014-03-06 Thread Jack Yan
Thank you :)

On Friday, March 7, 2014 12:13:26 AM UTC+8, Felipe Coelho wrote:
>
> 2014-03-06 11:45 GMT-03:00 Jack Yan >:
>
>> in the tutorial and section "Authenticating Users":
>> https://docs.djangoproject.com/en/1.6/topics/auth/default/
>>
>> where can I put code:
>>
>> from django.contrib.auth import authenticateuser = 
>> authenticate(username='john', password='secret')if user is not None:
>> # the password verified for the user
>> if user.is_active:
>> print("User is valid, active and authenticated")
>> else:
>> print("The password is valid, but the account has been 
>> disabled!")else:
>> # the authentication system was unable to verify the username and 
>> password
>> print("The username and password were incorrect.")
>>
>> in what file or what folder?
>>
>
> That is described later in the same page [1].
>
> But if you just want to enable login/logout/password reset for your 
> project, the easiest way is to include Django's default auth views in your 
> urls.py [2].
>
> [1] 
> https://docs.djangoproject.com/en/1.6/topics/auth/default/#how-to-log-a-user-in
> [2] 
> https://docs.djangoproject.com/en/1.6/topics/auth/default/#module-django.contrib.auth.views
>  

-- 
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/ee3a12da-814c-4169-bc59-d160176566a9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django 1.6 test cases for code which calls transaction.set_autocommit()

2014-03-06 Thread Justin Michalicek
It appears that due to test cases running in an atomic block, testing 
methods which use transaction.set_autocommit() all fail.  I've got a small 
handful of test cases around methods which need to use manual transaction 
management and they are definitely working when I actually use the site, 
but in test cases they all fail and raise the exception 
"TransactionManagementError: This is forbidden when an 'atomic' block is 
active." at the line where I call transaction.set_autocommit(False)

Is there something I'm missing here?

-- 
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/59e318ed-406a-4cb1-ac77-212480816faa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Different content type objects in django template

2014-03-06 Thread Daniel Roseman
On Thursday, 6 March 2014 18:33:36 UTC, Robin Lery wrote:
>
> I am having a hard time to understand ContentType. I am learning from a 
> tutorial, this is the link . I have synced the database, and its working in 
> the admin. But when I try to load the ContentType objects in the template, 
> I get nothing. When I see the page source, the get_rendered_method is not 
> loading the rendered template in the homepage.html.
>
> *These are my models:*
>
> 
>
> Where am I doing the mistake? How do I load different content_type objects 
> in the template? I would really appreciate if you could help me solve this. 
> Thank you!
>

There seems to be quite a lot of information missing from this post. Where 
is get_rendered_html being called? What objects are you passing? What does 
the view look like?
--
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/8a118865-466d-4783-bc15-5ac14876f0d4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Different content type objects in django template

2014-03-06 Thread Robin Lery
I am having a hard time to understand ContentType. I am learning from a
tutorial, this is the link . I have synced the database, and its working in
the admin. But when I try to load the ContentType objects in the template,
I get nothing. When I see the page source, the get_rendered_method is not
loading the rendered template in the homepage.html.

*These are my models:*


class Photo(models.Model):

user = models.ForeignKey(User)

description = models.TextField()

image = models.ImageField(upload_to=get_upload_file_name)

photo_upload = models.DateTimeField(auto_now=True, auto_now_add=False)

is_public = models.BooleanField(default=True)


class Meta:

verbose_name = 'Photo'

verbose_name_plural = 'Photos'

ordering = ['-photo_upload']


class Status(models.Model):

user = models.ForeignKey(User)

state = models.CharField(max_length=200)

status_upload = models.DateTimeField(auto_now=True, auto_now_add=False)

is_public = models.BooleanField(default=True)


class StreamItem(models.Model):

content_type = models.ForeignKey(ContentType)

object_id = models.PositiveIntegerField()

pub_date = models.DateTimeField()

content_object = generic.GenericForeignKey('content_type','object_id')


# The get_rendered_html method simply passes the retrieved object to a
template with that object's name

def get_rendered_html(self):

template_name = 'stream_item_%s.html' % (self.content_type.name)

return render(request, template_name,
{'object':self.content_object})


*These are the template for content_type.name :*

*stream_item_Photo.html:*






{{ object.pub_date|date:"F jS Y, P" }}

{{ object.user }}




*stream_item_Status.html:*




{{ object.state }}

{{ object.time|date:"F jS Y, P" }}

User: {{ object.user }}




Where am I doing the mistake? How do I load different content_type objects
in the template? I would really appreciate if you could help me solve this.
Thank you!

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


Re: "Authenticating Users" where should I put the code?

2014-03-06 Thread Felipe Bessa Coelho
2014-03-06 11:45 GMT-03:00 Jack Yan :

> in the tutorial and section "Authenticating Users":
> https://docs.djangoproject.com/en/1.6/topics/auth/default/
>
> where can I put code:
>
> from django.contrib.auth import authenticateuser = 
> authenticate(username='john', password='secret')if user is not None:
> # the password verified for the user
> if user.is_active:
> print("User is valid, active and authenticated")
> else:
> print("The password is valid, but the account has been 
> disabled!")else:
> # the authentication system was unable to verify the username and password
> print("The username and password were incorrect.")
>
> in what file or what folder?
>

That is described later in the same page [1].

But if you just want to enable login/logout/password reset for your
project, the easiest way is to include Django's default auth views in your
urls.py [2].

[1]
https://docs.djangoproject.com/en/1.6/topics/auth/default/#how-to-log-a-user-in
[2]
https://docs.djangoproject.com/en/1.6/topics/auth/default/#module-django.contrib.auth.views

-- 
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/CAP5dYfNxCPTL%2BcqK%3DHaQBhKPYQSZ-BMqKnHk7vu-vJuqg84K2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: "Authenticating Users" where should I put the code?

2014-03-06 Thread Robin Lery
This should be in your views.py.


On Thu, Mar 6, 2014 at 8:15 PM, Jack Yan  wrote:

> in the tutorial and section "Authenticating Users":
> https://docs.djangoproject.com/en/1.6/topics/auth/default/
>
> where can I put code:
>
> from django.contrib.auth import authenticateuser = 
> authenticate(username='john', password='secret')if user is not None:
> # the password verified for the user
> if user.is_active:
> print("User is valid, active and authenticated")
> else:
> print("The password is valid, but the account has been 
> disabled!")else:
> # the authentication system was unable to verify the username and password
> print("The username and password were incorrect.")
>
> in what file or what folder?
>
>  --
> 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/0654812d-74d5-48a1-a977-26958f417a61%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Django Site(s) looks ugly with ?None as query parameter.

2014-03-06 Thread Christian Schmitt
Hello, currently I have some Django sites one of them 
is http://www.schnooge-hansili.de/ if i open it 
with http://www.schnooge-hansili.de/?None It looks really ugly. Currently 
the first site is just a simple CBV view. Nothing really special.

-- 
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/cedd2c00-f95f-4582-b8b4-9845b2f39f75%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


"Authenticating Users" where should I put the code?

2014-03-06 Thread Jack Yan
in the tutorial and section "Authenticating Users":
https://docs.djangoproject.com/en/1.6/topics/auth/default/

where can I put code:

from django.contrib.auth import authenticateuser = 
authenticate(username='john', password='secret')if user is not None:
# the password verified for the user
if user.is_active:
print("User is valid, active and authenticated")
else:
print("The password is valid, but the account has been disabled!")else:
# the authentication system was unable to verify the username and password
print("The username and password were incorrect.")

in what file or what folder?

-- 
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/0654812d-74d5-48a1-a977-26958f417a61%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Newbie: ImportError during syncdb

2014-03-06 Thread Jay Parikh
Hi David,

Instead of specifying ''django_bookmarks.bookmarks'' in 'INSTALLED_APPS' i
would suggest you to use your app name which you have created e.g someting
like as below:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bookmarks',
)
I am assuming over here as you have kept your app name as *'bookmarks'*.

-Jay


On Thu, Mar 6, 2014 at 6:43 AM, David  wrote:

> Dear django users,
>
> I am new to django and have an ImportError: No module named bookmarks
> problem.
>
> It seems that as I tried to syncdb django does not recognize the
> bookmarks module I have created before. In the past I was able to
> syncdb, hence my confusion.
>
> I am trying to teach myself by following "Learning Website Development
> with Django" by Ayman Hourieh.
>
> I am not working in a virtualenv.
>
> Thanks for your guidance and hints!
>
> David
>
>
> settings.py:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django_bookmarks.bookmarks',
> )
>
> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
> manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
> utility.execute()
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 280, in execute
> translation.activate('en-us')
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
> line 130, in activate
> return _trans.activate(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 188, in activate
> _active.value = translation(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 159, in _fetch
> app = import_module(appname)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
> 40, in import_module
> __import__(name)
> ImportError: No module named bookmarks
>
> --
> 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/5317CBCC.4060908%40gmx.net.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: Newbie: ImportError during syncdb

2014-03-06 Thread Jay Parikh
Let say for example i am going to create new app say bookmarks then i will
do something like *"python manage.py startapp bookmarks" *likewise whatever
name you have passed in place of *bookmarks.* Just place it inside
INSTALLED_APPS.



On Thu, Mar 6, 2014 at 1:06 PM, Robin Lery  wrote:

> What the name of the app folder? I think its just django_bookmarks.
>
>
> On Thu, Mar 6, 2014 at 6:43 AM, David  wrote:
>
>> Dear django users,
>>
>> I am new to django and have an ImportError: No module named bookmarks
>> problem.
>>
>> It seems that as I tried to syncdb django does not recognize the
>> bookmarks module I have created before. In the past I was able to
>> syncdb, hence my confusion.
>>
>> I am trying to teach myself by following "Learning Website Development
>> with Django" by Ayman Hourieh.
>>
>> I am not working in a virtualenv.
>>
>> Thanks for your guidance and hints!
>>
>> David
>>
>>
>> settings.py:
>>
>> INSTALLED_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'django_bookmarks.bookmarks',
>> )
>>
>> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
>> manage.py syncdb
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 399, in execute_from_command_line
>> utility.execute()
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 392, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 242, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 280, in execute
>> translation.activate('en-us')
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>> line 130, in activate
>> return _trans.activate(language)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 188, in activate
>> _active.value = translation(language)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 177, in translation
>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 159, in _fetch
>> app = import_module(appname)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
>> 40, in import_module
>> __import__(name)
>> ImportError: No module named bookmarks
>>
>> --
>> 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/5317CBCC.4060908%40gmx.net
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: Class that extends a model that is not a model

2014-03-06 Thread Domagoj Kovač
Thanks Havier, 

Proxy models also look like something that fit my needs.

-- 
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/410c0a24-8e8d-433f-9da2-99e179ccc7f2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.