Can someone help me with this Question posted on stack over flow?

2016-03-15 Thread Sanchit Balchandani
Question 
- 
http://stackoverflow.com/questions/36023158/how-to-change-the-name-of-db-column-last-login-created-by-custom-django-user

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c7080e8-b222-4706-b8d8-3fe6866cad5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation for User.set_unusable_password() doesn't feel complete

2016-03-15 Thread Tim Graham
Yes, there's a mention of that on the password_reset() view docs: 
https://docs.djangoproject.com/en/stable/topics/auth/default/#django.contrib.auth.views.password_reset

Feel free to submit some docs clarifications as a pull request if you'd 
like.

On Tuesday, March 15, 2016 at 7:32:41 PM UTC-4, jorr...@gmail.com wrote:
>
> Does setting an unusable password on a user prevent them from using the 
> reset password feature?
>
>
> On Wednesday, January 13, 2016 at 10:14:11 PM UTC+1, Brice PARENT wrote:
>>
>> When you set an usable password (using 
>> https://docs.djangoproject.com/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.set_unusable_password),
>>  
>> it is not really clear that to make the password usable again, one should 
>> use `set_password` and define a new one. 
>> The doc says that this method "Marks the user as having no password set." 
>> which sounds like it's a boolean attribute somewhere that we might unset 
>> somehow. It should probably state that the method replaces the active 
>> password by one that can never be used, and add that to be able to use the 
>> password, it has to be set again using `set_password`. It also gives the 
>> false impression that we could prevent temporarily an user from login by 
>> setting this, but that would be a bad idea as it would lose the password.
>>
>> Or maybe the method name `set_unusable_password` is explicit enough in 
>> english, but for other languages, I'm not sure the documentation should 
>> only rely on the methods names to be understood (the description looks like 
>> the one for a method that would be called `set_password_unusable`).
>>
>> What do you think about it?
>> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2b55d612-bd73-4252-8a55-a285d6dbb089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password hasher for vBulletin?

2016-03-15 Thread Tim Graham
I can't think of anything offhand besides implementing your own 
PBKDF2PasswordHasher subclass which does its own more sophisticated 
splitting that doesn't get confused by dollar signs in the salt.

On Tuesday, March 15, 2016 at 7:26:59 PM UTC-4, jorr...@gmail.com wrote:
>
> Holy crap, you guys have really thought of everything! Love it!
>
> Unfortunately this doesn't work on all users because some salts contain 
> the *$* character which gives the *assert salt and '$' not in salt* 
> error. Is there a workaround for this?
>
>
> On Tuesday, March 15, 2016 at 4:59:39 PM UTC+1, Tim Graham wrote:
>>
>> Take a look at 
>> https://docs.djangoproject.com/en/stable/topics/auth/passwords/#password-upgrading-without-requiring-a-login
>>
>> Instead of SHA1PasswordHasher().encode() you'll want to use vBulletin's 
>> hashing algorithm.
>>
>> On Tuesday, March 15, 2016 at 11:54:32 AM UTC-4, jorr...@gmail.com wrote:
>>>
>>> I'm converting an old vBulletin 3.8 installation to a Django web app and 
>>> I'm wondering if I can migrate users over with their passwords intact.
>>>
>>> vBulletin uses *md5(md5(password) + salt)* to hash its passwords, would 
>>> any of Django's built-in password hashers work with this out of the box?
>>>
>>> Some of the salts also contain the *$* character, I'm guessing that's a 
>>> big problem?
>>>
>>> I'm wondering if it would be easiest (or even possible) to write a 
>>> custom password hasher for this or just have everyone reset their passwords 
>>> once the new site goes live.
>>>
>>> Any thoughts on this would be appreciated!
>>>
>>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27ca205a-22b6-4e23-8a3a-e45b636b9251%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Documentation for User.set_unusable_password() doesn't feel complete

2016-03-15 Thread jorrit787
Does setting an unusable password on a user prevent them from using the 
reset password feature?


On Wednesday, January 13, 2016 at 10:14:11 PM UTC+1, Brice PARENT wrote:
>
> When you set an usable password (using 
> https://docs.djangoproject.com/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.set_unusable_password),
>  
> it is not really clear that to make the password usable again, one should 
> use `set_password` and define a new one. 
> The doc says that this method "Marks the user as having no password set." 
> which sounds like it's a boolean attribute somewhere that we might unset 
> somehow. It should probably state that the method replaces the active 
> password by one that can never be used, and add that to be able to use the 
> password, it has to be set again using `set_password`. It also gives the 
> false impression that we could prevent temporarily an user from login by 
> setting this, but that would be a bad idea as it would lose the password.
>
> Or maybe the method name `set_unusable_password` is explicit enough in 
> english, but for other languages, I'm not sure the documentation should 
> only rely on the methods names to be understood (the description looks like 
> the one for a method that would be called `set_password_unusable`).
>
> What do you think about it?
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7823e5fc-e7fe-4059-a1ad-cafbda1c2351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password hasher for vBulletin?

2016-03-15 Thread jorrit787
Holy crap, you guys have really thought of everything! Love it!

Unfortunately this doesn't work on all users because some salts contain the 
*$* character which gives the *assert salt and '$' not in salt* error. Is 
there a workaround for this?


On Tuesday, March 15, 2016 at 4:59:39 PM UTC+1, Tim Graham wrote:
>
> Take a look at 
> https://docs.djangoproject.com/en/stable/topics/auth/passwords/#password-upgrading-without-requiring-a-login
>
> Instead of SHA1PasswordHasher().encode() you'll want to use vBulletin's 
> hashing algorithm.
>
> On Tuesday, March 15, 2016 at 11:54:32 AM UTC-4, jorr...@gmail.com wrote:
>>
>> I'm converting an old vBulletin 3.8 installation to a Django web app and 
>> I'm wondering if I can migrate users over with their passwords intact.
>>
>> vBulletin uses *md5(md5(password) + salt)* to hash its passwords, would 
>> any of Django's built-in password hashers work with this out of the box?
>>
>> Some of the salts also contain the *$* character, I'm guessing that's a 
>> big problem?
>>
>> I'm wondering if it would be easiest (or even possible) to write a custom 
>> password hasher for this or just have everyone reset their passwords once 
>> the new site goes live.
>>
>> Any thoughts on this would be appreciated!
>>
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d9e50689-3286-4cf3-84cb-367bd72fadbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django via wsgi

2016-03-15 Thread Ryan Nowakowski
On Mon, Mar 14, 2016 at 09:01:46PM -0700, parallaxpl...@gmail.com wrote:
> Quite new, and trying to deploy first Django site. I keep getting 503 
> errors. Here are the particulars, any hints as to what I'm doing wrong 
> would be much appreciated! All directories and files are group owned and 
> writable by www-data. Ubuntu server, and Apache2.4 server where I have root 
> access. The tutorial where I got the howto is located here:
> https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
> 
> Thank you!
> 
> *File structure/location:*
> 
> /home/user/kb_venv/project_name/
> __init__.py
> settings.py
> urls.py
> wsgi.py
> manage.py
> app_name
> 
> /home/user/kb_venv/project_name/project_name/
> apache/
> __init__.py
> override.py
> wsgi.py
> 
> 
> *override.py file contents:*
> from project_name.settings import
> DEBUG = True
> #ALLOWED_HOSTS = ['104.131.154.99'] (no domain name, I'm using IP to access 
> the site)
> 
> *wsgi.py file contents:*
> #wsgi.py
> import os, sys
> # Calculate the path based on the location of the WSGI script.
> apache_configuration= os.path.dirname(__file__)
> project = os.path.dirname(apache_configuration)
> workspace = os.path.dirname(project)
> sys.path.append(workspace)
> sys.path.append(project)
> 
> # Add the path to 3rd party django application and to django itself.
> sys.path.append('/home/smlake/kb_venv')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'project_name.apache.override'
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
> 
> *Apache2.4 000-default file:*
> 
> 
> WSGIScriptAlias / /home/smlake/kb_venv/project_name/apache/wsgi.py
> 
>   Require all granted
> 
> ServerAdmin parallaxpl...@gmail.com
> DocumentRoot /home/smlake/kb_venv/project_name/project_name
> 
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
> 
> 
> 
> 
> *Apache error log entry:*
> [Mon Mar 14 23:58:48.413099 2016] [authz_core:error] [pid 8034:tid 
> 140480713053952] [client 54.188.195.80:57782] AH01630: client denied by 
> server configuration: /home/user/kb_venv/project_name/

Perhaps you need to allow access to that directory?  Maybe something
like this:


  Require all granted


-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20160315223946.GZ16655%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Automatic admin rights to user groups

2016-03-15 Thread Joe Landrigan
My wife wants a website that would allow users to create ad-hoc groups and 
control group access.

She wants a website for stay-at-home moms to network, gossip, share 
information, and generally take over the world.  A friend pointed me at groups 
in BuddyPress 
, 
but that's PHP . . . and I like the idea of doing something like this in 
Django.  The key thing I *really* want is this right here:

The individual who creates the group is automatically the group’s first 
> administrator. As a result, each group must have at least one 
> administrator, though the first admin can choose to appoint others.


Is there an app that does this in Django?  If not, how would I go about 
creating one?  I think Guardian 
 could be a good start, 
but as I'm new at this, and don't have much time to spare, I'm afraid 
learning it may be difficult.  Do I just need to use WordPress?  (Please! 
No!)

Thanks for any insight you can give!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/897156f9-3fd2-464f-ab2f-af4df8c163a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


invitation to collaborate on a django_yosai integration

2016-03-15 Thread Darin Gordon
Hey everyone

I'm the author of Yosai, a security framework for python applications. 
 Yosai can be used by a wide range of applications, not just web 
applications.

The first PyPI release of Yosai is imminent -- by end of March.  The 
release of the project coincides with the release of a few "batteries 
included" project extensions, currently to enable caching and datastore 
interaction.  I'm looking to add project integrations to this portfolio, 
such as one that will integrate Yosai with Django.  If anyone would like to 
work together on a django_yosai integration, please contact me if this is 
something you can truly commit yourself to.  I've authored a project web 
site but am not actively marketing it until the first release (again, by 
end of month).  However, I can share the link with you offline for an early 
preview.  The github page gives you an overview of the project: 
 http://www.github.com/yosaiproject

Please contact me if you'd like to work together.

Regards

Darin

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b3badc42-d22e-49d5-bb25-2fae4780e041%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Password hasher for vBulletin?

2016-03-15 Thread Tim Graham
Take a look at 
https://docs.djangoproject.com/en/stable/topics/auth/passwords/#password-upgrading-without-requiring-a-login

Instead of SHA1PasswordHasher().encode() you'll want to use vBulletin's 
hashing algorithm.

On Tuesday, March 15, 2016 at 11:54:32 AM UTC-4, jorr...@gmail.com wrote:
>
> I'm converting an old vBulletin 3.8 installation to a Django web app and 
> I'm wondering if I can migrate users over with their passwords intact.
>
> vBulletin uses *md5(md5(password) + salt)* to hash its passwords, would 
> any of Django's built-in password hashers work with this out of the box?
>
> Some of the salts also contain the *$* character, I'm guessing that's a 
> big problem?
>
> I'm wondering if it would be easiest (or even possible) to write a custom 
> password hasher for this or just have everyone reset their passwords once 
> the new site goes live.
>
> Any thoughts on this would be appreciated!
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e46b3bc7-b6ec-4654-ad4d-c0345d56278e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Password hasher for vBulletin?

2016-03-15 Thread jorrit787
I'm converting an old vBulletin 3.8 installation to a Django web app and 
I'm wondering if I can migrate users over with their passwords intact.

vBulletin uses *md5(md5(password) + salt)* to hash its passwords, would any 
of Django's built-in password hashers work with this out of the box?

Some of the salts also contain the *$* character, I'm guessing that's a big 
problem?

I'm wondering if it would be easiest (or even possible) to write a custom 
password hasher for this or just have everyone reset their passwords once 
the new site goes live.

Any thoughts on this would be appreciated!

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2c960ff9-038d-4ed8-9937-1ff07869bc81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: unhashable type: 'dict'

2016-03-15 Thread Bruno Barbosa
you forgot the function name auth_views.logout as a second parameter as
mentioned above.

try it:
url(r'^logout/$', *auth_views.logout*, {'next_page': 'boardgames_home'},
name='boardgames_logout'),

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br *

On Tue, Mar 15, 2016 at 10:32 AM, Deepanshu Sagar 
wrote:

> yes, thank you for the prompt reply, I am using
>
> from django.contrib.auth import views as auth_views
>
> I need to redirect my webpage to "board_games" main page when the user
> logs out.
> can you please direct me to the correct way to do that?
>
> Thanks in advance.
>
>
>
> On Tuesday, March 15, 2016 at 5:45:07 PM UTC+5:30, luisza14 wrote:
>
>> You are correct, your problem is in logout url , because you need to pass
>> a function not a duct as second parameter.
>>
>> Are you using django auth views ?
>>
>>
>>
>> https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.logout
>>
>>
>> El martes, 15 de marzo de 2016, Deepanshu Sagar 
>> escribió:
>> > Hello,
>> > i am getting below error while accessing http://localhost:8000/login/.
>> >
>> 
>> >
>> > Below are the chaining codes.
>> > boardgames\urls.py
>> >
>> 
>> > boardgames\templates\login.html
>> >
>> 
>> >
>> > NOTE: before adding "
>> >
>> > url(r'^logout/', {'next_page': 'boardgames_home'},
>> name='boardgames_logout')
>> >
>> > to boardgames\urls.py. the access was working fine.
>> > below is the settings.py
>> >
>> > """
>> > Django settings for boardgames project.
>> >
>> > For more information on this file, see
>> > https://docs.djangoproject.com/en/1.6/topics/settings/
>> >
>> > For the full list of settings and their values, see
>> > https://docs.djangopro ect.com/en/1.6/ref/settings/
>> > """
>> >
>> > # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>> > import os
>> > BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>> >
>> >
>> > # Quick-start development settings - unsuitable for production
>> > # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
>> >
>> > # SECURITY WARNING: keep the secret key used in production secret!
>> > SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'
>> >
>> > # SECURITY WARNING: don't run with debug turned on in production!
>> > DEBUG = True
>> >
>> >
>> > ALLOWED_HOSTS = []
>> >
>> >
>> > # Application definition
>> >
>> > INSTALLED_APPS = (
>> > 'django.contrib.admin',
>> > 'django.contrib.auth',
>> > 'django.contrib.contenttypes',
>> > 'django.contrib.sessions',
>> > 'django.contrib.messages',
>> > 'django.contrib.staticfiles',
>> > 'main',
>> > 'tictactoe',
>> > )
>> >
>> > MIDDLEWARE_CLASSES = (
>> > 'django.contrib.sessions.middleware.SessionMiddleware',
>> > 'django.middleware.common.CommonMiddleware',
>> > 'django.middleware.csrf.CsrfViewMiddleware',
>> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> > 'django.contrib.messages.middleware.MessageMiddleware',
>> > 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> > )
>> >
>> > ROOT_URLCONF = 'boardgames.urls'
>> >
>> > TEMPLATES = [
>> > {
>> > 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> > 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>> > 'APP_DIRS': True,
>> > 'OPTIONS': {
>> > 'context_processors': [
>> > 'django.core.context_processors.request',
>> > 'django.template.context_processors.debug',
>> > 'django.template.context_processors.request',
>> > 'django.contrib.auth.context_processors.auth',
>> > 'django.contrib.messages.context_processors.messages',
>> > ],
>> > },
>> > },
>> > ]
>> >
>> >
>> > WSGI_APPLICATION = 'boardgames.wsgi.application'
>> >
>> >
>> > # Database
>> > # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
>> >
>> > DATABASES = {
>> > 'default': {
>> > 'ENGINE': 'django.db.backends.sqlite3',
>> > 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
>> > }
>> > }
>> >
>> > # Internationalization
>> > # https://docs.djangoproject.com/en/1.6/topics/i18n/
>> >
>> > LANGUAGE_CODE = 'en-us'
>> >
>> > TIME_ZONE = 'UTC'
>> >
>> > USE_I18N = True
>> >
>> > USE_L10N = True
>> >
>> > USE_TZ = True
>> >
>> >
>> > # Static files (CSS, JavaScript, Images)
>> > # https://docs.djangoproject.com/en/1.6/howto/static-files/
>> >
>> > STATIC_URL = '/static/'
>> > STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
>> >
>> > LOGIN_URL = 'boardgames_login'
>> > LOGOUT_URL = 'boardgames_logout'
>> > LOGIN_REDIRECT_URL = 'user_home'
>> >
>> > I am new to Django learning.
>> > Please let me know if more details are required.
>> > Regards
>> > Deepanshu
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users...@googlegroups.com.
>> > To post to this group, send email to django...@googlegroups.com.
>> > Visit this group at 

Re: unhashable type: 'dict'

2016-03-15 Thread Deepanshu Sagar
yes, thank you for the prompt reply, I am using 

from django.contrib.auth import views as auth_views

I need to redirect my webpage to "board_games" main page when the user logs 
out. 
can you please direct me to the correct way to do that? 

Thanks in advance. 



On Tuesday, March 15, 2016 at 5:45:07 PM UTC+5:30, luisza14 wrote:

> You are correct, your problem is in logout url , because you need to pass 
> a function not a duct as second parameter.
>
> Are you using django auth views ?
>
>
>
> https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.logout
>
>
> El martes, 15 de marzo de 2016, Deepanshu Sagar  > escribió:
> > Hello,
> > i am getting below error while accessing http://localhost:8000/login/.
> > 
> 
> >
> > Below are the chaining codes.
> > boardgames\urls.py
> > 
> 
> > boardgames\templates\login.html
> > 
> 
> >
> > NOTE: before adding "
> >
> > url(r'^logout/', {'next_page': 'boardgames_home'}, 
> name='boardgames_logout')
> >
> > to boardgames\urls.py. the access was working fine.
> > below is the settings.py
> >
> > """
> > Django settings for boardgames project.
> >
> > For more information on this file, see
> > https://docs.djangoproject.com/en/1.6/topics/settings/
> >
> > For the full list of settings and their values, see
> > https://docs.djangopro ect.com/en/1.6/ref/settings/
> > """
> >
> > # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> > import os
> > BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> >
> >
> > # Quick-start development settings - unsuitable for production
> > # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
> >
> > # SECURITY WARNING: keep the secret key used in production secret!
> > SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'
> >
> > # SECURITY WARNING: don't run with debug turned on in production!
> > DEBUG = True
> >
> >
> > ALLOWED_HOSTS = []
> >
> >
> > # Application definition
> >
> > INSTALLED_APPS = (
> > 'django.contrib.admin',
> > 'django.contrib.auth',
> > 'django.contrib.contenttypes',
> > 'django.contrib.sessions',
> > 'django.contrib.messages',
> > 'django.contrib.staticfiles',
> > 'main',
> > 'tictactoe',
> > )
> >
> > MIDDLEWARE_CLASSES = (
> > 'django.contrib.sessions.middleware.SessionMiddleware',
> > 'django.middleware.common.CommonMiddleware',
> > 'django.middleware.csrf.CsrfViewMiddleware',
> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
> > 'django.contrib.messages.middleware.MessageMiddleware',
> > 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> > )
> >
> > ROOT_URLCONF = 'boardgames.urls'
> >
> > TEMPLATES = [
> > {
> > 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> > 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> > 'APP_DIRS': True,
> > 'OPTIONS': {
> > 'context_processors': [
> > 'django.core.context_processors.request',
> > 'django.template.context_processors.debug',
> > 'django.template.context_processors.request',
> > 'django.contrib.auth.context_processors.auth',
> > 'django.contrib.messages.context_processors.messages',
> > ],
> > },
> > },
> > ]
> >
> >
> > WSGI_APPLICATION = 'boardgames.wsgi.application'
> >
> >
> > # Database
> > # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.sqlite3',
> > 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> > }
> > }
> >
> > # Internationalization
> > # https://docs.djangoproject.com/en/1.6/topics/i18n/
> >
> > LANGUAGE_CODE = 'en-us'
> >
> > TIME_ZONE = 'UTC'
> >
> > USE_I18N = True
> >
> > USE_L10N = True
> >
> > USE_TZ = True
> >
> >
> > # Static files (CSS, JavaScript, Images)
> > # https://docs.djangoproject.com/en/1.6/howto/static-files/
> >
> > STATIC_URL = '/static/'
> > STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
> >
> > LOGIN_URL = 'boardgames_login'
> > LOGOUT_URL = 'boardgames_logout'
> > LOGIN_REDIRECT_URL = 'user_home'
> >
> > I am new to Django learning.
> > Please let me know if more details are required.
> > Regards
> > Deepanshu
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to django-users...@googlegroups.com .
> > To post to this group, send email to django...@googlegroups.com 
> .
> > Visit this group at https://groups.google.com/group/django-users.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/28da63f3-382c-4ff8-b698-79bc0b0d8b49%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> -- 
> "La utopía sirve para caminar" Fernando Birri
>
>
>
>

