Re: Static version of a Django website ?

2015-08-13 Thread James Schneider
When you say 'current version', are you referring to the back end source
code, or the rendered HTML version you get in the browser?

-James
On Aug 13, 2015 2:28 PM, "Stéphane Wirtel" 
wrote:

> Hi all,
>
> I would like to archive the current version of a website.
>
> Do you know a tool (ok, wget) or a Django app for this behaviour ?
>
> Regards,
>
> Stephane
>
> --
> Stéphane Wirtel - http://wirtel.be - @matrixise
>
> --
> 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/742A6411-8C9E-4397-B349-1D97E555F3F8%40gmail.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%2BciXm4URrdq4KqH0hZUTZDhGWW67g_96Zf419YHpkuzR%3DBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Static version of a Django website ?

2015-08-13 Thread Stéphane Wirtel
Hi all,

I would like to archive the current version of a website.

Do you know a tool (ok, wget) or a Django app for this behaviour ?

Regards,

Stephane

--
Stéphane Wirtel - http://wirtel.be - @matrixise

-- 
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/742A6411-8C9E-4397-B349-1D97E555F3F8%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DRF without login

2015-08-13 Thread Xavier Ordoquy

> Le 13 août 2015 à 23:06, Prabath Peiris  a écrit :
> 
> Hi 

Hi

> I am trying to implement a DRF in existing django project. I installed the 
> drf and set up APiView (class based) and add the get() to the class. When I 
> call this get method I get an error  as "Exception Value: no such table: 
> auth_user" and also create a db.sqlite3 database. how can I just simply have 
> a api (without models or without any authentications)

You probably want to turn off the DRF authentication / permissions system 
(http://www.django-rest-framework.org/api-guide/authentication/#setting-the-authentication-scheme
 

 and 
http://www.django-rest-framework.org/api-guide/permissions/#setting-the-permission-policy
 
).

> Thanks 
> Prabath 
> 

Regards,
Xavier,
Linovia.

-- 
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/40D4B51A-F981-4E60-A807-ABE1A1462D36%40linovia.com.
For more options, visit https://groups.google.com/d/optout.


DRF without login

2015-08-13 Thread Prabath Peiris
Hi 

I am trying to implement a DRF in existing django project. I installed the 
drf and set up APiView (class based) and add the get() to the class. When I 
call this get method I get an error  as "Exception Value: no such table: 
auth_user" and also create a db.sqlite3 database. how can I just simply 
have a api (without models or without any authentications)

Thanks 
Prabath 

-- 
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/c9c07b7b-daf4-40bb-bf0e-0978d0593a59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to use the sites framework?

2015-08-13 Thread derek riemer

Hi,
I have 3 apps. A base site, with a main menu, a personal website with a 
biography, and a weather app. I was curious if the sites framework can 
distinguish each app as a separate site while they are all on the same 
domain? I have derekriemer.pythonanywhere.com, and on the apps are 
pointed to by / /weather and /personal under that domain. What would be 
the use case for me to use the sites 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/55CD02B7.3000604%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to pass a string as url's parameter

2015-08-13 Thread I . Dié
Hi evrybody,

Here is my model:

# fruits/models
Class Fruit (models.Model):
name =  models.CharField(max_length = 33,
   choices = NAME_CHOICES, default = MANGO)
   # and so on...

# fruits/views
def fruit(request, fruit_name):
fruit = get_object_or_404(Fruit)
return render(request, 'fruits/fruit.html', {'fruit': fruit})

# fruits/urls
urlpatterns = [
url(r'^$', views.index, name="index"),
url(r'^(?P[-\w]+)/$', views.fruit, name='fruit'),
]

When I used fruit_id, everything was ok. 
But I want to know how to use Fruit.name (a string) as url's parameter 
instead of fruit_id like this: myverybigmarket/fruits/mango better than 
myverybigmarket/fruits/1

Ps: this is my first python/django project.

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/404e6ef5-99d7-4e38-8bf1-978b8690d733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Loading sqlite function failed with runserver but works in django shell

2015-08-13 Thread Tazo Gil
Dear all

django 1.8
python 3.4

