Re: Inconsistency when importing views and models

2015-06-19 Thread James Schneider
This is strictly a Python question, nothing Django-specific, but I've found this site to be helpful in explaining the different ways to import things: http://effbot.org/zone/import-confusion.htm In general, using 'from blah import *' is frowned upon except in very specific cases. While it is easi

Re: Inconsistency when importing views and models

2015-06-19 Thread Peith Vergil
It depends on how your project files are structured. If you have a file structure that looks like this: app/ __init__.py models.py views.py urls.py Then, you can simply use relative imports. In views.py: from models import * In urls.py: from views import * If, for example, your

Re: Inconsistency when importing views and models

2015-06-19 Thread Mike Dewhirst
On 20/06/2015 11:01 AM, jorrit...@gmail.com wrote: This is mostly a cosmetic question, and I could be completely wrong because I'm fairly new to Django, or it could be that there is a perfectly logical explanation for this, but here goes: It seems the code required to import views in urls.py and

Inconsistency when importing views and models

2015-06-19 Thread jorrit787
This is mostly a cosmetic question, and I could be completely wrong because I'm fairly new to Django, or it could be that there is a perfectly logical explanation for this, but here goes: It seems the code required to import views in urls.py and models in views.py is inconsistent (and in the ca

Re: Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Mike Dewhirst
On 20/06/2015 2:16 AM, Todd Kovalsky wrote: Having a miserable time trying to get a django site running on a wintel box. The issue comes after I add models to models.py. I keep getting the error Could not import settings 'myapp.settings'...No module named myapp.settings. Your DJANGO_SETTINGS_

Re: NameError: name 'reciever' is not defined

2015-06-19 Thread James Schneider
Check your spelling for receiver... -James On Jun 19, 2015 3:26 PM, "Marco Neumann" wrote: > Hi There, > > Im stuck on above error. Anyone a hint? Many thanks > > My code in models.py: > > from django.db.models.signals import post_save > from django.dispatch import receiver > from django.db impo

NameError: name 'reciever' is not defined

2015-06-19 Thread Marco Neumann
Hi There, Im stuck on above error. Anyone a hint? Many thanks My code in models.py: from django.db.models.signals import post_save from django.dispatch import receiver from django.db import models from django.contrib.auth.models import User class UserProfile(models.Model): user = models.One

OAuth Authentication

2015-06-19 Thread Ashish Gupta
I an using Django OAuth Toolkit and Django Rest for OAuth authentication for mobile app. For accessing any protected resource client id and secret of the app is required . Where should I store client secret. Storing in APK is unsafe as it can be decompiled. Even obfuscation can be reverse engin

Re: comment and uncomments in django html template

2015-06-19 Thread Bill Freeman
If your JavaScript comes from a django template, yes, the comment tag will work. If, instead, you want the lines delivered to the browser, but commented out as far as JavaScript is concerned, use /* to start the comment and */ to end it -- multiple lines are allowed. On Fri, Jun 19, 2015 at 12:48

Re: comment and uncomments in django html template

2015-06-19 Thread Sindhujit Ganguly
This does not work for javascript defined inside html templates.. This is for html structures.. I needed for multiple line comments in js scripts. On Friday, June 19, 2015 at 10:46:40 AM UTC-6, Karen Tracey wrote: > > On Fri, Jun 19, 2015 at 12:42 PM, Sindhujit Ganguly > wrote: > >> >> Does an

Re: comment and uncomments in django html template

2015-06-19 Thread Karen Tracey
On Fri, Jun 19, 2015 at 12:42 PM, Sindhujit Ganguly wrote: > > Does anyone know how to do multiple line comments in django html > templates? > > Yes, block comment template tag: https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#comment -- You received this message because you are

comment and uncomments in django html template

2015-06-19 Thread Sindhujit Ganguly
Hi, Does anyone know how to do multiple line comments in django html templates? 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.

Re: Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Bill Freeman
Is this under manage.py or behind a wsgi front end like Apache/mod_wsgi or ngnx? If under manage.py, you need to cd to the directory containing manage.py first. (There are ways around this if absolutely necessary.) If behind a wsgi front end, there are other means for insuring that this director

Re: Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Vijay Khemlani
How is your project folder structure? If you open a normal python shell from the same directory as your manage.py and execute "import myapp.settings" what does it say? On Fri, Jun 19, 2015 at 1:16 PM, Todd Kovalsky wrote: > Having a miserable time trying to get a django site running on a wintel

Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Todd Kovalsky
Having a miserable time trying to get a django site running on a wintel box. The issue comes after I add models to models.py. I keep getting the error Could not import settings 'myapp.settings'...No module named myapp.settings. Very irritating trying to get a site up and working on a windows ma

Re: Preferred way of adding social authorization to a Django / REST app?

2015-06-19 Thread aRkadeFR
I like JWT authentication coupled with AngularJS: https://github.com/GetBlimp/django-rest-framework-jwt On 06/18/2015 08:00 PM, Daniel Grace wrote: What is the preferred way of adding social authorization to a Django / REST app? I see that there are at least two packages: django-rest-framewor