-- 
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 

Re: Deploying Django via wsgi

2016-03-15 Thread Avraham Serour
unless you are strictly required to use apache I strongly suggest using
nginx and uwsgi to deploy your django application


On Tue, Mar 15, 2016 at 6:01 AM,  wrote:

> Quite new, and trying to deploy first Django site. I keep getting 503
> errors. Here are the particulars, any hints as to what I'm doing wrong
> would be much appreciated! All directories and files are group owned and
> writable by www-data. Ubuntu server, and Apache2.4 server where I have root
> access. The tutorial where I got the howto is located here:
>
> https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04
>
> Thank you!
>
> *File structure/location:*
>
> /home/user/kb_venv/project_name/
> __init__.py
> settings.py
> urls.py
> wsgi.py
> manage.py
> app_name
>
> /home/user/kb_venv/project_name/project_name/
> apache/
> __init__.py
> override.py
> wsgi.py
>
>
> *override.py file contents:*
> from project_name.settings import
> DEBUG = True
> #ALLOWED_HOSTS = ['104.131.154.99'] (no domain name, I'm using IP to
> access the site)
>
> *wsgi.py file contents:*
> #wsgi.py
> import os, sys
> # Calculate the path based on the location of the WSGI script.
> apache_configuration= os.path.dirname(__file__)
> project = os.path.dirname(apache_configuration)
> workspace = os.path.dirname(project)
> sys.path.append(workspace)
> sys.path.append(project)
>
> # Add the path to 3rd party django application and to django itself.
> sys.path.append('/home/smlake/kb_venv')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'project_name.apache.override'
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> *Apache2.4 000-default file:*
> 
>
> WSGIScriptAlias / /home/smlake/kb_venv/project_name/apache/wsgi.py
> 
>   Require all granted
> 
> ServerAdmin parallaxpl...@gmail.com
> DocumentRoot /home/smlake/kb_venv/project_name/project_name
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
> 
>
>
> *Apache error log entry:*
> [Mon Mar 14 23:58:48.413099 2016] [authz_core:error] [pid 8034:tid
> 140480713053952] [client 54.188.195.80:57782] AH01630: client denied by
> server configuration: /home/user/kb_venv/project_name/
>
>
>
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6f6de168-acd2-4d81-8f5e-9e56643878ca%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tK5GRGGKeWkB7Ei51_jrvXGEV%2Bs4omzrLsdJGNfPNUWdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unhashable type: 'dict'