The sqlite function sqlite-Levenshtein 
(https://github.com/mateusza/SQLite-Levenshtein) is working perfectly in 
the django shell, example: 
self.annotate(distance=Func(Value(aword), F('word'), function='levenshtein'
)).filter(distance__lte=settings.DISTANCE_LEVENSHTEIN).order_by("distance")

but not with runserver : "no such function: levenshtein"

I load this extension in my app __init__.py as follow:

from mezzanine.conf import settings
# levenshtein exists in postgresql, sqlite needs extension
if 'sqlite3' in settings.DATABASES['default']['ENGINE']:
from django.db import connection
cursor =connection.cursor()
cursor.db.connection.enable_load_extension(True)
cursor.db.connection.load_extension(settings.SQLITE_LEVENSHTEIN) 


with settings.SQLITE_LEVENSHTEIN = 
="/usr/local/src/sqlite-Levenshtein/src/.libs/liblevenshtein.so"

I certainly miss something, hope somebody will help me, thanks by advance.

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


Re: 'admin/index.html' does not exist

2015-08-13 Thread bobhaugen
Tried another install using pip 7.1.0 on another computer, ubuntu 12.04, 
and django installed only once, in vn/lib/python2.7/site-packages, with its 
templates etc intact.

So I don't know what happened the previous time. We just fixed it by moving 
the files on the 14.04 box, so it's not an urgent problem. But it would 
still be interesting to learn if anybody else has seen it.

-- 
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/e1ebf55c-ab9c-4dbd-9785-04bb7f594301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


'admin/index.html' does not exist

2015-08-13 Thread bobhaugen
TemplateDoesNotExist at /admin/

admin/index.html


Created a new virtualenvironment.
pip install Django==1.4.21

Pip installs two django directories.
One in the base virtualenv directory (e.g vn/django), another in 
vn/lib/python2.7/site-packages.

The in the base virtualenv directory has admin/templates, the one under 
site-packages does not.

This is different from previous installations, which only had django under 
site-packages, with the admin/templates.

We're running in Ubuntu 14.04. pip --version 7.1.0

This is a different (newer) version of pip than we've used before. Anybody 
seen this behavior?

More details:

Request Method:GETRequest URL:http://127.0.0.1:8000/admin/Django Version:
1.4.21Exception Type:TemplateDoesNotExistException Value:

admin/index.html

Exception 
Location:/home/lynn/Envs/vn/local/lib/python2.7/site-packages/django/template/loader.py
 
in select_template, line 193Python 
Executable:/home/lynn/Envs/vn/bin/pythonPython 
Version:2.7.6Python Path:

['/home/lynn/Envs/vn/valuenetwork',
 '/home/lynn/Envs/vn/lib/python2.7',
 '/home/lynn/Envs/vn/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/lynn/Envs/vn/lib/python2.7/lib-tk',
 '/home/lynn/Envs/vn/lib/python2.7/lib-old',
 '/home/lynn/Envs/vn/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/lynn/Envs/vn/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages/pip-7.1.0-py2.7.egg',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

Server time:Thu, 13 Aug 2015 13:13:08 +
Template-loader postmortem

Django tried loading these templates, in this order:

   - Using loader django.template.loaders.filesystem.Loader:
  - 
  /home/lynn/Envs/vn/valuenetwork/valuenetwork/templates/admin/index.html 
(File 
  does not exist)
   - Using loader django.template.loaders.app_directories.Loader:
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/pinax_theme_bootstrap_account/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/pinax_theme_bootstrap/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/django_forms_bootstrap/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/metron/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/django_extensions/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/local/lib/python2.7/site-packages/notification/templates/admin/index.html
 (File 
  does not exist)
  - 
  
/home/lynn/Envs/vn/valuenetwork/valuenetwork/valueaccounting/templates/admin/index.html
 (File 
  does not exist)
   

-- 
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/847e33d9-11d2-4560-8e18-0880c3195860%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems installing a Django package

2015-08-13 Thread Jani Tiainen
Throwing away virtualenv is actually best way to get problems (unless you're 
working with solutions like docker or vagrant).

Virtualenv makes easy to check that you really do have only certain packages, 
certain versions and they won't generate any sudden surprises.

On Thu, 13 Aug 2015 04:27:02 -0700 (PDT)
duriromp...@gmail.com wrote:

> I use no virtualenv, to throw away solutions in that direction.. (didn't 
> wanna to go hard first time).
> *pip* is only installed in 3.2, so that wasn't the problem. I've solved the 
> problem right now, but after an hour of trial and error, I think the only 
> think was to do *--upgrade wheel*. Is was just the problem of that package. 
> Maybe was broken when I installed it.
> 
> Thanks for the help!
> 
> 
> 
> El miércoles, 12 de agosto de 2015, 19:21:42 (UTC+2), girish ramnani 
> escribió:
> >
> >
> > Is wheel in latest version?
> > Also 
> >  
> > your wheel package is installed in 
> > wheel in /usr/local/lib/python3.2/dist-packages
> >
> > but the django-muro-humoristas
> > is being installed in 
> >
> > /home/rompepc/.local/lib/python3.2/site-packages
> >
> > So have you activated a virtualenv ? 
> >
> > Also i tried to installed a package using wheel it went into
> > shiboken in /home/girish/anaconda3/lib/python3.4/site-packages
> >
> > and location on wheel on my system is
> >
> > wheel in /home/girish/anaconda3/lib/python3.4/site-packages
> > so as you can see they both are same.
> >
> > you can try to install using
> > python -m pip install 
> >
> > to remove the ambiguity of different pips used to install.
> >
> >
> >
> > On Wednesday, August 12, 2015 at 1:32:39 AM UTC+5:30, durir...@gmail.com 
> > wrote:
> >>
> >> I did the tutorial for reusable apps for Django. All went well... but 
> >> then I get problems when installing the app.
> >> Processing ./django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
> >>   Requirement already satisfied (use --upgrade to upgrade): 
> >> django-muro-humoristas==1 from 
> >> file:///media/Comun/Programacion/Python/Django/Proyectos/muro_humoristas/django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
> >>  
> >> in /home/rompepc/.local/lib/python3.2/site-packages
> >> Building wheels for collected packages: django-muro-humoristas
> >>   Running setup.py bdist_wheel for django-muro-humoristas
> >>   Complete output from command /usr/bin/python3 -c "import 
> >> setuptools;__file__='/tmp/pip-ip3iaz-build/setup.py';exec(compile(open(__file__).read().replace('\r\n',
> >>  
> >> '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp3885trpip-wheel-:
> >>   usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
> >>  or: -c --help [cmd1 cmd2 ...]
> >>  or: -c --help-commands
> >>  or: -c cmd --help
> >>   
> >>   error: invalid command 'bdist_wheel'
> >>   
> >>   
> >>   Failed building wheel for django-muro-humoristas
> >> Failed to build django-muro-humoristas
> >>
> >> Searching about the error, it looks like I just have to install *wheel*. 
> >> However, when I run the command *sudo pip install wheel* (*pip* is 
> >> installed under *Python3*):
> >> Requirement already satisfied (use --upgrade to upgrade): wheel in 
> >> /usr/local/lib/python3.2/dist-packages
> >>
> >> So, seeing that I can just going, I retry the package install and... get 
> >> the same error: "*invalid command 'bdist_wheel'"*. Anyone could tell me 
> >> what is going on? Is my first time doing a reusable app.
> >>
> >>
> 
> -- 
> 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/cff1f3fe-c0e0-4b0a-a135-ef87f70e0113%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


-- 
Jani Tiainen

-- 
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/20150813150605.6d0971a5%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.


User and Permission from admin to the app

2015-08-13 Thread Predator
Hi there! 

I have a question regarding user permissions.

How can I use the user permissions that I have set in the admin to my 
django app?

For example, I have a user* 'Trainee'* and in django admin, I set 
*'Trainee'* to only add to my model. So, 'Trainee' can only add to this 
model, not change and delete it. When I logged in to* my app*, I can still 
delete and change. I may be missing some vital points and I hope someone 
can point me to the right direction.

Thanks and have a great day!

-- 
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/d64cc98d-40c7-43b1-aecc-25fc7a1d752c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Trouble w. Setting Up Virtual Env.

2015-08-13 Thread Lukasz Przewlocki
I had a very similar issue. Looks like the space in Python path could be 
the issue. This is my answer from the *StackOverflow *question (Can't 
install via pip with Virtualenv 

):

I had a very similar issue on my *Windows 7* machine and struggled couple 
of days with that. Both paths, to my python distribution and to my VE *had 
spaces* in it. Couple of months before it worked fine. I found the 
following note on virtualenv website:


*Windows Notes*[...] To create a virtualenv under a path with spaces in it on 
Windows, you’ll need the win32api library installed.

The following steps lead me to success:

   1. Make sure I used pip to install virtualenv and it's the latest 
   version (pip-7.1.0). Result: *failure*.
   2. Install win32api. Result: *failure* (although there was some error at 
   the very end of installation process).
   3. Try to install my VE in a path without spaces. Result: *failure*.
   4. Reinstall my Anaconda python distribution to the path that didn't 
   contain the "[" and "]" brackets. VE had spaces in the path. Result: 
   *failure*.
   5. Reinstall my Anaconda python distribution to the path that also 
   didn't contain any spaces. The VE folder still had spaces in the path. 
   Result: *success!*

So at least the Anaconda (python) installation simple, *non space-pollutted 
path was crucial*. Maybe win32api installation was also important. Not sure.


On Tuesday, June 2, 2015 at 6:28:49 PM UTC+1, Steve Burrus wrote:
>
> *I hasve repeatedly tried now to set up the Django Virtual Environment 
> without any success! Just what am I doing wrong anyway?? I am at my "wit's 
> end"  trying to figure out what the specific problem is.*
>   
> *c:\Users\SteveB\Desktop>virtualenv steve1*
> *Using base prefix 'C:\\Python 3.5'*
> *New python executable in steve1\Scripts\python.exe*
> *Installing setuptools, pip, wheel...*
> *  Complete output from command 
> c:\Users\SteveB\Desk...1\Scripts\python.exe -c "import sys, pip; sys...d\"] 
> + sys.argv[1:]))" setuptools pip wheel:*
> *  Ignoring indexes: https://pypi.python.org/simple 
> *
> *Collecting setuptools*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  The repository located at None is not a trusted or secure host and is 
> being ignored. If this repository is available via HTTPS it is recommended 
> to use HTTPS instead, otherwise you may silence this warning and allow it 
> anyways with '--trusted-host None'.*
> *  Could not find a version that satisfies the requirement setuptools 
> (from versions: )*
> *No matching distribution found for setuptools*
> **
> *...Installing setuptools, pip, wheel...done.*
> *Traceback (most recent call last):*
> *  File "C:\Python 3.5\lib\runpy.py", line 170, in _run_module_as_main 
> "__main__", mod_spec)*
> *  File "C:\Python 3.5\lib\runpy.py", line 85, in _run_code exec(code, 
> run_globals)*
> *  File "C:\Python 3.5\Scripts\virtualenv.exe\__main__.py", line 9, in 
> *
> *  File "C:\Python 3.5\lib\site-packages\virtualenv.py", line 832, in main 
> symlink=options.symlink)*
> *  File "C:\Python 3.5\lib\site-packages\virtualenv.py", line 1004, in 
> create_environment*
> *install_wheel(to_install, py_executable, search_dirs)*
> *  File "C:\Python 3.5\lib\site-packages\virtualenv.py", line 969, in 
> install_wheel*
> *'PIP_NO_INDEX': '1'*
> *  File "C:\Python 3.5\lib\site-packages\virtualenv.py", line 910, in 
> call_subprocess*
> *% (cmd_desc, proc.returncode))*
> *OSError: Command c:\Users\SteveB\Desk...1\Scripts\python.exe -c "import 
> 

