Re: problem with DJANGO_SETTINGS_MODULE

2016-02-20 Thread James Schneider
> After several days of running my server with no problem I am suddenly
confronted with:
>
> "django.core.exceptions.ImproperlyConfigured: Requested setting
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either
define the environment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings."
>
> Researching the django docs did not help.
>
>  settings.py is in  .../mysite/mysite as per the tutorial. I am using a
virtualenv
>
> Question:s why the change? It was working!
>
> There is no DJANGO_SETTINGS_MODULE environment variable
>
> I've tried (following the documentation)
> set DJANGO_SETTINGS_MODULE=mysite.setting
>
> which results in (very long traceback) ending in
> ImportError: No module named 'mysite
>
> I am running version 1.9, python 3,5. windows 10.
>
> Please guide me.
>

It doesn't look like your settings and/or Django environment are being set
up correctly.

Are you running the dev server, or a production-grade setup like
Apache/mod_wsgi?

Does your site work using the dev server?

Do the file paths in the long traceback look like they follow your
virtualenv path? If not, I would assume that your virtualenv is not being
introduced by the server process.

As to why this issue didn't show up until days later, it's possible that
you are running a production server where things were working, you made a
change, and forgot to restart the server process to pick up the changes
(which broke things). The processes do restart on their own due to many
memory times, so they might randomly notice this issue days down the road.

-James

-- 
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/CA%2Be%2BciVWnuj-Fe_U9o_bOr8_p8KQvYgoxUGN%3DGBK5SAk%3DJ9X%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Hello Everyone !

2016-02-20 Thread Parth Shah
I am new to Frameworks . All I know is Basic Python.
How to get Started Please help !

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


Re: Hello Everyone !

2016-02-20 Thread paul . hermeneutic
On Sat, Feb 20, 2016 at 4:43 AM, Parth Shah  wrote:
> I am new to Frameworks . All I know is Basic Python.
> How to get Started Please help !

Since you found the Django mailing list, I assume you are familiar
with their web site. On the main page there is a link to "Get started
with Django."

https://www.djangoproject.com/start/

Do you have a more specific question?

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


form as filter in admin site

2016-02-20 Thread Luis Zárate
I am trying to insert a filter in the admin site that have 2 autocomplete
inputs so I was thinking to do  passed a form  with a custom filter, but I
only find a list filter documentation.

I solved the problem writing a custom filter, with a little problem with
css, because change list view  has few width space for filter so input
looks terrible.

i needed to search in the django code because i didn't find in
documentation.

I think my solution is generic so I am asking me if django has this
functionally implemented, I didn't find but maybe you know something about.

-- 
"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%2B5VyOkJSdpB_YPeH%3DsW%2BM7qmef-xa-hFQECJxxtbKrPL6b2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


some question

2016-02-20 Thread wang sheng
Hi, guys:
   I am new for django (   also new for web development ) ,  if there are
 one thousand http request to  django server simultaneously ,  will Django
parallel  process these request or not ?

-- 
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/CA%2BmnDnoQOo%2BBSKiKWF8-Puc0vPi%3Ds4N4tJVyQtesbSjFSrtJ%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with DJANGO_SETTINGS_MODULE

2016-02-20 Thread bob gailer

On 2/19/2016 1:25 PM, bob gailer wrote:
After several days of running my server with no problem I am suddenly 
confronted with:


"django.core.exceptions.ImproperlyConfigured: Requested setting 
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must 
either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings."

Red faced embarrassment - I had inadvertently switched from
python manage.py to django-admin runserver

Bob Gailer

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


Not displayed my Images for website, django-admin, VideoJs, MediaElement

2016-02-20 Thread setivolkylany
I do not known - Why.

Example page from website: 
http://eugenelysenkowebsite.pythonanywhere.com/en/contact_me/about_me/

Example from settings
---
import re
from .base import *
DEBUG = False
ALLOWED_HOSTS = ['eugenelysenkowebsite.pythonanywhere.com']
..




Errors
-
GET 
http://eugenelysenkowebsite.pythonanywhere.com/static/app_contact_me/img/about_me_1.e05b5c1fef3b.jpg
 
404 (Not Found)
eugenelysenkowebsite.pythonanywhere.com/:108 GET 
http://eugenelysenkowebsite.pythonanywhere.com/static/app_contact_me/img/about_me_2.dede4a0500ae.jpg
 