2016-03-15 Thread Luis Zárate
You are correct, your problem is in logout url , because you need to pass a
function not a duct as second parameter.

Are you using django auth views ?


https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.logout


El martes, 15 de marzo de 2016, Deepanshu Sagar 
escribió:
> Hello,
> i am getting below error while accessing http://localhost:8000/login/.
>

>
> Below are the chaining codes.
> boardgames\urls.py
>

> boardgames\templates\login.html
>

>
> NOTE: before adding "
>
> url(r'^logout/', {'next_page': 'boardgames_home'},
name='boardgames_logout')
>
> to boardgames\urls.py. the access was working fine.
> below is the settings.py
>
> """
> Django settings for boardgames project.
>
> For more information on this file, see
> https://docs.djangoproject.com/en/1.6/topics/settings/
>
> For the full list of settings and their values, see
> https://docs.djangopro ect.com/en/1.6/ref/settings/
> """
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'main',
> 'tictactoe',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'boardgames.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.core.context_processors.request',
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
>
> WSGI_APPLICATION = 'boardgames.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> }
> }
>
> # Internationalization
> # https://docs.djangoproject.com/en/1.6/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/1.6/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
>
> LOGIN_URL = 'boardgames_login'
> LOGOUT_URL = 'boardgames_logout'
> LOGIN_REDIRECT_URL = 'user_home'
>
> I am new to Django learning.
> Please let me know if more details are required.
> Regards
> Deepanshu
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/28da63f3-382c-4ff8-b698-79bc0b0d8b49%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyPDxLVpu%2BAwM7z9gmEO5mLj5sNdrMEED0gDhwm3qpigsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Deploying Django via wsgi