Re: Problems installing a Django package

2015-08-13 Thread durirompepc
I use no virtualenv, to throw away solutions in that direction.. (didn't 
wanna to go hard first time).
*pip* is only installed in 3.2, so that wasn't the problem. I've solved the 
problem right now, but after an hour of trial and error, I think the only 
think was to do *--upgrade wheel*. Is was just the problem of that package. 
Maybe was broken when I installed it.

Thanks for the help!



El miércoles, 12 de agosto de 2015, 19:21:42 (UTC+2), girish ramnani 
escribió:
>
>
> Is wheel in latest version?
> Also 
>  
> your wheel package is installed in 
> wheel in /usr/local/lib/python3.2/dist-packages
>
> but the django-muro-humoristas
> is being installed in 
>
> /home/rompepc/.local/lib/python3.2/site-packages
>
> So have you activated a virtualenv ? 
>
> Also i tried to installed a package using wheel it went into
> shiboken in /home/girish/anaconda3/lib/python3.4/site-packages
>
> and location on wheel on my system is
>
> wheel in /home/girish/anaconda3/lib/python3.4/site-packages
> so as you can see they both are same.
>
> you can try to install using
> python -m pip install 
>
> to remove the ambiguity of different pips used to install.
>
>
>
> On Wednesday, August 12, 2015 at 1:32:39 AM UTC+5:30, durir...@gmail.com 
> wrote:
>>
>> I did the tutorial for reusable apps for Django. All went well... but 
>> then I get problems when installing the app.
>> Processing ./django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
>>   Requirement already satisfied (use --upgrade to upgrade): 
>> django-muro-humoristas==1 from 
>> file:///media/Comun/Programacion/Python/Django/Proyectos/muro_humoristas/django-muro_humoristas/dist/django-muro_humoristas-1.tar.gz
>>  
>> in /home/rompepc/.local/lib/python3.2/site-packages
>> Building wheels for collected packages: django-muro-humoristas
>>   Running setup.py bdist_wheel for django-muro-humoristas
>>   Complete output from command /usr/bin/python3 -c "import 
>> setuptools;__file__='/tmp/pip-ip3iaz-build/setup.py';exec(compile(open(__file__).read().replace('\r\n',
>>  
>> '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp3885trpip-wheel-:
>>   usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
>>  or: -c --help [cmd1 cmd2 ...]
>>  or: -c --help-commands
>>  or: -c cmd --help
>>   
>>   error: invalid command 'bdist_wheel'
>>   
>>   
>>   Failed building wheel for django-muro-humoristas
>> Failed to build django-muro-humoristas
>>
>> Searching about the error, it looks like I just have to install *wheel*. 
>> However, when I run the command *sudo pip install wheel* (*pip* is 
>> installed under *Python3*):
>> Requirement already satisfied (use --upgrade to upgrade): wheel in 
>> /usr/local/lib/python3.2/dist-packages
>>
>> So, seeing that I can just going, I retry the package install and... get 
>> the same error: "*invalid command 'bdist_wheel'"*. Anyone could tell me 
>> what is going on? Is my first time doing a reusable app.
>>
>>

-- 
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/cff1f3fe-c0e0-4b0a-a135-ef87f70e0113%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: bulk add m2m relationship for multiple instances

2015-08-13 Thread Erik Cederstrand

> Den 13/08/2015 kl. 04.09 skrev yakkades...@gmail.com:
> 
> I'll run a test with the dict vs list+position counter. I know I saw a speed 
> improvement but I can't remember if that was the only thing I changed. 
> 
> I'd have to change a lot of code if I change the DB scheme so I'm not wanting 
> to create an intermediate table. I'm going to go down the SQL path.

The intermediate model doesn't change the DB schema in your case. A 
models.ManyToManyField already implicitly creates a table in the DB to hold the 
m2m relation. The intermediate model just makes this explicit.

The only thing this changes in your code is that you can't do 
"my_datapoint.sensors.add(my_sensor)" anymore. You need to always create (and 
delete) a DatapointSensorRel explicitly.

Erik

-- 
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/ABFA88FA-3D1F-42F8-A634-9E04C0C6DCD3%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.


Re: bulk add m2m relationship for multiple instances

2015-08-13 Thread Derek
This Python wiki 
(https://wiki.python.org/moin/PythonSpeed/PerformanceTips#Choose_the_Right_Data_Structure)
 
suggests:

* Membership testing with sets and dictionaries is much faster, O(1), than 
searching sequences, O(n). When testing "a in b", b should be a set or 
dictionary instead of a list or tuple.

This may or may not apply to your use case.   There is also more discussion 
in this thread:
http://bytes.com/topic/python/answers/587277-how-much-slower-dict-indexing-vs-list-indexing

I have also found in some of my own cases (not involving m2m models though) 
that dropping down to raw SQL for bulk uploads is fast enough to justify 
doing it; but I am trading off against all the model checks/balances that 
Django provides.

On Thursday, 13 August 2015 04:09:04 UTC+2, yakka...@gmail.com wrote:
>
> I'll run a test with the dict vs list+position counter. I know I saw a 
> speed improvement but I can't remember if that was the only thing I 
> changed. 
>
>
> I'd have to change a lot of code if I change the DB scheme so I'm not 
> wanting to create an intermediate table. I'm going to go down the SQL path. 
> Let me know if you have any suggestions. I'm still a beginner with SQL. 
>
>
> Thanks for your help!!!
>
>
> Brian
>
>
>
>

-- 
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/4dab3118-8317-43ea-82a9-e425d4218b1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.