404 (Not Found)

-- 
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/d01e8ae5-21cf-4607-9faf-853b511543cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not displayed my Images for website, django-admin, VideoJs, MediaElement

2016-02-20 Thread James Schneider
On Feb 20, 2016 1:58 PM,  wrote:
>
> I do not known - Why.
>
> Example page from website:
http://eugenelysenkowebsite.pythonanywhere.com/en/contact_me/about_me/
>
> Example from settings
> ---
> import re
> from .base import *
> DEBUG = False
> ALLOWED_HOSTS = ['eugenelysenkowebsite.pythonanywhere.com']
>
..
>
>
>
> Errors
> -
> GET
http://eugenelysenkowebsite.pythonanywhere.com/static/app_contact_me/img/about_me_1.e05b5c1fef3b.jpg
404 (Not Found)
> eugenelysenkowebsite.pythonanywhere.com/:108 GET
http://eugenelysenkowebsite.pythonanywhere.com/static/app_contact_me/img/about_me_2.dede4a0500ae.jpg
404 (Not Found)
>

Have you finished the proper setup for serving static files? PythonAnywhere
may have a different process for handling static files, you should check
their documentation. You should also check the Django docs on serving
static files.

https://help.pythonanywhere.com/pages/DjangoStaticFiles/
https://docs.djangoproject.com/en/1.9/howto/static-files/

How are the URL's to the static files being generated?

-James

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


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i have a progress with help anyway i am newbie

i convert my python script(remember the first script on the first page) to 
django script on the view

views.py:

from django.shortcuts import render_to_response
def calc(request):
a = []
NList = []
y=0
nums = request.POST['num']
total_inputs = request.POST['total']
for i in range(total_inputs):
NList.append(int(num) for num in nums.split(','))
for k in NList:
if k is 1:
y = 1
elif (k > 1) and (k < 5):
y = (k - 1) + 2
a.append(y)
return render_to_response('blog/calc.html', {
'a' :a,
})


app/urls:

urlpatterns = [
url(r'^$',views.calc, name='calc'),
]


html form:


  Number of number: 
  Enter a value: 
  



and i take that error


MultiValueDictKeyError at /

"'num'"


   1. 
   
nums = request.POST['num']
   
   

Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the 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/02663377-d462-49eb-900e-a38c954fcee1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i find solution for that error

if i change request to :

if 'nums' in request.POST:
nums = request.POST['nums']
else:
nums = False



now i have else error and i think the code in my html form is wrong (inside 
the form i copy paste {% csrf_token %}) and again nothing

Forbidden (403)

CSRF verification failed. Request aborted
Help

Reason given for failure:

CSRF token missing or incorrect.


In general, this can occur when there is a genuine Cross Site Request 
Forgery, or when Django's CSRF mechanism 
 has not been used 
correctly. For POST forms, you need to ensure:

   - Your browser is accepting cookies.
   - The view function passes a request to the template's render 
   

 
   method.
   - In the template, there is a {% csrf_token %} template tag inside each 
   POST form that targets an internal URL.
   - If you are not using CsrfViewMiddleware, then you must use csrf_protect 
   on any views that use the csrf_token template tag, as well as those that 
   accept the POST data.

You're seeing the help section of this page because you have DEBUG = True 
in your Django settings file. Change that to False, and only the initial 
error message will be displayed. 

You can customize this page using the CSRF_FAILURE_VIEW setting.


Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the 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/75dce0b5-7fe2-4970-aebf-acf3bfc1017f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 10:32 PM, Xristos Xristoou 
wrote:

> i have a progress with help anyway i am newbie
>
> i convert my python script(remember the first script on the first page) to
> django script on the view
>
> views.py:
>
> from django.shortcuts import render_to_response
> def calc(request):
> a = []
> NList = []
> y=0
> nums = request.POST['num']
> total_inputs = request.POST['total']
> for i in range(total_inputs):
> NList.append(int(num) for num in nums.split(','))
> for k in NList:
> if k is 1:
> y = 1
> elif (k > 1) and (k < 5):
> y = (k - 1) + 2
> a.append(y)
> return render_to_response('blog/calc.html', {
> 'a' :a,
> })
>
>
> app/urls:
>
> urlpatterns = [
> url(r'^$',views.calc, name='calc'),
> ]
>
>
> html form:
>
> 
>   Number of number: 
>   Enter a value: 
>   
> 
>
>
> and i take that error
>
>
> MultiValueDictKeyError at /
>
> "'num'"
>
>
>1.
>
> nums = request.POST['num']
>
>
>
You're likely getting this error because request.POST['num'] is empty
(wasn't submitted via the form). With the way that your view is written,
this error will occur if you are using that view to display the initial
blank form. As of now, you can only use that view as the action= target for
the form.

request.POST is a Django QueryDict with keys for each field in the form.

https://docs.djangoproject.com/en/1.9/ref/request-response/#django.http.HttpRequest.POST

When accessing fields in request.POST, usually you use something like
request.POST.get('num') so that an error isn't thrown, and instead returns
None. If a form field can contain multiple values, you would need to call
.get() multiple times in a loop.

https://docs.djangoproject.com/en/1.9/ref/request-response/#django.http.QueryDict.get

Otherwise it seems like you are getting closer.

-James

-- 
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/CA%2Be%2BciUhztnKh5o7wpUNbjov9pm7KNz2473QM_LQ8A05W%2B%3D%3D2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 11:33 PM, Xristos Xristoou 
wrote:

> i find solution for that error
>
> if i change request to :
>
> if 'nums' in request.POST:
> nums = request.POST['nums']
> else:
> nums = False
>
>
>
> now i have else error and i think the code in my html form is wrong
> (inside the form i copy paste {% csrf_token %}) and again nothing
>
> Forbidden (403)
>
> CSRF verification failed. Request aborted
>
Where did you place the {% csrf_token %} in your template? It needs to sit
anywhere in between your  tags. If it is outside of the 
tags, it will have no effect.

You should also look at the source code of the page inside of the browser
and make sure that is a hidden form element named csrf_token with a value
of a random string, to ensure it is being generated properly.

https://docs.djangoproject.com/en/1.9/ref/csrf/#how-to-use-it

-James

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


Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou


place csrf on my code 


{% csrf_token %}
  Number of number: 
  Enter a value: 
  



and the background color from input is a differend and i take that message 

This inspection highlights form elements without required associated label 
(WCAG 
2.0: H44 ) or title 
attribute (WCAG 2.0: H65 
) and provides 
the ability to create a new label or add an attribute.



Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos 
Xristoou έγραψε:
>
> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the 
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the 
> website ?
> the second question i ask because input and output from the function is a 
> dynamic define from the 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/7e76af36-e2c6-49bb-97de-1e1d97e60d31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: some question

2016-02-20 Thread Avraham Serour
Yes and no.

If you deploy your django project using nginx and uwsgi fur example and
multiple users make requests at the same time they will receive answers in
parallel, so yes it will be processed in parallel.

But no, django is not the one handling the parallelism, static requests are
handled by nginx and django may never know that such a request was made.
uwsgi will create a number of workers depending on your configuration that
will worry about the parallelism.

But I wouldn't call it parallel in the pure sense of the computer science
concept, but at least the requests will not wait for one another, they are
not served sequentially.

As for the 1k requests that will depend on your server hardware, deploy
configuration and nature of the requests, but that shouldn't be hard to
achieve.

Good luck
Avraham

On Sat, Feb 20, 2016, 6:40 PM wang sheng  wrote:

> Hi, guys:
>I am new for django (   also new for web development ) ,  if there are
>  one thousand http request to  django server simultaneously ,  will Django
> parallel  process these request or not ?
>
> --
> 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/CA%2BmnDnoQOo%2BBSKiKWF8-Puc0vPi%3Ds4N4tJVyQtesbSjFSrtJ%3DA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 11:50 PM, Xristos Xristoou 
wrote:

> place csrf on my code
>
>
> {% csrf_token %}
>   Number of number: 
>   Enter a value: 
>   
> 
>
>
> and the background color from input is a differend and i take that message
>
> This inspection highlights form elements without required associated label
> (WCAG 2.0: H44 ) or
> title attribute (WCAG 2.0: H65
> ) and provides
> the ability to create a new label or add an attribute.
>
>
> I'm assuming that last line is something from your editor. Your CSRF token
appears to be in the right spot. The only other note I would have without
other information is that your first form input is named "nums", but your
view is looking for "num".

-James

-- 
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/CA%2Be%2BciWbBzrgtXJAWWVzhBdiZbCNms6%3DeuOkAguFwTFg_o_mdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.