2016-03-15 Thread parallaxplace
Quite new, and trying to deploy first Django site. I keep getting 503 
errors. Here are the particulars, any hints as to what I'm doing wrong 
would be much appreciated! All directories and files are group owned and 
writable by www-data. Ubuntu server, and Apache2.4 server where I have root 
access. The tutorial where I got the howto is located here:
https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04

Thank you!

*File structure/location:*

/home/user/kb_venv/project_name/
__init__.py
settings.py
urls.py
wsgi.py
manage.py
app_name

/home/user/kb_venv/project_name/project_name/
apache/
__init__.py
override.py
wsgi.py


*override.py file contents:*
from project_name.settings import
DEBUG = True
#ALLOWED_HOSTS = ['104.131.154.99'] (no domain name, I'm using IP to access 
the site)

*wsgi.py file contents:*
#wsgi.py
import os, sys
# Calculate the path based on the location of the WSGI script.
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append(project)

# Add the path to 3rd party django application and to django itself.
sys.path.append('/home/smlake/kb_venv')
os.environ['DJANGO_SETTINGS_MODULE'] = 'project_name.apache.override'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

*Apache2.4 000-default file:*


WSGIScriptAlias / /home/smlake/kb_venv/project_name/apache/wsgi.py

  Require all granted

ServerAdmin parallaxpl...@gmail.com
DocumentRoot /home/smlake/kb_venv/project_name/project_name

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined




*Apache error log entry:*
[Mon Mar 14 23:58:48.413099 2016] [authz_core:error] [pid 8034:tid 
140480713053952] [client 54.188.195.80:57782] AH01630: client denied by 
server configuration: /home/user/kb_venv/project_name/




-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f6de168-acd2-4d81-8f5e-9e56643878ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


unhashable type: 'dict'

2016-03-15 Thread Deepanshu Sagar
Hello, 

i am getting below error while accessing http://localhost:8000/login/.



Below are the chaining codes.

boardgames\urls.py


boardgames\templates\login.html



NOTE: before adding "

url(r'^logout/', {'next_page': 'boardgames_home'}, name='boardgames_logout')

to boardgames\urls.py. the access was working fine. 

below is the settings.py 

"""
Django settings for boardgames project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangopro ect.com/en/1.6/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True


ALLOWED_HOSTS = []


# Application definition

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

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'boardgames.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.core.context_processors.request',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]


WSGI_APPLICATION = 'boardgames.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)

LOGIN_URL = 'boardgames_login'
LOGOUT_URL = 'boardgames_logout'
LOGIN_REDIRECT_URL = 'user_home'



I am new to Django learning. 

Please let me know if more details are required. 

Regards
Deepanshu

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28da63f3-382c-4ff8-b698-79bc0b0d8b49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need to remove un-used from from Amazon S3

2016-03-15 Thread Naveen Yadav


In a django project need to upload static data to amazon S3, a bit 
searching finds out that django-storage 

 and collectstatic management command can help me out there.

My use-case is the front-end will generate the complied static files (js, 
css). And those files need to be uploaded to S3.

unused file should be removed from s3 before uploading changed files.

Suppose *index.js* created a compiled file index_11.js, which already 
present on S3, after index.js file is changed and compiled file index_22.js 
should 
be uploaded and index_11.jsshould be removed from S3.



Is is possible through the *collectstatic* or otherwise?

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b49c9700-e46c-43c0-ae15-c535d4a010c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.