Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
see the "{" bracket near options? you didn't close it sir.

On Wed, 22 Mar, 2023, 1:07 am Vairamuthu Puvanachandran, <
vai.pu...@gmail.com> wrote:

> my settings.py is having a problem right now, miss matching of the "(",
> "{" and "["
>
> Can you help me to resolve that?
>
> vairam
>
>  TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': (os.path.join[BASE_DIR, 'templates']),
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> ),
> },
> },
> ]
>
>
> On Tuesday, March 21, 2023 at 11:56:48 a.m. UTC-4 Jeman Kumar wrote:
>
>> hello sir, Did you add the apps in the setting.py file?
>>
>> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
>> vai@gmail.com> wrote:
>>
>>> I am 76 yr old retired Engineer in Canada.
>>>
>>>
>>>
>>> I am new to Python and Django.
>>>
>>>
>>>
>>> I was looking for help and I found your site.
>>>
>>>
>>>
>>> I am stuck now.
>>>
>>>
>>>
>>> I followed the “polls.app” tutorial and had the “Hello welcome .. page
>>> under the project directory “mysite”.
>>>
>>>
>>>
>>> Previously I had two applications in a different project name.
>>>
>>>
>>>
>>> I added one application called “calc” in the project directory “mysite”.
>>>
>>>
>>>
>>> I ran into an error. I attach the “print screen” output.
>>>
>>>
>>>
>>> I spent some time but still I couldn’t solve
>>>
>>>
>>>
>>> I appreciate any help you can provide.
>>>
>>>
>>>
>>> I also wish to be a volunteer.
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>> Vairam
>>>
>>>
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e660d778-4a2f-4aa9-a39e-0c029f0be026n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e660d778-4a2f-4aa9-a39e-0c029f0be026n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALmE1TsBcq51p9zajGGqPLOJPYUDn-8cSut1RLpVGnL4rYDLDw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Vairamuthu Puvanachandran
my settings.py is having a problem right now, miss matching of the "(",  
"{" and "["

Can you help me to resolve that?

vairam

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


On Tuesday, March 21, 2023 at 11:56:48 a.m. UTC-4 Jeman Kumar wrote:

> hello sir, Did you add the apps in the setting.py file?
>
> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
> vai@gmail.com> wrote:
>
>> I am 76 yr old retired Engineer in Canada. 
>>
>>  
>>
>> I am new to Python and Django.
>>
>>  
>>
>> I was looking for help and I found your site.
>>
>>  
>>
>> I am stuck now. 
>>
>>  
>>
>> I followed the “polls.app” tutorial and had the “Hello welcome .. page 
>> under the project directory “mysite”. 
>>
>>  
>>
>> Previously I had two applications in a different project name. 
>>
>>  
>>
>> I added one application called “calc” in the project directory “mysite”.
>>
>>  
>>
>> I ran into an error. I attach the “print screen” output.
>>
>>  
>>
>> I spent some time but still I couldn’t solve
>>
>>  
>>
>> I appreciate any help you can provide.
>>
>>  
>>
>> I also wish to be a volunteer.
>>
>>  
>>
>>  
>>
>> Regards,
>>
>> Vairam 
>>
>>  
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e660d778-4a2f-4aa9-a39e-0c029f0be026n%40googlegroups.com.


Re: Stuck with Django

2023-03-21 Thread yash thadani
Hi Vairam

What exactly you are stuck with?

Regards
Yash

On Tue, Mar 21, 2023 at 9:23 PM Vairamuthu Puvanachandran <
vai.pu...@gmail.com> wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANuKP%3DDTZ4sH3ws5sD-q%2BEUT5PSJALivdYCOuySGjF-%3DJuo8%2Bw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Abdulrahman Abbas
Your attached pictures are not clear

On Tue, Mar 21, 2023, 16:53 Vairamuthu Puvanachandran 
wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGGqo0MM2RXJjN7MbzrNvSW8eX1dQATKmBzEMJH6vx1%3D-uAbGw%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
you have to add apps to "installed apps" list in settings.py

On Tue, 21 Mar, 2023, 9:26 pm Jeman Kumar,  wrote:

> hello sir, Did you add the apps in the setting.py file?
>
> On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
> vai.pu...@gmail.com> wrote:
>
>> I am 76 yr old retired Engineer in Canada.
>>
>>
>>
>> I am new to Python and Django.
>>
>>
>>
>> I was looking for help and I found your site.
>>
>>
>>
>> I am stuck now.
>>
>>
>>
>> I followed the “polls.app” tutorial and had the “Hello welcome .. page
>> under the project directory “mysite”.
>>
>>
>>
>> Previously I had two applications in a different project name.
>>
>>
>>
>> I added one application called “calc” in the project directory “mysite”.
>>
>>
>>
>> I ran into an error. I attach the “print screen” output.
>>
>>
>>
>> I spent some time but still I couldn’t solve
>>
>>
>>
>> I appreciate any help you can provide.
>>
>>
>>
>> I also wish to be a volunteer.
>>
>>
>>
>>
>>
>> Regards,
>>
>> Vairam
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALmE1TtQAOD3V-gTOqt1MYdKDMUQS35v3MfV4ToMcz_AMD%2B%2BKA%40mail.gmail.com.


Re: Stuck with Django

2023-03-21 Thread Jeman Kumar
hello sir, Did you add the apps in the setting.py file?

On Tue, 21 Mar, 2023, 9:23 pm Vairamuthu Puvanachandran, <
vai.pu...@gmail.com> wrote:

> I am 76 yr old retired Engineer in Canada.
>
>
>
> I am new to Python and Django.
>
>
>
> I was looking for help and I found your site.
>
>
>
> I am stuck now.
>
>
>
> I followed the “polls.app” tutorial and had the “Hello welcome .. page
> under the project directory “mysite”.
>
>
>
> Previously I had two applications in a different project name.
>
>
>
> I added one application called “calc” in the project directory “mysite”.
>
>
>
> I ran into an error. I attach the “print screen” output.
>
>
>
> I spent some time but still I couldn’t solve
>
>
>
> I appreciate any help you can provide.
>
>
>
> I also wish to be a volunteer.
>
>
>
>
>
> Regards,
>
> Vairam
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ac733821-bd95-4219-8481-3a435e9febddn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALmE1TvvPL2kmiP6G3e3GmDb3x_NqM-irXY_gvSe6sFBhU6wNg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-15 Thread Chetan Ganji
It seems to me like you are not entering the url name
In place of 'polls:vote' try to enter the name of the url given to that url
For Your Reference
https://docs.djangoproject.com/en/4.1/ref/templates/builtins/#url
I hope it helps you!
Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Wed, Mar 15, 2023 at 1:14 AM Sandip Bhattacharya <
sand...@showmethesource.org> wrote:

> Can you share your urls.py?
>
>
> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
>
> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org
> <https://groups.google.com/d/msgid/django-users/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMKMUjthNav_nSy_%3Dci7mxQ-6OLRaXOzRJ6ZjGjAXap5nuY5Tg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Here.

urls.py

from django.urls import path

from . import views


app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('/', views.DetailView.as_view(), name='detail'),
path('/results/', views.ResultsView.as_view(), name='results'),
path('/vote/', views.vote, name='vote'),
]


On Tue, Mar 14, 2023 at 3:44 PM Sandip Bhattacharya <
sand...@showmethesource.org> wrote:

> Can you share your urls.py?
>
>
> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
>
> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/8mapBVGvyMA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org
> <https://groups.google.com/d/msgid/django-users/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALZgFFcJfRUyB7C-vHFug7BoqD_zhrp9xOccABKBFnLuFTLF_Q%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
This should be your views for vote.


from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse

from .models import Choice, Question
# ...
def vote(request, question_id):
question = get_object_or_404(Question, pk=question_id)
try:
selected_choice = question.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
# Redisplay the question voting form.
return render(request, 'polls/detail.html', {
'question': question,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
# Always return an HttpResponseRedirect after successfully dealing
# with POST data. This prevents data from being posted twice if a
# user hits the Back button.
return HttpResponseRedirect(reverse('polls:results', args=(
question.id,)))

On Tue, Mar 14, 2023, 20:34 Nithin Kumar  wrote:

> question.id or question_id both gave the same result.
> These are the views.
>
> from django.shortcuts import get_object_or_404, render
> from django.http import HttpResponse, Http404, HttpResponseRedirect
> from django.template import loader
> from .models import Choice,Question
> from django.urls import reverse
>
> # Create your views here.
>
> def index(request):
> latest_question_list = Question.objects.order_by('-pub_date')[:5]
> template = loader.get_template('polls/index.html')
> context = {
> 'latest_question_list': latest_question_list,
> }
> return render(request, 'polls/index.html',context)
>
>
> def detail(request, question_id):
> try:
> question = Question.objects.get(pk=question_id)
> except Question.DoesNotExist:
> raise Http404("Question Does not exist")
> return render(request, 'polls/detail.html', {'question':question})
>
>
>
> def results(request, question_id):
> question = get_object_or_404(Question, pk=question_id)
> return render(request, 'polls/results.html', {'question': question})
>
> def vote(request, question_id):
> return HttpResponse("You're voting on question %s." % question_id)
>
>
>
>
>
> On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:
>
>> Let's see your views.
>>
>> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
>> juw...@gmail.com> wrote:
>>
>>> question_id=question.id
>>>
>>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:
>>>
>>>> Hi,
>>>>
>>>> Stuck with this problem
>>>>
>>>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>>>
>>>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)'
>>>> not found. 1 pattern(s) tried: ['polls/>>>
>>>> My detail.html is like this and it is failing at Line 1.
>>>> I checked all solutions online but no luck.
>>>>
>>>> 
>>>> {% csrf_token %}
>>>> 
>>>> {{ question.question_text }}
>>>> {% if error_message %}{{ error_message }}
>>>> {% endif %}
>>>> {% for choice in question.choice_set.all %}
>>>> 
>>>> {{
>>>> choice.choice_text }}
>>>> {% endfor %}
>>>> 
>>>> 
>>>> 
>>>>
>>>> --
>>>> 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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com
>>> <https://groups.google.com/d/

Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Brian Carey
I think you need to check your urls.py.

⁣Get BlueMail for Android ​

On Mar 14, 2023, 1:33 PM, at 1:33 PM, Nithin Kumar  
wrote:
>question.id or question_id both gave the same result.
>These are the views. 
>
>from django.shortcuts import get_object_or_404, render
>from django.http import HttpResponse, Http404, HttpResponseRedirect
>from django.template import loader
>from .models import Choice,Question
>from django.urls import reverse
>
># Create your views here.
>
>def index(request):
>latest_question_list = Question.objects.order_by('-pub_date')[:5]
>template = loader.get_template('polls/index.html') 
>context = {
>'latest_question_list': latest_question_list,
>}
>return render(request, 'polls/index.html',context)
>
>
>def detail(request, question_id):
>try:
>question = Question.objects.get(pk=question_id)
>except Question.DoesNotExist:
>raise Http404("Question Does not exist")
>return render(request, 'polls/detail.html', {'question':question})
>
>
>
>def results(request, question_id):
>question = get_object_or_404(Question, pk=question_id)
>   return render(request, 'polls/results.html', {'question': question})
>
>def vote(request, question_id):
>return HttpResponse("You're voting on question %s." % question_id)
>
>
>
>
>
>On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:
>
>> Let's see your views.
>>
>> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
>> juw...@gmail.com> wrote:
>>
>>> question_id=question.id
>>>
>>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar 
>wrote:
>>>
>>>> Hi,
>>>>
>>>> Stuck with this problem 
>>>>
>>>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>>>
>>>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)'
>not 
>>>> found. 1 pattern(s) tried: ['polls/>>>
>>>> My detail.html is like this and it is failing at Line 1. 
>>>> I checked all solutions online but no luck. 
>>>>
>>>> 
>>>> {% csrf_token %}
>>>> 
>>>> {{ question.question_text }}
>>>> {% if error_message %}{{ error_message }}
>>>> {% endif %}
>>>> {% for choice in question.choice_set.all %}
>>>> 
>>>> {{ 
>>>> choice.choice_text }}
>>>> {% endfor %}
>>>> 
>>>> 
>>>> 
>>>>
>>>> -- 
>>>> 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 view this discussion on the web visit 
>>>>
>https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>
>>>>
><https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>>
>https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com
>
>>>
><https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>
>-- 
>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 view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/1d230ed2-73f0-4609-b53b-e620dff5d302n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21c8dec2-8e46-4885-8522-6eae37dd9ed9%40gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Sandip Bhattacharya
Can you share your urls.py?


> On Mar 14, 2023, at 1:33 AM, Nithin Kumar  wrote:
> 
> Hi,
> 
> Stuck with this problem 
> 
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
> 
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
> found. 1 pattern(s) tried: ['polls/ 
> My detail.html is like this and it is failing at Line 1. 
> I checked all solutions online but no luck. 
> 
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{% 
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{ choice.choice_text 
> }}
> {% endfor %}
> 
> 
> 
> 
> -- 
> 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 
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/A42F210A-ED92-49F6-A647-D57C4C6814B0%40showmethesource.org.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
question.id or question_id both gave the same result.
These are the views. 

from django.shortcuts import get_object_or_404, render
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.template import loader
from .models import Choice,Question
from django.urls import reverse

# Create your views here.

def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
template = loader.get_template('polls/index.html') 
context = {
'latest_question_list': latest_question_list,
}
return render(request, 'polls/index.html',context)


def detail(request, question_id):
try:
question = Question.objects.get(pk=question_id)
except Question.DoesNotExist:
raise Http404("Question Does not exist")
return render(request, 'polls/detail.html', {'question':question})



def results(request, question_id):
question = get_object_or_404(Question, pk=question_id)
return render(request, 'polls/results.html', {'question': question})

def vote(request, question_id):
return HttpResponse("You're voting on question %s." % question_id)





On Tuesday, March 14, 2023 at 1:22:25 PM UTC-4 Prosper Lekia wrote:

> Let's see your views.
>
> On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman <
> juw...@gmail.com> wrote:
>
>> question_id=question.id
>>
>> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:
>>
>>> Hi,
>>>
>>> Stuck with this problem 
>>>
>>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>>
>>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
>>> found. 1 pattern(s) tried: ['polls/>>
>>> My detail.html is like this and it is failing at Line 1. 
>>> I checked all solutions online but no luck. 
>>>
>>> 
>>> {% csrf_token %}
>>> 
>>> {{ question.question_text }}
>>> {% if error_message %}{{ error_message }}
>>> {% endif %}
>>> {% for choice in question.choice_set.all %}
>>> 
>>> {{ 
>>> choice.choice_text }}
>>> {% endfor %}
>>> 
>>> 
>>> 
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1d230ed2-73f0-4609-b53b-e620dff5d302n%40googlegroups.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Prosper Lekia
Let's see your views.

On Tue, Mar 14, 2023, 14:32 Muhammad Juwaini Abdul Rahman 
wrote:

> question_id=question.id
>
> On Tue, 14 Mar 2023 at 21:22, Nithin Kumar 
> wrote:
>
>> Hi,
>>
>> Stuck with this problem
>>
>> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>>
>> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
>> found. 1 pattern(s) tried: ['polls/>
>> My detail.html is like this and it is failing at Line 1.
>> I checked all solutions online but no luck.
>>
>> 
>> {% csrf_token %}
>> 
>> {{ question.question_text }}
>> {% if error_message %}{{ error_message }}{%
>> endif %}
>> {% for choice in question.choice_set.all %}
>> 
>> {{
>> choice.choice_text }}
>> {% endfor %}
>> 
>> 
>> 
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALGeGE3X4o_uE-302%2Bt36q%2B%3DVToch7qfYWDdxuY94bXsUk4FGg%40mail.gmail.com.


Re: Stuck with Django Tutorial Part 4

2023-03-14 Thread Muhammad Juwaini Abdul Rahman
question_id=question.id

On Tue, 14 Mar 2023 at 21:22, Nithin Kumar  wrote:

> Hi,
>
> Stuck with this problem
>
> https://docs.djangoproject.com/en/4.1/intro/tutorial04/
>
> NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not
> found. 1 pattern(s) tried: ['polls/
> My detail.html is like this and it is failing at Line 1.
> I checked all solutions online but no luck.
>
> 
> {% csrf_token %}
> 
> {{ question.question_text }}
> {% if error_message %}{{ error_message }}{%
> endif %}
> {% for choice in question.choice_set.all %}
> 
> {{
> choice.choice_text }}
> {% endfor %}
> 
> 
> 
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKhtoQ1tfqUempakxY7DHy26utEt3QN1iBbLBM78r5neYM3QQ%40mail.gmail.com.


Stuck with Django Tutorial Part 4

2023-03-14 Thread Nithin Kumar
Hi,

Stuck with this problem 

https://docs.djangoproject.com/en/4.1/intro/tutorial04/

NoReverseMatch at /polls/2/Reverse for 'vote' with arguments '(2,)' not 
found. 1 pattern(s) tried: ['polls/
{% csrf_token %}

{{ question.question_text }}
{% if error_message %}{{ error_message }}{% 
endif %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text 
}}
{% endfor %}




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6c40407-64a0-4418-ba9a-39db89b1c1dcn%40googlegroups.com.


Re: stuck in my payment gateway

2022-12-28 Thread 'Kasper Laudrup' via Django users

On 28/12/2022 20.21, Music Fm wrote:
hi guys, so i am building a payment gate way using django but i am stuck 
on how to integrate cards in the views for the form. please i need help




Which kind of help do you think anyone will be able to provide when you 
haven't given any information at all?


If you don't learn how to communicate with other people you'll be stuck 
forever.


Consider start by reading this:

https://www.propublica.org/nerds/how-to-ask-programming-questions

Kind regards,
Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9fc7fb33-7493-a10f-22ed-e720dde47f5e%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


stuck in my payment gateway

2022-12-28 Thread Music Fm
hi guys, so i am building a payment gate way using django but i am stuck on 
how to integrate cards in the views for the form. please i need 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e957e6a2-a616-43bd-86d1-d0a6d93eac4an%40googlegroups.com.


Re: Stuck

2022-03-28 Thread rahul sharma
Cd comand and app name..

On Mon, Mar 28, 2022, 11:57 Samapika Nayak 
wrote:

> you need to configure the media files in settings.py
> MEDIA_URL = "/media/"
> MEDIA_ROOT = BASE_DIR / "media"
> also need to configure it in project level urls.py
>
> if settings.DEBUG:
> urlpatterns += static(settings.MEDIA_URL,
> document_root=settings.MEDIA_ROOT)
>
> On Mon, Mar 28, 2022 at 10:04 AM 'Delvin Alexander' via Django users <
> django-users@googlegroups.com> wrote:
>
>> Hello everyone,
>>
>> I am trying to register a new user by watching the Django tutorial. I
>> have created the new user but upon attempting to log the new user in I get
>> an,
>>
>> *"FileNotFoundError at /login/[Errno 2] No such file or directory:
>> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*
>>
>> But on my visual code it tells me this, "Exception has occurred:
>> ImproperlyConfigured
>>
>>-
>>
>> *Requested setting INSTALLED_APPS, but settings are not configured. You
>> must either define the environment variable DJANGO_SETTINGS_MODULE or call
>> settings.configure() before accessing settings.*
>> * File "C:\Users\delvi\django_project\users\models.py", line 2, in
>>  from django.contrib.auth.models import User"*
>>
>>
>> Here is my model.py file:
>>
>> from django.db import models
>> from django.contrib.auth.models import User
>> from PIL import Image
>> import os
>> from django.core.asgi import get_asgi_application
>>
>> class Profile(models.Model):
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> image = models.ImageField(default='default.jpg',
>> upload_to='profile_pics')
>>
>> def __str__(self):
>> return f'{self.user.username} Profile'
>>
>> def save(self, *args, **kwargs):
>> super(Profile, self).save(*args, **kwargs)
>>
>> img = Image.open(self.image.path)
>> file = open('media')
>>
>> if img.height > 300 or img.width > 300:
>> output_size = (300, 300)
>> img.thumbnail(output_size)
>> img.save(self.image.path)
>> And here is my views.py file for the User folder:
>>
>> from django.shortcuts import render, redirect
>> from django.contrib import messages
>> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
>> from django.contrib.auth.decorators import login_required
>>
>>
>> def register(request):
>> if request.method == 'POST':
>> form = UserRegisterForm(request.POST)
>> if form.is_valid():
>> form.save()
>> username = form.cleaned_data.get('username')
>> messages.success(request, f'Your Account has been created you
>> are now able to log in {username}!')
>> return redirect('login')
>> else:
>> form = UserRegisterForm()
>> return render(request, 'users/register.html', {'form': form})
>>
>> @login_required
>> def profile(request):
>> if request.method == 'POST':
>> u_form = UserUpdateForm(request.POST, instance=request.user)
>> p_form = ProfileUpdateForm(request.POST, request.FILES,
>> instance=request.user.profile)
>> if u_form.is_valid() and p_form.is_valid():
>> u_form.save()
>> p_form.save()
>> messages.success(request, f'Your Account has been updated!')
>> return redirect('profile')
>> else:
>> u_form = UserUpdateForm(instance=request.user)
>> p_form = ProfileUpdateForm(instance=request.user.profile)
>>
>> context = {
>> 'u_form': u_form,
>> 'p_form': p_form,
>> }
>>
>> return render(request, 'users/profile.html', context)
>> *Would anyone know the reason why i am getting two mistakes ?*
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJG1qUKb2Ar9V-YnTUHRBW6CcgkdSOaQR4Tdm8f79_Ajc2V7pw%40mail.gmail.com
> 
> .
>

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

2022-03-28 Thread Kelvin Sajere
You don’t have default.jpg in your media folder. Add jpg image named
default in the media folder.

On Mon, Mar 28, 2022 at 5:34 AM 'Delvin Alexander' via Django users <
django-users@googlegroups.com> wrote:

> Hello everyone,
>
> I am trying to register a new user by watching the Django tutorial. I have
> created the new user but upon attempting to log the new user in I get an,
>
> *"FileNotFoundError at /login/[Errno 2] No such file or directory:
> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*
>
> But on my visual code it tells me this, "Exception has occurred:
> ImproperlyConfigured
>
>-
>
> *Requested setting INSTALLED_APPS, but settings are not configured. You
> must either define the environment variable DJANGO_SETTINGS_MODULE or call
> settings.configure() before accessing settings.*
> * File "C:\Users\delvi\django_project\users\models.py", line 2, in
>  from django.contrib.auth.models import User"*
>
>
> Here is my model.py file:
>
> from django.db import models
> from django.contrib.auth.models import User
> from PIL import Image
> import os
> from django.core.asgi import get_asgi_application
>
> class Profile(models.Model):
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> image = models.ImageField(default='default.jpg',
> upload_to='profile_pics')
>
> def __str__(self):
> return f'{self.user.username} Profile'
>
> def save(self, *args, **kwargs):
> super(Profile, self).save(*args, **kwargs)
>
> img = Image.open(self.image.path)
> file = open('media')
>
> if img.height > 300 or img.width > 300:
> output_size = (300, 300)
> img.thumbnail(output_size)
> img.save(self.image.path)
> And here is my views.py file for the User folder:
>
> from django.shortcuts import render, redirect
> from django.contrib import messages
> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
> from django.contrib.auth.decorators import login_required
>
>
> def register(request):
> if request.method == 'POST':
> form = UserRegisterForm(request.POST)
> if form.is_valid():
> form.save()
> username = form.cleaned_data.get('username')
> messages.success(request, f'Your Account has been created you
> are now able to log in {username}!')
> return redirect('login')
> else:
> form = UserRegisterForm()
> return render(request, 'users/register.html', {'form': form})
>
> @login_required
> def profile(request):
> if request.method == 'POST':
> u_form = UserUpdateForm(request.POST, instance=request.user)
> p_form = ProfileUpdateForm(request.POST, request.FILES,
> instance=request.user.profile)
> if u_form.is_valid() and p_form.is_valid():
> u_form.save()
> p_form.save()
> messages.success(request, f'Your Account has been updated!')
> return redirect('profile')
> else:
> u_form = UserUpdateForm(instance=request.user)
> p_form = ProfileUpdateForm(instance=request.user.profile)
>
> context = {
> 'u_form': u_form,
> 'p_form': p_form,
> }
>
> return render(request, 'users/profile.html', context)
> *Would anyone know the reason why i am getting two mistakes ?*
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com
> 
> .
>
-- 
KeLLs

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADYqDX31ZOjfBJWVkA%2B0ZxZgiFCu5S0PvxM%3DDWVpA9Yc5GbHnA%40mail.gmail.com.


Re: Stuck

2022-03-28 Thread Samapika Nayak
you need to configure the media files in settings.py
MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR / "media"
also need to configure it in project level urls.py

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

On Mon, Mar 28, 2022 at 10:04 AM 'Delvin Alexander' via Django users <
django-users@googlegroups.com> wrote:

> Hello everyone,
>
> I am trying to register a new user by watching the Django tutorial. I have
> created the new user but upon attempting to log the new user in I get an,
>
> *"FileNotFoundError at /login/[Errno 2] No such file or directory:
> 'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*
>
> But on my visual code it tells me this, "Exception has occurred:
> ImproperlyConfigured
>
>-
>
> *Requested setting INSTALLED_APPS, but settings are not configured. You
> must either define the environment variable DJANGO_SETTINGS_MODULE or call
> settings.configure() before accessing settings.*
> * File "C:\Users\delvi\django_project\users\models.py", line 2, in
>  from django.contrib.auth.models import User"*
>
>
> Here is my model.py file:
>
> from django.db import models
> from django.contrib.auth.models import User
> from PIL import Image
> import os
> from django.core.asgi import get_asgi_application
>
> class Profile(models.Model):
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> image = models.ImageField(default='default.jpg',
> upload_to='profile_pics')
>
> def __str__(self):
> return f'{self.user.username} Profile'
>
> def save(self, *args, **kwargs):
> super(Profile, self).save(*args, **kwargs)
>
> img = Image.open(self.image.path)
> file = open('media')
>
> if img.height > 300 or img.width > 300:
> output_size = (300, 300)
> img.thumbnail(output_size)
> img.save(self.image.path)
> And here is my views.py file for the User folder:
>
> from django.shortcuts import render, redirect
> from django.contrib import messages
> from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
> from django.contrib.auth.decorators import login_required
>
>
> def register(request):
> if request.method == 'POST':
> form = UserRegisterForm(request.POST)
> if form.is_valid():
> form.save()
> username = form.cleaned_data.get('username')
> messages.success(request, f'Your Account has been created you
> are now able to log in {username}!')
> return redirect('login')
> else:
> form = UserRegisterForm()
> return render(request, 'users/register.html', {'form': form})
>
> @login_required
> def profile(request):
> if request.method == 'POST':
> u_form = UserUpdateForm(request.POST, instance=request.user)
> p_form = ProfileUpdateForm(request.POST, request.FILES,
> instance=request.user.profile)
> if u_form.is_valid() and p_form.is_valid():
> u_form.save()
> p_form.save()
> messages.success(request, f'Your Account has been updated!')
> return redirect('profile')
> else:
> u_form = UserUpdateForm(instance=request.user)
> p_form = ProfileUpdateForm(instance=request.user.profile)
>
> context = {
> 'u_form': u_form,
> 'p_form': p_form,
> }
>
> return render(request, 'users/profile.html', context)
> *Would anyone know the reason why i am getting two mistakes ?*
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJG1qUKb2Ar9V-YnTUHRBW6CcgkdSOaQR4Tdm8f79_Ajc2V7pw%40mail.gmail.com.


Stuck

2022-03-27 Thread 'Delvin Alexander' via Django users
Hello everyone,

I am trying to register a new user by watching the Django tutorial. I have 
created the new user but upon attempting to log the new user in I get an, 

*"FileNotFoundError at /login/[Errno 2] No such file or directory: 
'C:\\Users\\delvi\\django_project\\media\\default.jpg'"*

But on my visual code it tells me this, "Exception has occurred: 
ImproperlyConfigured

   - 

*Requested setting INSTALLED_APPS, but settings are not configured. You 
must either define the environment variable DJANGO_SETTINGS_MODULE or call 
settings.configure() before accessing settings.*
* File "C:\Users\delvi\django_project\users\models.py", line 2, in  
from django.contrib.auth.models import User"*


Here is my model.py file:

from django.db import models
from django.contrib.auth.models import User
from PIL import Image
import os
from django.core.asgi import get_asgi_application

class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', 
upload_to='profile_pics')

def __str__(self):
return f'{self.user.username} Profile'

def save(self, *args, **kwargs):
super(Profile, self).save(*args, **kwargs)

img = Image.open(self.image.path)
file = open('media')

if img.height > 300 or img.width > 300:
output_size = (300, 300)
img.thumbnail(output_size)
img.save(self.image.path)
And here is my views.py file for the User folder:

from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib.auth.decorators import login_required


def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
form.save()
username = form.cleaned_data.get('username')
messages.success(request, f'Your Account has been created you 
are now able to log in {username}!')
return redirect('login')
else:
form = UserRegisterForm()
return render(request, 'users/register.html', {'form': form})

@login_required
def profile(request):
if request.method == 'POST':
u_form = UserUpdateForm(request.POST, instance=request.user)
p_form = ProfileUpdateForm(request.POST, request.FILES, 
instance=request.user.profile)
if u_form.is_valid() and p_form.is_valid():
u_form.save()
p_form.save()
messages.success(request, f'Your Account has been updated!')
return redirect('profile')
else:
u_form = UserUpdateForm(instance=request.user)
p_form = ProfileUpdateForm(instance=request.user.profile)

context = {
'u_form': u_form,
'p_form': p_form,
}

return render(request, 'users/profile.html', context)
*Would anyone know the reason why i am getting two mistakes ?*


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4caa9f7-3715-4486-9c8c-feca7ad31b2an%40googlegroups.com.


Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-19 Thread Leo guitar girl
I have sent you an invitation

On Wed, Jan 19, 2022 at 9:54 AM Vkash Poudel 
wrote:

> can we connect via email so that i can share my codes regarding Time basis
> OTP Generation and OTP Verification and activate user's account using pyotp.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Wed, Jan 19, 2022 at 1:20 AM Leo guitar girl <
> mansarimtabas...@gmail.com> wrote:
>
>> I have not used any library. I have done manual OTP verification by using
>> Rand library as told in the tutorial.
>>
>> On Tue, Jan 18, 2022 at 9:00 PM Vkash Poudel 
>> wrote:
>>
>>> first of what did you use to generate otp. If you've used pyotp
>>> libraries then you can verify otp in simple step and the documentation is
>>> good in pyotp.
>>>
>>> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl <
>>> mansarimtabas...@gmail.com> wrote:
>>>
 I am following the tutorial from LearnVern.com


 https://www.learnvern.com/python-tutorial-django/project-implementation-part2

 I have followed ditto as taught in the tutorial but the trainer has no
 issue and I have this issue.

 I am sharing the views.py code also

 from django.shortcuts import render
 from .models import *
 from random import randint


 # Create your views here.

 def Index(request):
 return render(request, 'myapp/index.html')


 def SignupPage(request):
 return render(request, 'myapp/signup.html')


 def RegisterUser(request):
 if request.POST['role'] == "Candidate":
 role = request.POST['role']  # Master Table Field
 fname = request.POST['fname']  # Candidate Table Field
 lname = request.POST['lname']  # Candidate Table Field
 email = request.POST['email']  # Master Table Field
 password = request.POST['password']  # Master Table Field
 cpassword = request.POST['cpassword']

 user = UserMaster.objects.filter(email=email)

 if user:
 message = "User already Exist"
 return render(request, "myapp/signup.html", {'msg': message})
 else:
 if password == cpassword:
 otp = randint(10, 99)
 newuser = UserMaster.objects.create(role=role, otp=otp, 
 email=email, password=password)
 newcand = Candidate.objects.create(user_id=newuser, 
 firstname=fname, lastname=lname)
 return render(request, "myapp/otpverify.html", {'email': 
 email})
 else:
 print("Company Registration")


 def OTPpage(request):
 return render(request, "myapp/otpverify.html")


 def OTPverify(request):
 if request.method == 'POST':
 email = request.POST['email']
 otp = request.POST['otp']

 user = UserMaster.objects.get(email=email)

 if user:
 if user.otp == otp:
 message = "OTP Verified Successfully!"
 return render(request, "myapp/login.html", {'msg': 
 message})
 else:
 message = "OTP is incorrect"
 return render(request, "myapp/otpverify.html", {'msg': 
 message})
 else:
 return render(request, "myapp/signup.html")


 On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
 wrote:

> On 18/01/2022 04.31, Leo guitar girl wrote:
> > Oh, I apologize. I had pasted the error code here don't know why it
> was
> > not sent.
> > Actually, I am trying to create a job portal by seeing a tutorial.
> Now I
> > am at the step of verifying OTP. OTP is generated successfully in
> the
> > database. But when I enter it to the textbox and submit, it shows
> this error
> >
>
> Which tutorial are you following?
>
> What's in the views.py file that is causing the error?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe
> .
> To unsubscribe from this group and all 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-19 Thread Leo guitar girl
yeah sure

On Wed, Jan 19, 2022 at 9:54 AM Vkash Poudel 
wrote:

> can we connect via email so that i can share my codes regarding Time basis
> OTP Generation and OTP Verification and activate user's account using pyotp.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Wed, Jan 19, 2022 at 1:20 AM Leo guitar girl <
> mansarimtabas...@gmail.com> wrote:
>
>> I have not used any library. I have done manual OTP verification by using
>> Rand library as told in the tutorial.
>>
>> On Tue, Jan 18, 2022 at 9:00 PM Vkash Poudel 
>> wrote:
>>
>>> first of what did you use to generate otp. If you've used pyotp
>>> libraries then you can verify otp in simple step and the documentation is
>>> good in pyotp.
>>>
>>> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl <
>>> mansarimtabas...@gmail.com> wrote:
>>>
 I am following the tutorial from LearnVern.com


 https://www.learnvern.com/python-tutorial-django/project-implementation-part2

 I have followed ditto as taught in the tutorial but the trainer has no
 issue and I have this issue.

 I am sharing the views.py code also

 from django.shortcuts import render
 from .models import *
 from random import randint


 # Create your views here.

 def Index(request):
 return render(request, 'myapp/index.html')


 def SignupPage(request):
 return render(request, 'myapp/signup.html')


 def RegisterUser(request):
 if request.POST['role'] == "Candidate":
 role = request.POST['role']  # Master Table Field
 fname = request.POST['fname']  # Candidate Table Field
 lname = request.POST['lname']  # Candidate Table Field
 email = request.POST['email']  # Master Table Field
 password = request.POST['password']  # Master Table Field
 cpassword = request.POST['cpassword']

 user = UserMaster.objects.filter(email=email)

 if user:
 message = "User already Exist"
 return render(request, "myapp/signup.html", {'msg': message})
 else:
 if password == cpassword:
 otp = randint(10, 99)
 newuser = UserMaster.objects.create(role=role, otp=otp, 
 email=email, password=password)
 newcand = Candidate.objects.create(user_id=newuser, 
 firstname=fname, lastname=lname)
 return render(request, "myapp/otpverify.html", {'email': 
 email})
 else:
 print("Company Registration")


 def OTPpage(request):
 return render(request, "myapp/otpverify.html")


 def OTPverify(request):
 if request.method == 'POST':
 email = request.POST['email']
 otp = request.POST['otp']

 user = UserMaster.objects.get(email=email)

 if user:
 if user.otp == otp:
 message = "OTP Verified Successfully!"
 return render(request, "myapp/login.html", {'msg': 
 message})
 else:
 message = "OTP is incorrect"
 return render(request, "myapp/otpverify.html", {'msg': 
 message})
 else:
 return render(request, "myapp/signup.html")


 On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
 wrote:

> On 18/01/2022 04.31, Leo guitar girl wrote:
> > Oh, I apologize. I had pasted the error code here don't know why it
> was
> > not sent.
> > Actually, I am trying to create a job portal by seeing a tutorial.
> Now I
> > am at the step of verifying OTP. OTP is generated successfully in
> the
> > database. But when I enter it to the textbox and submit, it shows
> this error
> >
>
> Which tutorial are you following?
>
> What's in the views.py file that is causing the error?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Vkash Poudel
can we connect via email so that i can share my codes regarding Time basis
OTP Generation and OTP Verification and activate user's account using pyotp.






































































































































































































































































































































On Wed, Jan 19, 2022 at 1:20 AM Leo guitar girl 
wrote:

> I have not used any library. I have done manual OTP verification by using
> Rand library as told in the tutorial.
>
> On Tue, Jan 18, 2022 at 9:00 PM Vkash Poudel 
> wrote:
>
>> first of what did you use to generate otp. If you've used pyotp libraries
>> then you can verify otp in simple step and the documentation is good in
>> pyotp.
>>
>> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl <
>> mansarimtabas...@gmail.com> wrote:
>>
>>> I am following the tutorial from LearnVern.com
>>>
>>>
>>> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>>>
>>> I have followed ditto as taught in the tutorial but the trainer has no
>>> issue and I have this issue.
>>>
>>> I am sharing the views.py code also
>>>
>>> from django.shortcuts import render
>>> from .models import *
>>> from random import randint
>>>
>>>
>>> # Create your views here.
>>>
>>> def Index(request):
>>> return render(request, 'myapp/index.html')
>>>
>>>
>>> def SignupPage(request):
>>> return render(request, 'myapp/signup.html')
>>>
>>>
>>> def RegisterUser(request):
>>> if request.POST['role'] == "Candidate":
>>> role = request.POST['role']  # Master Table Field
>>> fname = request.POST['fname']  # Candidate Table Field
>>> lname = request.POST['lname']  # Candidate Table Field
>>> email = request.POST['email']  # Master Table Field
>>> password = request.POST['password']  # Master Table Field
>>> cpassword = request.POST['cpassword']
>>>
>>> user = UserMaster.objects.filter(email=email)
>>>
>>> if user:
>>> message = "User already Exist"
>>> return render(request, "myapp/signup.html", {'msg': message})
>>> else:
>>> if password == cpassword:
>>> otp = randint(10, 99)
>>> newuser = UserMaster.objects.create(role=role, otp=otp, 
>>> email=email, password=password)
>>> newcand = Candidate.objects.create(user_id=newuser, 
>>> firstname=fname, lastname=lname)
>>> return render(request, "myapp/otpverify.html", {'email': 
>>> email})
>>> else:
>>> print("Company Registration")
>>>
>>>
>>> def OTPpage(request):
>>> return render(request, "myapp/otpverify.html")
>>>
>>>
>>> def OTPverify(request):
>>> if request.method == 'POST':
>>> email = request.POST['email']
>>> otp = request.POST['otp']
>>>
>>> user = UserMaster.objects.get(email=email)
>>>
>>> if user:
>>> if user.otp == otp:
>>> message = "OTP Verified Successfully!"
>>> return render(request, "myapp/login.html", {'msg': message})
>>> else:
>>> message = "OTP is incorrect"
>>> return render(request, "myapp/otpverify.html", {'msg': 
>>> message})
>>> else:
>>> return render(request, "myapp/signup.html")
>>>
>>>
>>> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
>>> wrote:
>>>
 On 18/01/2022 04.31, Leo guitar girl wrote:
 > Oh, I apologize. I had pasted the error code here don't know why it
 was
 > not sent.
 > Actually, I am trying to create a job portal by seeing a tutorial.
 Now I
 > am at the step of verifying OTP. OTP is generated successfully in the
 > database. But when I enter it to the textbox and submit, it shows
 this error
 >

 Which tutorial are you following?

 What's in the views.py file that is causing the error?

 Kind regards,

 Kasper Laudrup

 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Django users" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
 .

>>> --
>>> 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 view this discussion on the web visit
>>> 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Leo guitar girl
I have not used any library. I have done manual OTP verification by using
Rand library as told in the tutorial.

On Tue, Jan 18, 2022 at 9:00 PM Vkash Poudel 
wrote:

> first of what did you use to generate otp. If you've used pyotp libraries
> then you can verify otp in simple step and the documentation is good in
> pyotp.
>
> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl <
> mansarimtabas...@gmail.com> wrote:
>
>> I am following the tutorial from LearnVern.com
>>
>>
>> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>>
>> I have followed ditto as taught in the tutorial but the trainer has no
>> issue and I have this issue.
>>
>> I am sharing the views.py code also
>>
>> from django.shortcuts import render
>> from .models import *
>> from random import randint
>>
>>
>> # Create your views here.
>>
>> def Index(request):
>> return render(request, 'myapp/index.html')
>>
>>
>> def SignupPage(request):
>> return render(request, 'myapp/signup.html')
>>
>>
>> def RegisterUser(request):
>> if request.POST['role'] == "Candidate":
>> role = request.POST['role']  # Master Table Field
>> fname = request.POST['fname']  # Candidate Table Field
>> lname = request.POST['lname']  # Candidate Table Field
>> email = request.POST['email']  # Master Table Field
>> password = request.POST['password']  # Master Table Field
>> cpassword = request.POST['cpassword']
>>
>> user = UserMaster.objects.filter(email=email)
>>
>> if user:
>> message = "User already Exist"
>> return render(request, "myapp/signup.html", {'msg': message})
>> else:
>> if password == cpassword:
>> otp = randint(10, 99)
>> newuser = UserMaster.objects.create(role=role, otp=otp, 
>> email=email, password=password)
>> newcand = Candidate.objects.create(user_id=newuser, 
>> firstname=fname, lastname=lname)
>> return render(request, "myapp/otpverify.html", {'email': 
>> email})
>> else:
>> print("Company Registration")
>>
>>
>> def OTPpage(request):
>> return render(request, "myapp/otpverify.html")
>>
>>
>> def OTPverify(request):
>> if request.method == 'POST':
>> email = request.POST['email']
>> otp = request.POST['otp']
>>
>> user = UserMaster.objects.get(email=email)
>>
>> if user:
>> if user.otp == otp:
>> message = "OTP Verified Successfully!"
>> return render(request, "myapp/login.html", {'msg': message})
>> else:
>> message = "OTP is incorrect"
>> return render(request, "myapp/otpverify.html", {'msg': 
>> message})
>> else:
>> return render(request, "myapp/signup.html")
>>
>>
>> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
>> wrote:
>>
>>> On 18/01/2022 04.31, Leo guitar girl wrote:
>>> > Oh, I apologize. I had pasted the error code here don't know why it
>>> was
>>> > not sent.
>>> > Actually, I am trying to create a job portal by seeing a tutorial. Now
>>> I
>>> > am at the step of verifying OTP. OTP is generated successfully in the
>>> > database. But when I enter it to the textbox and submit, it shows
>>> this error
>>> >
>>>
>>> Which tutorial are you following?
>>>
>>> What's in the views.py file that is causing the error?
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Best Regards,
> Bikash Poudel
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Leo guitar girl
I have changed the code as you suggested.

def OTPverify(request):
if request.method == 'POST':
email = request.POST.*get*['email']
otp = request.POST.*get*['otp']


But now it gives another error,


[image: image.png]


On Tue, Jan 18, 2022 at 10:10 PM Bernard Mallala 
wrote:

>
> In your model, be sure to address defaults and required values such that
> something is passed or be user to validate.
>
> Replace
> request.POST['']
>
> With
> request.POST.get('')
>
> For example request.POST['otp']
> TO
> request.POST.get['otp']
>
>
>
> On Tuesday, January 18, 2022 at 9:00:41 AM UTC-7 bikash...@gmail.com
> wrote:
>
>> first of what did you use to generate otp. If you've used pyotp libraries
>> then you can verify otp in simple step and the documentation is good in
>> pyotp.
>>
>> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl 
>> wrote:
>>
>>> I am following the tutorial from LearnVern.com
>>>
>>>
>>> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>>>
>>> I have followed ditto as taught in the tutorial but the trainer has no
>>> issue and I have this issue.
>>>
>>> I am sharing the views.py code also
>>>
>>> from django.shortcuts import render
>>> from .models import *
>>> from random import randint
>>>
>>>
>>> # Create your views here.
>>>
>>> def Index(request):
>>> return render(request, 'myapp/index.html')
>>>
>>>
>>> def SignupPage(request):
>>> return render(request, 'myapp/signup.html')
>>>
>>>
>>> def RegisterUser(request):
>>> if request.POST['role'] == "Candidate":
>>> role = request.POST['role']  # Master Table Field
>>> fname = request.POST['fname']  # Candidate Table Field
>>> lname = request.POST['lname']  # Candidate Table Field
>>> email = request.POST['email']  # Master Table Field
>>> password = request.POST['password']  # Master Table Field
>>> cpassword = request.POST['cpassword']
>>>
>>> user = UserMaster.objects.filter(email=email)
>>>
>>> if user:
>>> message = "User already Exist"
>>> return render(request, "myapp/signup.html", {'msg': message})
>>> else:
>>> if password == cpassword:
>>> otp = randint(10, 99)
>>> newuser = UserMaster.objects.create(role=role, otp=otp, 
>>> email=email, password=password)
>>> newcand = Candidate.objects.create(user_id=newuser, 
>>> firstname=fname, lastname=lname)
>>> return render(request, "myapp/otpverify.html", {'email': 
>>> email})
>>> else:
>>> print("Company Registration")
>>>
>>>
>>> def OTPpage(request):
>>> return render(request, "myapp/otpverify.html")
>>>
>>>
>>> def OTPverify(request):
>>> if request.method == 'POST':
>>> email = request.POST['email']
>>> otp = request.POST['otp']
>>>
>>> user = UserMaster.objects.get(email=email)
>>>
>>> if user:
>>> if user.otp == otp:
>>> message = "OTP Verified Successfully!"
>>> return render(request, "myapp/login.html", {'msg': message})
>>> else:
>>> message = "OTP is incorrect"
>>> return render(request, "myapp/otpverify.html", {'msg': 
>>> message})
>>> else:
>>> return render(request, "myapp/signup.html")
>>>
>>>
>>> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
>>> wrote:
>>>
 On 18/01/2022 04.31, Leo guitar girl wrote:
 > Oh, I apologize. I had pasted the error code here don't know why it
 was
 > not sent.
 > Actually, I am trying to create a job portal by seeing a tutorial.
 Now I
 > am at the step of verifying OTP. OTP is generated successfully in the
 > database. But when I enter it to the textbox and submit, it shows
 this error
 >

 Which tutorial are you following?

 What's in the views.py file that is causing the error?

 Kind regards,

 Kasper Laudrup

 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Django users" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 django-users...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
 .

>>> --
>>>
>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com
>>> 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Jasur Suyunov
Hello my friend

Sesh, 18-yan, 2022, 7:50 TK Leo guitar girl :

> I am following the tutorial from LearnVern.com
>
>
> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>
> I have followed ditto as taught in the tutorial but the trainer has no
> issue and I have this issue.
>
> I am sharing the views.py code also
>
> from django.shortcuts import render
> from .models import *
> from random import randint
>
>
> # Create your views here.
>
> def Index(request):
> return render(request, 'myapp/index.html')
>
>
> def SignupPage(request):
> return render(request, 'myapp/signup.html')
>
>
> def RegisterUser(request):
> if request.POST['role'] == "Candidate":
> role = request.POST['role']  # Master Table Field
> fname = request.POST['fname']  # Candidate Table Field
> lname = request.POST['lname']  # Candidate Table Field
> email = request.POST['email']  # Master Table Field
> password = request.POST['password']  # Master Table Field
> cpassword = request.POST['cpassword']
>
> user = UserMaster.objects.filter(email=email)
>
> if user:
> message = "User already Exist"
> return render(request, "myapp/signup.html", {'msg': message})
> else:
> if password == cpassword:
> otp = randint(10, 99)
> newuser = UserMaster.objects.create(role=role, otp=otp, 
> email=email, password=password)
> newcand = Candidate.objects.create(user_id=newuser, 
> firstname=fname, lastname=lname)
> return render(request, "myapp/otpverify.html", {'email': 
> email})
> else:
> print("Company Registration")
>
>
> def OTPpage(request):
> return render(request, "myapp/otpverify.html")
>
>
> def OTPverify(request):
> if request.method == 'POST':
> email = request.POST['email']
> otp = request.POST['otp']
>
> user = UserMaster.objects.get(email=email)
>
> if user:
> if user.otp == otp:
> message = "OTP Verified Successfully!"
> return render(request, "myapp/login.html", {'msg': message})
> else:
> message = "OTP is incorrect"
> return render(request, "myapp/otpverify.html", {'msg': 
> message})
> else:
> return render(request, "myapp/signup.html")
>
>
> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
> wrote:
>
>> On 18/01/2022 04.31, Leo guitar girl wrote:
>> > Oh, I apologize. I had pasted the error code here don't know why it was
>> > not sent.
>> > Actually, I am trying to create a job portal by seeing a tutorial. Now
>> I
>> > am at the step of verifying OTP. OTP is generated successfully in the
>> > database. But when I enter it to the textbox and submit, it shows
>> this error
>> >
>>
>> Which tutorial are you following?
>>
>> What's in the views.py file that is causing the error?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGCNaHq%2B7u97EmsxRuMm0cviQj%3DmQFgp9cLSO398Q2hfZSb44A%40mail.gmail.com.


Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Abubakar Siddique
Hi,

Hope you are well

Did you successfully find the bug or not


here is my whatsapp number
You can contact here
923158090326

Thanks

On Tue, Jan 18, 2022 at 8:32 AM Leo guitar girl 
wrote:

> Oh, I apologize. I had pasted the error code here don't know why it was
> not sent.
> Actually, I am trying to create a job portal by seeing a tutorial. Now I
> am at the step of verifying OTP. OTP is generated successfully in the
> database. But when I enter it to the textbox and submit, it shows this error
>
> [image: image.png]
>
> *Please Note: I am gett*ing the submitted email from the database and
> showing it at the OTP verify page in a read-only field.
>
> Here is the Copy Paste view also of the error message
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/otp/
>
> Django Version: 4.0.1
> Python Version: 3.9.9
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'myapp']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  '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']
>
>
>
> Traceback (most recent call last):
>   File
> "C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py",
> line 83, in __getitem__
> list_ = super().__getitem__(key)
>
> During handling of the above exception ('email'), another exception
> occurred:
>   File
> "C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\core\handlers\exception.py",
> line 47, in inner
> response = get_response(request)
>   File
> "C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\core\handlers\base.py",
> line 181, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "C:\Users\jarry\PycharmProjects\JobPortal\myapp\views.py", line 46,
> in OTPverify
> email = request.POST['email']
>   File
> "C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py",
> line 85, in __getitem__
> raise MultiValueDictKeyError(key)
>
> Exception Type: MultiValueDictKeyError at /otp/
> Exception Value: 'email'
>
> *Thank You for your support. *
>
> On Mon, Jan 17, 2022 at 1:15 AM Kasper Laudrup 
> wrote:
>
>> On 16/01/2022 11.03, Leo guitar girl wrote:
>> >
>> > *This is the error I am getting at OTP verification step. Please guide
>> > me where I am wrong. *
>> > *
>>
>> No one here would have any idea what "OTP verification step" you are
>> talking about.
>>
>> You haven't written anything about what you are trying to achieve or
>> shared any relevant code so it's close to impossible for anyone to help
>> you.
>>
>> So your first step would be to learn how to ask questions in general.
>> Consider reading something like this:
>>
>> http://www.catb.org/~esr/faqs/smart-questions.html
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/60ef1f71-85b3-0fad-d9b8-ad48139fb01e%40stacktrace.dk
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN6g9JZ26XSF%3DtQp6%2BXrwx1Av0JV%2BJsUsfkga1mnFtiBumUu8A%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Bernard Mallala

In your model, be sure to address defaults and required values such that 
something is passed or be user to validate.

Replace 
request.POST['']

With
request.POST.get('')

For example request.POST['otp'] 
TO 
request.POST.get['otp'] 



On Tuesday, January 18, 2022 at 9:00:41 AM UTC-7 bikash...@gmail.com wrote:

> first of what did you use to generate otp. If you've used pyotp libraries 
> then you can verify otp in simple step and the documentation is good in 
> pyotp.
>
> On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl  
> wrote:
>
>> I am following the tutorial from LearnVern.com 
>>
>>
>> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>>
>> I have followed ditto as taught in the tutorial but the trainer has no 
>> issue and I have this issue. 
>>
>> I am sharing the views.py code also 
>>
>> from django.shortcuts import render
>> from .models import *
>> from random import randint
>>
>>
>> # Create your views here.
>>
>> def Index(request):
>> return render(request, 'myapp/index.html')
>>
>>
>> def SignupPage(request):
>> return render(request, 'myapp/signup.html')
>>
>>
>> def RegisterUser(request):
>> if request.POST['role'] == "Candidate":
>> role = request.POST['role']  # Master Table Field
>> fname = request.POST['fname']  # Candidate Table Field
>> lname = request.POST['lname']  # Candidate Table Field
>> email = request.POST['email']  # Master Table Field
>> password = request.POST['password']  # Master Table Field
>> cpassword = request.POST['cpassword']
>>
>> user = UserMaster.objects.filter(email=email)
>>
>> if user:
>> message = "User already Exist"
>> return render(request, "myapp/signup.html", {'msg': message})
>> else:
>> if password == cpassword:
>> otp = randint(10, 99)
>> newuser = UserMaster.objects.create(role=role, otp=otp, 
>> email=email, password=password)
>> newcand = Candidate.objects.create(user_id=newuser, 
>> firstname=fname, lastname=lname)
>> return render(request, "myapp/otpverify.html", {'email': 
>> email})
>> else:
>> print("Company Registration")
>>
>>
>> def OTPpage(request):
>> return render(request, "myapp/otpverify.html")
>>
>>
>> def OTPverify(request):
>> if request.method == 'POST':
>> email = request.POST['email']
>> otp = request.POST['otp']
>>
>> user = UserMaster.objects.get(email=email)
>>
>> if user:
>> if user.otp == otp:
>> message = "OTP Verified Successfully!"
>> return render(request, "myapp/login.html", {'msg': message})
>> else:
>> message = "OTP is incorrect"
>> return render(request, "myapp/otpverify.html", {'msg': 
>> message})
>> else:
>> return render(request, "myapp/signup.html")
>>
>>
>> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup  
>> wrote:
>>
>>> On 18/01/2022 04.31, Leo guitar girl wrote:
>>> > Oh, I apologize. I had pasted the error code here don't know why it 
>>> was 
>>> > not sent.
>>> > Actually, I am trying to create a job portal by seeing a tutorial. Now 
>>> I 
>>> > am at the step of verifying OTP. OTP is generated successfully in the 
>>> > database. But when I enter it to the textbox and submit, it shows 
>>> this error
>>> > 
>>>
>>> Which tutorial are you following?
>>>
>>> What's in the views.py file that is causing the error?
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
>>> .
>>>
>> -- 
>>
> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> Best Regards,
> Bikash Poudel
>

-- 
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 view this discussion on the 

Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Vkash Poudel
first of what did you use to generate otp. If you've used pyotp libraries
then you can verify otp in simple step and the documentation is good in
pyotp.

On Tue, Jan 18, 2022 at 8:35 PM Leo guitar girl 
wrote:

> I am following the tutorial from LearnVern.com
>
>
> https://www.learnvern.com/python-tutorial-django/project-implementation-part2
>
> I have followed ditto as taught in the tutorial but the trainer has no
> issue and I have this issue.
>
> I am sharing the views.py code also
>
> from django.shortcuts import render
> from .models import *
> from random import randint
>
>
> # Create your views here.
>
> def Index(request):
> return render(request, 'myapp/index.html')
>
>
> def SignupPage(request):
> return render(request, 'myapp/signup.html')
>
>
> def RegisterUser(request):
> if request.POST['role'] == "Candidate":
> role = request.POST['role']  # Master Table Field
> fname = request.POST['fname']  # Candidate Table Field
> lname = request.POST['lname']  # Candidate Table Field
> email = request.POST['email']  # Master Table Field
> password = request.POST['password']  # Master Table Field
> cpassword = request.POST['cpassword']
>
> user = UserMaster.objects.filter(email=email)
>
> if user:
> message = "User already Exist"
> return render(request, "myapp/signup.html", {'msg': message})
> else:
> if password == cpassword:
> otp = randint(10, 99)
> newuser = UserMaster.objects.create(role=role, otp=otp, 
> email=email, password=password)
> newcand = Candidate.objects.create(user_id=newuser, 
> firstname=fname, lastname=lname)
> return render(request, "myapp/otpverify.html", {'email': 
> email})
> else:
> print("Company Registration")
>
>
> def OTPpage(request):
> return render(request, "myapp/otpverify.html")
>
>
> def OTPverify(request):
> if request.method == 'POST':
> email = request.POST['email']
> otp = request.POST['otp']
>
> user = UserMaster.objects.get(email=email)
>
> if user:
> if user.otp == otp:
> message = "OTP Verified Successfully!"
> return render(request, "myapp/login.html", {'msg': message})
> else:
> message = "OTP is incorrect"
> return render(request, "myapp/otpverify.html", {'msg': 
> message})
> else:
> return render(request, "myapp/signup.html")
>
>
> On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
> wrote:
>
>> On 18/01/2022 04.31, Leo guitar girl wrote:
>> > Oh, I apologize. I had pasted the error code here don't know why it was
>> > not sent.
>> > Actually, I am trying to create a job portal by seeing a tutorial. Now
>> I
>> > am at the step of verifying OTP. OTP is generated successfully in the
>> > database. But when I enter it to the textbox and submit, it shows
>> this error
>> >
>>
>> Which tutorial are you following?
>>
>> What's in the views.py file that is causing the error?
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com
> 
> .
>


-- 
Best Regards,
Bikash Poudel

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE0sOGxjPxmRpd2CcucoeSTFuAqa1U_CBU2N7RTxZ7GLH-kTLA%40mail.gmail.com.


Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Leo guitar girl
I am following the tutorial from LearnVern.com

https://www.learnvern.com/python-tutorial-django/project-implementation-part2

I have followed ditto as taught in the tutorial but the trainer has no
issue and I have this issue.

I am sharing the views.py code also

from django.shortcuts import render
from .models import *
from random import randint


# Create your views here.

def Index(request):
return render(request, 'myapp/index.html')


def SignupPage(request):
return render(request, 'myapp/signup.html')


def RegisterUser(request):
if request.POST['role'] == "Candidate":
role = request.POST['role']  # Master Table Field
fname = request.POST['fname']  # Candidate Table Field
lname = request.POST['lname']  # Candidate Table Field
email = request.POST['email']  # Master Table Field
password = request.POST['password']  # Master Table Field
cpassword = request.POST['cpassword']

user = UserMaster.objects.filter(email=email)

if user:
message = "User already Exist"
return render(request, "myapp/signup.html", {'msg': message})
else:
if password == cpassword:
otp = randint(10, 99)
newuser = UserMaster.objects.create(role=role,
otp=otp, email=email, password=password)
newcand = Candidate.objects.create(user_id=newuser,
firstname=fname, lastname=lname)
return render(request, "myapp/otpverify.html", {'email': email})
else:
print("Company Registration")


def OTPpage(request):
return render(request, "myapp/otpverify.html")


def OTPverify(request):
if request.method == 'POST':
email = request.POST['email']
otp = request.POST['otp']

user = UserMaster.objects.get(email=email)

if user:
if user.otp == otp:
message = "OTP Verified Successfully!"
return render(request, "myapp/login.html", {'msg': message})
else:
message = "OTP is incorrect"
return render(request, "myapp/otpverify.html", {'msg': message})
else:
return render(request, "myapp/signup.html")


On Tue, Jan 18, 2022 at 3:21 PM Kasper Laudrup 
wrote:

> On 18/01/2022 04.31, Leo guitar girl wrote:
> > Oh, I apologize. I had pasted the error code here don't know why it was
> > not sent.
> > Actually, I am trying to create a job portal by seeing a tutorial. Now I
> > am at the step of verifying OTP. OTP is generated successfully in the
> > database. But when I enter it to the textbox and submit, it shows
> this error
> >
>
> Which tutorial are you following?
>
> What's in the views.py file that is causing the error?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/P1-fQLDoncc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN6g9JZG-4VbKFDOJtWg3rMWY4i23Gh%2Bga3PfKxYBmVMR38ayw%40mail.gmail.com.


Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-18 Thread Kasper Laudrup

On 18/01/2022 04.31, Leo guitar girl wrote:
Oh, I apologize. I had pasted the error code here don't know why it was 
not sent.
Actually, I am trying to create a job portal by seeing a tutorial. Now I 
am at the step of verifying OTP. OTP is generated successfully in the 
database. But when I enter it to the textbox and submit, it shows this error




Which tutorial are you following?

What's in the views.py file that is causing the error?

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df6cb70c-d5a5-1f12-a832-ac5b46901fc4%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-16 Thread Kasper Laudrup

On 16/01/2022 11.03, Leo guitar girl wrote:


*This is the error I am getting at OTP verification step. Please guide 
me where I am wrong. *

*


No one here would have any idea what "OTP verification step" you are 
talking about.


You haven't written anything about what you are trying to achieve or 
shared any relevant code so it's close to impossible for anyone to help you.


So your first step would be to learn how to ask questions in general. 
Consider reading something like this:


http://www.catb.org/~esr/faqs/smart-questions.html

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60ef1f71-85b3-0fad-d9b8-ad48139fb01e%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Hi, I am learning Django, I am stuck at one place and can't over come after many days

2022-01-16 Thread Leo guitar girl

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/otp/

Django Version: 4.0.1
Python Version: 3.9.9
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'myapp']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 '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']



Traceback (most recent call last):
  File 
"C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py",
 
line 83, in __getitem__
list_ = super().__getitem__(key)

During handling of the above exception ('email'), another exception 
occurred:
  File 
"C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\core\handlers\exception.py",
 
line 47, in inner
response = get_response(request)
  File 
"C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\core\handlers\base.py",
 
line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\jarry\PycharmProjects\JobPortal\myapp\views.py", line 45, 
in OTPverify
email = request.POST['email']
  File 
"C:\Users\jarry\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\django\utils\datastructures.py",
 
line 85, in __getitem__
raise MultiValueDictKeyError(key)

Exception Type: MultiValueDictKeyError at /otp/
Exception Value: 'email'


*This is the error I am getting at OTP verification step. Please guide me 
where I am wrong. *

*Thank You so much*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fa8ae7b5-e589-45b2-80f3-ae52238eab52n%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2021-07-14 Thread Tony Chang
Dear MH,

I also stuck here.

When I run *~*# python3 -m pip install mod-wsgi

I got the same error message: RuntimeError: The 'apxs' command appears not 
to be installed or is not executable. Please check the list of 
prerequisites in the documentation for this package and install any missing 
Apache httpd server packages.

I installed the Apache HTTP Server 2.4.43 from Synology DSM 6.2.4-25556 
Package Center. The apex is found in the system.

*~*# find / -iname apx*

/volume1/@appstore/Apache2.4/usr/local/bin/apxs

Could you share with me the way you got out from here?

Thanks

Best Regards,

Tony

MH 在 2020年3月3日 星期二下午9:01:31 [UTC+8] 的信中寫道:

> Dear nitish
>
> Thanks for your reply. I guess it is kind of a linux that Synology uses, 
> but it is different from other distros. So many advice on the internet 
> builds upon the ability to install packages via apt-get or ipkg, but both 
> are not available here. Somehow (really only somehow) I got entware/opkg 
> installed. But since then I have problems with the installations of most 
> packages there.
>
> Here are the results of my adaption of your suggested commands:
>
> /opt/bin# ./opkg find httpd
> /opt/bin#
>
> So, it seems there is no httpd24 on this repo.
>
> /opt/bin# ./opkg install apache
> Package apache (2.4.37-2) installed in root is up to date.
>
> /opt/bin# ./opkg install gcc
> Package gcc (7.4.0-5) installed in root is up to date.
>
> /opt/bin# sudo python3.5 -m pip install mod-wsgi
> Collecting mod-wsgi
>   Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
> ERROR: Command errored out with exit status 1:
>  command: /usr/local/bin/python3.5 -c 'import sys, setuptools, 
> tokenize; sys.argv[0] = 
> '"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"'; 
> __file__='"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"';f=getattr(tokenize,
>  
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
> egg_info --egg-base /tmp/pip-install-24inw61_/mod-wsgi/pip-egg-info
>  cwd: /tmp/pip-install-24inw61_/mod-wsgi/
> Complete output (5 lines):
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/tmp/pip-install-24inw61_/mod-wsgi/setup.py", line 168, in 
> 
> 'missing Apache httpd server packages.' % APXS)
> RuntimeError: The 'apxs' command appears not to be installed or is not 
> executable. Please check the list of prerequisites in the documentation 
> for this package and install any missing Apache httpd server packages.
> 
> ERROR: Command errored out with exit status 1: python setup.py egg_info 
> Check the logs for full command output.
>
> I guess there are many problems, but this is just a start.
>
> Best regards
> MH
>
>
> On Monday, March 2, 2020 at 9:04:23 PM UTC+1, MH wrote:
>>
>> Hi there
>>
>> I am rather a newbie, but after some problems I got django installed on 
>> my Synology Diskstation. So, I ignored many other problems and am very 
>> happy that I built my very first, very simple app. And now I would like to 
>> move it from the development stage to the production stage. Obviously I 
>> should make a change to a distinct webserver. Synology offers nginx and 
>> apache 2.4. I installed both. And now I do not really know how to proceed. 
>> Out there, there are many instructions to use something called mod-wsgi. 
>> But I cannot install this from the package center of the Diskstation.
>>
>> I also tried to get opkg working. And this did not turn out so well, too. 
>> Most packages return an error, when I try to install something. Before this 
>> gets too elusive, I would ask you for guidance and then I can provide you 
>> with the following error messages.
>>
>> Best regards
>> MH
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37c87088-0375-4c7a-b490-c7e21799cfa5n%40googlegroups.com.


In need of urgent help as I've been stuck on this for a while

2021-06-24 Thread Aritra Ray
Hi,
This is my second request regarding the same issue. I've been building a
Django E-commerce website and I'm facing problems filtering the product
according to price. I used django-filter to filter category and size.
Please suggest a solution for price in the following manner: Latest
products, Lowest to Highest and Highest to Lowest. I've made some progress
in the template without using django-filter. Kindly help me tie it up with
the backend.

Do let me know if anything else is needed.
Thanks for your help in advance

Regards,
Aritra

#products-html
 

  
  
{{filter.form|crispy}}

  Select sorting criteria
  
  
  
  Latest collection
  Lowest to Highest
  Highest to Lowest
  
  
  
  
 Search

  


#views.py

class Product(ListView):
model = Items
paginate_by = 6
template_name = 'products.html'
ordering = ["-id"]

def get_queryset(self):
queryset = super().get_queryset()
filter = ProductFilter(self.request.GET, queryset)
return filter.qs

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
queryset = self.get_queryset()
filter = ProductFilter(self.request.GET, queryset)
context["filter"] = filter
return context

# filters.py
import django_filters
from .models import Items

class ProductFilter(django_filters.FilterSet):
class Meta:
model = Items
fields = ['size', 'category']

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFecadukpt-gAgFwT5%2BKGM2tp3u3fdFDj98MQHWPgbY42dMGVQ%40mail.gmail.com.


I have been stuck for Django checkbox

2020-12-29 Thread ok
 Please anyone can solve this for me  Stackoverflow link-https://stackoverflow.com/questions/65493274/how-to-get-data-from-different-table-using-ajax-in-form-of-checkbox-in-django



-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0FDF3880-1140-41B5-82B2-9A2AB5D0F946%40hxcore.ol.


Re: Stuck with Calculated feild

2020-09-25 Thread Frederic Salvetat


Hi Eankomah,

You have several solution depending upon your need:

 

> Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
> Hi all am stuck at getting total_price Calculated in my model
>  
> class inventory(models.Model):
> def __str__(self):
> return self.name
>   ...
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
>   ...
> Thanks

 

First *dr neyx de godlove* answer is the more elegant if you do not need a 
dedicated db field.

You just need to remove the 'get_' prefix  in get_total_price :

 

@property

def total_price(self):

total_price = self.unit_price * self.quantity

return total_price

 

(*@dr neyx de godlove*, thank I learned the use of property in django 
trying you solution)

 

Then if you really need a dedicated field, create it and override the save 
method in your model :

total_price = models.FloatField()

 

def save(self, *args, **kwargs):

#change total_price

# Transaction.save(update_fields['total_price'])

self.total_price = self.unit_price * self.quantity

super(Inventory, self).save(*args, **kwargs)

Best Regards
--
Frédéric Salvetat 

Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
>
> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_NULL)
>
> product = models.ForeignKey(Product, null=True, on_delete = 
> models.SET_NULL)
> quantity = models.FloatField()
> unit_price = models.FloatField()
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
> selling_price = models.FloatField()
> date_created = models.DateTimeField(auto_now_add=True) 
>
>
> Thanks
>

Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
>
> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_NULL)
>
> product = models.ForeignKey(Product, null=True, on_delete = 
> models.SET_NULL)
> quantity = models.FloatField()
> unit_price = models.FloatField()
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
> selling_price = models.FloatField()
> date_created = models.DateTimeField(auto_now_add=True) 
>
>
> Thanks
>

Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
>
> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_NULL)
>
> product = models.ForeignKey(Product, null=True, on_delete = 
> models.SET_NULL)
> quantity = models.FloatField()
> unit_price = models.FloatField()
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
> selling_price = models.FloatField()
> date_created = models.DateTimeField(auto_now_add=True) 
>
>
> Thanks
>

Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
>
> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_NULL)
>
> product = models.ForeignKey(Product, null=True, on_delete = 
> models.SET_NULL)
> quantity = models.FloatField()
> unit_price = models.FloatField()
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
> selling_price = models.FloatField()
> date_created = models.DateTimeField(auto_now_add=True) 
>
>
> Thanks
>

Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :
>
> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_N

Re: Stuck with Calculated feild

2020-09-25 Thread Frederic Salvetat
Hi Eankomah,
You have several solutions depending upon your need:

*>Le mercredi 23 septembre 2020 07:24:05 UTC+2, eankomah a écrit :*
*>Hi all am stuck at getting total_price Calculated in my model*
*>*
*>class inventory(models.Model):*
*>def __str__(self):*
*>return self.name*
*>  ...*
*>total_price = models.FloatField(total=('unit_price' * 'quantity'))*
*>  ...*
*>Thanks*

First *dr neyx de godlove*'s answer is the more elegant if you do not need 
a dedicated db field.
You just need to remove the 'get_' prefix  in get_total_price :

@property
def total_price(self):
total_price = self.unit_price * self.quantity
return total_price

(*@dr neyx de godlove*, thank I learned the use of property in django 
trying you solution)

Then if you really need a dedicated field, create it and override the save 
method in your model :
total_price = models.FloatField()

def save(self, *args, **kwargs):
#change total_price
# Transaction.save(update_fields['total_price'])
self.total_price = self.unit_price * self.quantity
super(Inventory, self).save(*args, **kwargs)


Best Regards
--
Frédéric Salvetat 
Le mercredi 23 septembre 2020 à 17:13:32 UTC+2, Kasper Laudrup a écrit :

> Hi Harish,
>
> On 23/09/2020 11.27, Harish Thiyagharajan wrote:
> > I think you mailed me instead of mailing someone
> > 
>
> No. If you look at the mail header, you can see this was sent to the 
> django-users mailing list.
>
> Kind regards,
>
> Kasper Laudrup
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b9412f55-35c5-461e-b984-42b5a8e6e95cn%40googlegroups.com.


Re: Stuck with Calculated feild

2020-09-23 Thread Kasper Laudrup

Hi Harish,

On 23/09/2020 11.27, Harish Thiyagharajan wrote:

I think you mailed me instead of mailing someone



No. If you look at the mail header, you can see this was sent to the 
django-users mailing list.


Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/170da9eb-ff44-4fe6-3acb-fc265a9bec62%40stacktrace.dk.


Re: Stuck with Calculated feild

2020-09-23 Thread Harish Thiyagharajan
I think you mailed me instead of mailing someone

On Wed, Sep 23, 2020 at 2:47 PM Kasper Laudrup 
wrote:

> Hi eankomah,
>
> Completely unrelated, but:>  unit_price = models.FloatField()
> Don't use floats for money. It will give you all kinds of problems with
> rounding errors etc.
>
> Assuming this is just a hobby project, it's probably fine, but otherwise
> consider looking into something like:
>
> https://github.com/django-money/django-money
>
> Just an advice.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/63a264e8-c0b5-14f5-759d-0e7593b4e27f%40stacktrace.dk
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHg_i8hfKt5nMdiwNseX4DXpN12vds7NEGUf0pOAvSkd5oR8Lg%40mail.gmail.com.


Re: Stuck with Calculated feild

2020-09-23 Thread Kasper Laudrup

Hi eankomah,

Completely unrelated, but:>  unit_price = models.FloatField()
Don't use floats for money. It will give you all kinds of problems with 
rounding errors etc.


Assuming this is just a hobby project, it's probably fine, but otherwise 
consider looking into something like:


https://github.com/django-money/django-money

Just an advice.

Kind regards,

Kasper Laudrup

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63a264e8-c0b5-14f5-759d-0e7593b4e27f%40stacktrace.dk.


Re: Stuck with Calculated feild

2020-09-22 Thread dr neyx de godlove
hi there you can create another method for that class that calculates the
total as


@property
def get_total_price(self):
 total_price = self.unit_price * self.quantity
 return total_price


On Wed, Sep 23, 2020 at 8:24 AM eankomah  wrote:

> Hi all am stuck at getting total_price Calculated in my model
>
> class inventory(models.Model):
> def __str__(self):
> return self.name
>
>
> category = models.ForeignKey(Category, null=True, on_delete = 
> models.SET_NULL)
>
> Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
> models.SET_NULL)
>
> product = models.ForeignKey(Product, null=True, on_delete = 
> models.SET_NULL)
> quantity = models.FloatField()
> unit_price = models.FloatField()
> total_price = models.FloatField(total=('unit_price' * 'quantity'))
> selling_price = models.FloatField()
> date_created = models.DateTimeField(auto_now_add=True)
>
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ab25477-99fa-4de4-a774-667d336235e6n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4ab25477-99fa-4de4-a774-667d336235e6n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJofND7nGPRtn6hOHCwQAudVA-JzDGb0p-VWE8Yhoyp22rjq2A%40mail.gmail.com.


Stuck with Calculated feild

2020-09-22 Thread eankomah
Hi all am stuck at getting total_price Calculated in my model

class inventory(models.Model):
def __str__(self):
return self.name

category = models.ForeignKey(Category, null=True, on_delete = 
models.SET_NULL)
Supplier = models.ForeignKey(Supplier, null=True, on_delete = 
models.SET_NULL)
product = models.ForeignKey(Product, null=True, on_delete = models.SET_NULL)
quantity = models.FloatField()
unit_price = models.FloatField()
total_price = models.FloatField(total=('unit_price' * 'quantity'))
selling_price = models.FloatField()
date_created = models.DateTimeField(auto_now_add=True) 


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ab25477-99fa-4de4-a774-667d336235e6n%40googlegroups.com.


Re: I am stuck at "Installing Django on PythonAnywhere" can anyone help me ?

2020-09-21 Thread Mohammad Ahshan Danish


On Mon, Sep 21, 2020 at 7:04 PM Shahprogrammer  wrote:

> That's not the problem with installation of Django it's with your urls
>
> On Monday, 21 September, 2020 at 6:49:56 pm UTC+5:30 kashubh...@gmail.com
> wrote:
>
>> [image: Screenshot (418).png]
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/86902d30-1960-41de-b44e-61787325f2f9n%40googlegroups.com
> 
> .
>


-- 
Thanks & Regards

Regards,
Danish

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPQdaF1i%2B55MfV5W-ViPNTN2BpjSqPf-_dHUrA15aosjhsijfg%40mail.gmail.com.


Re: I am stuck at "Installing Django on PythonAnywhere" can anyone help me ?

2020-09-21 Thread Shahprogrammer
That's not the problem with installation of Django it's with your urls

On Monday, 21 September, 2020 at 6:49:56 pm UTC+5:30 kashubh...@gmail.com 
wrote:

> [image: Screenshot (418).png]
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/86902d30-1960-41de-b44e-61787325f2f9n%40googlegroups.com.


I am stuck at "Installing Django on PythonAnywhere" can anyone help me ?

2020-09-21 Thread Kashu Bhattarai
[image: Screenshot (418).png]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/697e4d1c-9f17-45dd-a949-e0552d64b082n%40googlegroups.com.


Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Andréas Kühne
The thing is - it should be - the packages are marked for each version.
However with the mixup of python versions and also how you install it - I
think the problem was increased because you installed in different ways and
probably not only in the virtual environment. But great that you got it
working!

Regards,

Andréas


Den tis 24 mars 2020 kl 15:58 skrev Rodolphe Gohard :

> Hello, thanks for your answer.
>
> I installed python 3.6 from another PPA and it works fine now. I just wish
> pip were aware of those requirements.
>
>
>
>
>
> On Tuesday, March 24, 2020 at 1:35:03 PM UTC+1, Andréas Kühne wrote:
>>
>> Hi,
>>
>> First of all - you need to make sure you are using the python 3 version
>> for everything - you can't mix and match python versions. So make sure that
>> python 3 is the version you are using for everything,
>> Second - python 3.5.2 is an old version of python 3 - you need at least
>> version 3.6 for django 3.0 - and that could also be the issue with the
>> other requirements. I would recommend upgrading to at least version 3.6,
>> but preferably the latest python 3 version (3.8). Then you shouldn't have
>> any issues with this?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tis 24 mars 2020 kl 12:11 skrev Rodolphe Gohard :
>>
>>> Hello, I am wanting to create a django project.
>>>
>>> I followed the instructions on installing django here:
>>> https://docs.djangoproject.com/en/3.0/intro/install/ and here:
>>> https://docs.djangoproject.com/en/3.0/intro/tutorial01/
>>>
>>> But I have encountered multiple problems and am stuck.
>>>
>>>
>>> My env:
>>> Ubuntu on WSL
>>> python 2.7
>>> python 3.5.2
>>>
>>>
>>> Here is the steps I took so far:
>>>
>>> # create the venv
>>> sudo apt-get install python3-venv
>>> python3 -m venv pythonenv
>>> source ./pythonenv/bin/activate
>>>
>>>
>>> python -m pip install Django
>>> # until there it works
>>>
>>>
>>> # now, I can't run django-admin startproject diagnosis-admin, fails
>>> everytime with a new errors
>>>
>>>
>>> # pbs with secrets <- pyopenssl <- wheel <- libs
>>> sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
>>> pip install wheel
>>> pip install pyopenssl
>>>
>>>
>>> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
>>> pip install secrets
>>>
>>>
>>> django-admin startproject diagnosis-admin
>>>
>>> it still fails with an error I don't know what to do with:
>>> (pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$
>>> django-admin startproject diagnosis-admin
>>> Traceback (most recent call last):
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
>>> , line 328, in run_from_argv
>>> self.execute(*args, **cmd_options)
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
>>> , line 369, in execute
>>> output = self.handle(*args, **options)
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
>>> , line 18, in handle
>>> options['secret_key'] = get_random_secret_key()
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
>>> , line 82, in get_random_secret_key
>>> return get_random_string(50, chars)
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
>>> , line 46, in get_random_string
>>> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>>>   File
>>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
>>> , line 46, in 
>>> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>>> AttributeError: module 'secrets' has no attribute 'choice'
>>>
>>>
>>> During handling of the above exception, another exception occurred:
>>>
>>

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Rodolphe Gohard
Hello, thanks for your answer.

I installed python 3.6 from another PPA and it works fine now. I just wish 
pip were aware of those requirements.





On Tuesday, March 24, 2020 at 1:35:03 PM UTC+1, Andréas Kühne wrote:
>
> Hi,
>
> First of all - you need to make sure you are using the python 3 version 
> for everything - you can't mix and match python versions. So make sure that 
> python 3 is the version you are using for everything,
> Second - python 3.5.2 is an old version of python 3 - you need at least 
> version 3.6 for django 3.0 - and that could also be the issue with the 
> other requirements. I would recommend upgrading to at least version 3.6, 
> but preferably the latest python 3 version (3.8). Then you shouldn't have 
> any issues with this?
>
> Regards,
>
> Andréas
>
>
> Den tis 24 mars 2020 kl 12:11 skrev Rodolphe Gohard  >:
>
>> Hello, I am wanting to create a django project.
>>
>> I followed the instructions on installing django here:
>> https://docs.djangoproject.com/en/3.0/intro/install/ and here: 
>> https://docs.djangoproject.com/en/3.0/intro/tutorial01/
>>
>> But I have encountered multiple problems and am stuck.
>>
>>
>> My env:
>> Ubuntu on WSL
>> python 2.7
>> python 3.5.2
>>
>>
>> Here is the steps I took so far:
>>
>> # create the venv
>> sudo apt-get install python3-venv 
>> python3 -m venv pythonenv
>> source ./pythonenv/bin/activate
>>
>>
>> python -m pip install Django
>> # until there it works
>>
>>
>> # now, I can't run django-admin startproject diagnosis-admin, fails 
>> everytime with a new errors
>>
>>
>> # pbs with secrets <- pyopenssl <- wheel <- libs
>> sudo apt-get install build-essential libssl-dev libffi-dev python3-dev  
>> pip install wheel
>> pip install pyopenssl 
>>
>>
>> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev 
>> pip install secrets
>>
>>
>> django-admin startproject diagnosis-admin
>>
>> it still fails with an error I don't know what to do with:
>> (pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ django
>> -admin startproject diagnosis-admin
>> Traceback (most recent call last):
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
>> , line 328, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
>> , line 369, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
>> , line 18, in handle
>> options['secret_key'] = get_random_secret_key()
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
>> , line 82, in get_random_secret_key
>> return get_random_string(50, chars)
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
>> , line 46, in get_random_string
>> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
>> , line 46, in 
>> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>> AttributeError: module 'secrets' has no attribute 'choice'
>>
>>
>> During handling of the above exception, another exception occurred:
>>
>>
>> Traceback (most recent call last):
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/bin/django-admin"
>> , line 11, in 
>> sys.exit(execute_from_command_line())
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
>> , line 401, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
>> , line 395, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Akinfolarin Stephen
to create your first django project first 
install python on your sysytem
after that you check if you have pip on your sysytem of course it will be 
there
to check use ths command: pip --version
after that install a virtual environment in case you don't know what 
virtual environment is it help you make a specific setting to just one 
project it won't have impact on other project
th commanad is:
pip install virtualenvwrapper
after that let now make the environment
use this command
mkvirtualenv (the name you want to give to your virtual environment)
your environment is automatically generated
install django
use this command: pip install django
before creating your project store in a folder
use this command: mkdir (the name of the folder)
then use this command to open the folder
cd (the name)
after that let create our django project with this command :
use this command: django-admin startprojects (the name of the project)
django will automatically create a folder inside the folder you create then 
go to the folder with this command
cd (the name of your django projects)
after that
enter this command: python manage.py runserver


On Wednesday, March 25, 2020 at 1:11:44 AM UTC+14, Rodolphe Gohard wrote:
>
> Hello, I am wanting to create a django project.
>
> I followed the instructions on installing django here:
> https://docs.djangoproject.com/en/3.0/intro/install/ and here: 
> https://docs.djangoproject.com/en/3.0/intro/tutorial01/
>
> But I have encountered multiple problems and am stuck.
>
>
> My env:
> Ubuntu on WSL
> python 2.7
> python 3.5.2
>
>
> Here is the steps I took so far:
>
> # create the venv
> sudo apt-get install python3-venv 
> python3 -m venv pythonenv
> source ./pythonenv/bin/activate
>
>
> python -m pip install Django
> # until there it works
>
>
> # now, I can't run django-admin startproject diagnosis-admin, fails 
> everytime with a new errors
>
>
> # pbs with secrets <- pyopenssl <- wheel <- libs
> sudo apt-get install build-essential libssl-dev libffi-dev python3-dev  
> pip install wheel
> pip install pyopenssl 
>
>
> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev 
> pip install secrets
>
>
> django-admin startproject diagnosis-admin
>
> it still fails with an error I don't know what to do with:
> (pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ 
> django-admin 
> startproject diagnosis-admin
> Traceback (most recent call last):
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 328, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 369, in execute
> output = self.handle(*args, **options)
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
> , line 18, in handle
> options['secret_key'] = get_random_secret_key()
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
> , line 82, in get_random_secret_key
> return get_random_string(50, chars)
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in get_random_string
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in 
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
> AttributeError: module 'secrets' has no attribute 'choice'
>
>
> During handling of the above exception, another exception occurred:
>
>
> Traceback (most recent call last):
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/bin/django-admin"
> , line 11, in 
> sys.exit(execute_from_command_line())
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 401, in execute_from_command_line
> utility.execute()
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/mnt/c/Users/gohard.r/dev/assistance-t

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Bruno Santos
Hello, try to uninstall python and install again. Have just one
installation of python, 2.7 or 3.5.2

Em ter, 24 de mar de 2020 08:11, Rodolphe Gohard 
escreveu:

> Hello, I am wanting to create a django project.
>
> I followed the instructions on installing django here:
> https://docs.djangoproject.com/en/3.0/intro/install/ and here:
> https://docs.djangoproject.com/en/3.0/intro/tutorial01/
>
> But I have encountered multiple problems and am stuck.
>
>
> My env:
> Ubuntu on WSL
> python 2.7
> python 3.5.2
>
>
> Here is the steps I took so far:
>
> # create the venv
> sudo apt-get install python3-venv
> python3 -m venv pythonenv
> source ./pythonenv/bin/activate
>
>
> python -m pip install Django
> # until there it works
>
>
> # now, I can't run django-admin startproject diagnosis-admin, fails
> everytime with a new errors
>
>
> # pbs with secrets <- pyopenssl <- wheel <- libs
> sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
> pip install wheel
> pip install pyopenssl
>
>
> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
> pip install secrets
>
>
> django-admin startproject diagnosis-admin
>
> it still fails with an error I don't know what to do with:
> (pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ 
> django-admin
> startproject diagnosis-admin
> Traceback (most recent call last):
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 328, in run_from_argv
> self.execute(*args, **cmd_options)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 369, in execute
> output = self.handle(*args, **options)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
> , line 18, in handle
> options['secret_key'] = get_random_secret_key()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
> , line 82, in get_random_secret_key
> return get_random_string(50, chars)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in get_random_string
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in 
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
> AttributeError: module 'secrets' has no attribute 'choice'
>
>
> During handling of the above exception, another exception occurred:
>
>
> Traceback (most recent call last):
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/bin/django-admin"
> , line 11, in 
> sys.exit(execute_from_command_line())
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 401, in execute_from_command_line
> utility.execute()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 341, in run_from_argv
> connections.close_all()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
> , line 225, in close_all
> for alias in self:
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
> , line 219, in __iter__
> return iter(self.databases)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/functional.py"
> , line 48, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/functional.py"
> , line 22, in func
> 'Cannot use cached_property instance without calling '
> TypeError: Can

Re: Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Andréas Kühne
Hi,

First of all - you need to make sure you are using the python 3 version for
everything - you can't mix and match python versions. So make sure that
python 3 is the version you are using for everything,
Second - python 3.5.2 is an old version of python 3 - you need at least
version 3.6 for django 3.0 - and that could also be the issue with the
other requirements. I would recommend upgrading to at least version 3.6,
but preferably the latest python 3 version (3.8). Then you shouldn't have
any issues with this?

Regards,

Andréas


Den tis 24 mars 2020 kl 12:11 skrev Rodolphe Gohard :

> Hello, I am wanting to create a django project.
>
> I followed the instructions on installing django here:
> https://docs.djangoproject.com/en/3.0/intro/install/ and here:
> https://docs.djangoproject.com/en/3.0/intro/tutorial01/
>
> But I have encountered multiple problems and am stuck.
>
>
> My env:
> Ubuntu on WSL
> python 2.7
> python 3.5.2
>
>
> Here is the steps I took so far:
>
> # create the venv
> sudo apt-get install python3-venv
> python3 -m venv pythonenv
> source ./pythonenv/bin/activate
>
>
> python -m pip install Django
> # until there it works
>
>
> # now, I can't run django-admin startproject diagnosis-admin, fails
> everytime with a new errors
>
>
> # pbs with secrets <- pyopenssl <- wheel <- libs
> sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
> pip install wheel
> pip install pyopenssl
>
>
> sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
> pip install secrets
>
>
> django-admin startproject diagnosis-admin
>
> it still fails with an error I don't know what to do with:
> (pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ 
> django-admin
> startproject diagnosis-admin
> Traceback (most recent call last):
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 328, in run_from_argv
> self.execute(*args, **cmd_options)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 369, in execute
> output = self.handle(*args, **options)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
> , line 18, in handle
> options['secret_key'] = get_random_secret_key()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
> , line 82, in get_random_secret_key
> return get_random_string(50, chars)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in get_random_string
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
> , line 46, in 
> return ''.join(secrets.choice(allowed_chars) for i in range(length))
> AttributeError: module 'secrets' has no attribute 'choice'
>
>
> During handling of the above exception, another exception occurred:
>
>
> Traceback (most recent call last):
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/bin/django-admin"
> , line 11, in 
> sys.exit(execute_from_command_line())
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 401, in execute_from_command_line
> utility.execute()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
> , line 395, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
> , line 341, in run_from_argv
> connections.close_all()
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
> , line 225, in close_all
> for alias in self:
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
> , line 219, in __iter__
> return iter(self.databases)
>   File
> "/mnt/c/Users/gohard.r/dev/assistance-tool/di

Creating a new Django project, Stuck with the very first steps

2020-03-24 Thread Rodolphe Gohard
Hello, I am wanting to create a django project.

I followed the instructions on installing django here:
https://docs.djangoproject.com/en/3.0/intro/install/ and here: 
https://docs.djangoproject.com/en/3.0/intro/tutorial01/

But I have encountered multiple problems and am stuck.


My env:
Ubuntu on WSL
python 2.7
python 3.5.2


Here is the steps I took so far:

# create the venv
sudo apt-get install python3-venv 
python3 -m venv pythonenv
source ./pythonenv/bin/activate


python -m pip install Django
# until there it works


# now, I can't run django-admin startproject diagnosis-admin, fails 
everytime with a new errors


# pbs with secrets <- pyopenssl <- wheel <- libs
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev  
pip install wheel
pip install pyopenssl 


sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev 
pip install secrets


django-admin startproject diagnosis-admin

it still fails with an error I don't know what to do with:
(pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ django-admin 
startproject diagnosis-admin
Traceback (most recent call last):
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
, line 328, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
, line 369, in execute
output = self.handle(*args, **options)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/commands/startproject.py"
, line 18, in handle
options['secret_key'] = get_random_secret_key()
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/utils.py"
, line 82, in get_random_secret_key
return get_random_string(50, chars)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
, line 46, in get_random_string
return ''.join(secrets.choice(allowed_chars) for i in range(length))
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/crypto.py"
, line 46, in 
return ''.join(secrets.choice(allowed_chars) for i in range(length))
AttributeError: module 'secrets' has no attribute 'choice'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/bin/django-admin"
, line 11, in 
sys.exit(execute_from_command_line())
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
, line 401, in execute_from_command_line
utility.execute()
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/__init__.py"
, line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/core/management/base.py"
, line 341, in run_from_argv
connections.close_all()
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
, line 225, in close_all
for alias in self:
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/db/utils.py"
, line 219, in __iter__
return iter(self.databases)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/functional.py"
, line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File 
"/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis-admin/pythonenv/lib/python3.5/site-packages/django/utils/functional.py"
, line 22, in func
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__
() on it.
(pythonenv) rodolphe@PHP140:~/dev/assistance-tool/diagnosis-admin$ python --
version
Python 3.5.2


I didn't expect so many steps and missing/wrong dependencies, so I guess 
there must be something wrong in the env, or django/python version, but not 
sure where to look.

Can anyone 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b291aeb4-67c0-4089-970b-6ddd084e201d%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Reach out to me privately, I'll assist you further.

On Fri, Mar 6, 2020 at 12:32 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> Finally I figured out, which of my gunicorn versions belonged to the right
> python3 that I invoked earlier. Now it seems to start. I write seems
> because in the browser it now immediately gives me an error that it cannot
> find a certain module "docx". I will come back to that in a different post.
>
> But thanks for all so far!
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/adbc08e4-4c83-405f-9042-d38ba2a5%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp1Z6bBJFp8nGQ8vWUqp%3DTcReMch-MCJoLfnwXf%2B75ZmTQ%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

Finally I figured out, which of my gunicorn versions belonged to the right 
python3 that I invoked earlier. Now it seems to start. I write seems 
because in the browser it now immediately gives me an error that it cannot 
find a certain module "docx". I will come back to that in a different post.

But thanks for all so far!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/adbc08e4-4c83-405f-9042-d38ba2a5%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread V. J
Zdravím vás, myslíme že přístup byl udělen jen pár lidem kteří odvádí dobrou práci, jelikož by bylo dost nebezpečné udělit přístup všem, tak pokud vas mohu poprosit obraťte se s žádostí na ně. A pokud uznaji za vhodné že je to potřeba, provedou opravu, nebo doplnění. Pokud se mýlím, tak mě kontaktujte a prenastavim pravidla přístupu. Přeji hezký den s pozdravem Vasek JachimOdesláno z mého telefonu Huawei Původní zpráva Předmět: Re: Stuck with Django on a Synology DiskstationOdesílatel: 'MH' via Django users Komu: Django users Kopie: Is there anything particular hat I have to write into that wsgi.py file?



-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.




-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/-kdq1xj-ohu8uudyni2w-qp6yfm-r1fto6-uhymk84wh307-guno8r-c497jr9gy14j-8vrumlx66jke-aw50mvkek1qxdc72ifubmccbwl6u8u-idee96zjjyzg7gdypxqtaqh-jvqrulz2p1np-1icriq.1583442428804%40email.android.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
If I am not totally mistaken it could be that gunicorn wants to work with 
python2.7 while I did everything with python3. But how could I direct 
gunicorn to take python3?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f355d8d1-fe22-4adb-9915-8f16f52f5c8b%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Make sure you're in the root of the project and run:

gunicorn -w 4 project.wsgi:application

you dont need to change anything.

On Thu, Mar 5, 2020, 10:51 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Is there anything particular hat I have to write into that wsgi.py file?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp3H3izqTPSrKXcUWsf2vk_ZSBTOjBeSuFJ66dirDu-crA%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Is there anything particular hat I have to write into that wsgi.py file?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

but would that help me right now? Besides the problem of finding the right 
pip, I mean? As you can see, even now my gunicorn won't work :(



On Thursday, March 5, 2020 at 4:04:46 PM UTC+1, Omar Abou Mrad wrote:
>
> As of Python 3.3 virtual environments are builtin, it would be wise to get 
> used to them.
>
> https://docs.python.org/3/library/venv.html
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c3a2e5f-a496-47e4-b216-94d8e651e029%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
 gunicorn -w 4 wsgi:application
[2020-03-05 15:55:51 +] [4472] [INFO] Starting gunicorn 19.9.0
[2020-03-05 15:55:51 +] [4472] [INFO] Listening at: http://127.0.0.1:8000 
(4472)
[2020-03-05 15:55:51 +] [4472] [INFO] Using worker: sync
[2020-03-05 15:55:51 +] [4483] [INFO] Booting worker with pid: 4483
[2020-03-05 15:55:51 +] [4483] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4483] [INFO] Worker exiting (pid: 4483)
[2020-03-05 15:55:51 +] [4484] [INFO] Booting worker with pid: 4484
[2020-03-05 15:55:51 +] [4484] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4484] [INFO] Worker exiting (pid: 4484)
[2020-03-05 15:55:51 +] [4486] [INFO] Booting worker with pid: 4486
[2020-03-05 15:55:51 +] [4486] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4486] [INFO] Worker exiting (pid: 4486)
[2020-03-05 15:55:51 +] [4487] [INFO] Booting worker with pid: 4487
[2020-03-05 15:55:51 +] [4487] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
ImportError: No module named wsgi
[2020-03-05 15:55:51 +] [4487] [INFO] Worker exiting (pid: 4487)
[2020-03-05 15:55:51 +] [4472] [INFO] Shutting down: Master
[2020-03-05 15:55:51 +] [4472] [INFO] Reason: Worker failed to boot.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32ff3661-129e-49df-8061-3ad51493951e%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
As of Python 3.3 virtual environments are builtin, it would be wise to get
used to them.

https://docs.python.org/3/library/venv.html

On Thu, Mar 5, 2020 at 4:57 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> /volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
> Defaulting to user installation because normal site-packages is not
> writeable
> Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib
> /python3.5/site-packages (20.0.4)
> Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
> usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
>
> The output for this folder is identical for pip3 and pip 3.5.
>
> /usr/bin$ ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Defaulting to user installation because normal site-packages is not
> writeable
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> ERROR: Could not install packages due to an EnvironmentError: [Errno 13]
> Permission denied:
> '/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
> Check the permissions.
>
> and as root:
> /usr/bin# ./pip install gunicorn
> /usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning:
> 'point_conversion_form_t' has no values explicitly defined; next version
> will refuse to guess which integer type it is meant to be (unsigned/signed
> , int/long)
>   % self._get_c_name())
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. A
> future version of pip will drop support for Python 2.7. More details
> about Python 2 support in pip, can be found at https://
> pip.pypa.io/en/latest/development/release-process/#python-2-support
> Collecting gunicorn
>   Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
>  || 113 kB 1.4 MB/s
> Installing collected packages: gunicorn
> Successfully installed gunicorn-19.10.0
>
> I will now try it again.
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/30b9b540-6224-4906-98f1-f0a3ff0ebb01%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp352iNvORHWxm1WJPdpL6dtJqkmS4aACbGtRJpUqByi8g%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
/volume1/@appstore/py3k/usr/local/bin$ ./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.5/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)

The output for this folder is identical for pip3 and pip 3.5.

/usr/bin$ ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] 
Permission denied: 
'/usr/local/lib/python2.7/site-packages/gunicorn-19.10.0.dist-info'
Check the permissions.

and as root:
/usr/bin# ./pip install gunicorn
/usr/local/lib/python2.7/site-packages/cffi/model.py:526: UserWarning: 
'point_conversion_form_t' has no values explicitly defined; next version 
will refuse to guess which integer type it is meant to be (unsigned/signed, 
int/long)
  % self._get_c_name())
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. A future 
version of pip will drop support for Python 2.7. More details about Python 2 
support in pip, can be found at https:
//pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting gunicorn
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
 || 113 kB 1.4 MB/s 
Installing collected packages: gunicorn
Successfully installed gunicorn-19.10.0

I will now try it again.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/30b9b540-6224-4906-98f1-f0a3ff0ebb01%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users

To be quite honest, this is really challenging for me, because the synology 
OS drove me nuts. I am under the impression that I have multiple 
installations of python and pip running now.

In order to get an overview, I will now try to find every pip on my system 
and to install gunicorn everywhere. (I would wish I just had one central 
apt-get command here)...

~/.local/bin$ ./pip3 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

~/.local/bin$ ./pip3.5 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Collecting gunicorn
  Using cached gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: setuptools>=3.0 in /volume1/@appstore/py3k/
usr/local/lib/python3.5/site-packages (from gunicorn) (41.0.1)
Installing collected packages: gunicorn
  WARNING: The script gunicorn is installed in 
'/var/services/homes/admin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this 
warning, use --no-warn-script-location.
Successfully installed gunicorn-20.0.4

and

./pip3.8 install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

and

./pip install gunicorn
Defaulting to user installation because normal site-packages is not 
writeable
Requirement already satisfied: gunicorn in /volume1/homes/admin/.local/lib/
python3.8/site-packages (20.0.4)
Requirement already satisfied: setuptools>=3.0 in /volume1/homes/admin/.
local/lib/python3.8/site-packages (from gunicorn) (45.2.0)

These were all from the same directory. Next post with more infos from 
other folders.




-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d9a4564c-08f7-48d8-ae5b-822656dc32b4%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
gunicorn is yielding the same error as the standard python command I gave
you,
whereas you use python3 to fire up the django development server. I'll
venture
a guess and say the problem is due to the environment.

Are you using any virtual environment or installing system wide?
How did you install django?
How did you install gunicorn?
Did you use pip?
Do you have a pip3?
Does "pip --version" and "pip3 --version" yield different results?

If you answered yes to the last 3 questions, try removing gunicorn using pip
and installing it using pip3.

On Thu, Mar 5, 2020 at 3:59 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Omar
>
> python -c "import django.core.wsgi" && echo "Yup, works!"
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named django.core.wsgi
>
>
> but
> python3 manage.py runserver 0:8000
> Watching for file changes with StatReloader
> Performing system checks...
>
> System check identified no issues (0 silenced).
> March 05, 2020 - 14:42:06
> Django version 3.0.3, using settings 'project.settings'
> Starting development server at http://0:8000/
> Quit the server with CONTROL-C.
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/645cfdfa-1861-4ac8-97bf-c3be4c273196%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp29duqw%2BzCRZR9Ts-kEtTfF-_jgJNqv_42h%2BDZaTOG6Pg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Dear Omar

python -c "import django.core.wsgi" && echo "Yup, works!"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django.core.wsgi


but
python3 manage.py runserver 0:8000
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
March 05, 2020 - 14:42:06
Django version 3.0.3, using settings 'project.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/645cfdfa-1861-4ac8-97bf-c3be4c273196%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Is django installed properly?
Are you still able to use runserver?
What happens when you run the following?

python -c "import django.core.wsgi" && echo "Yup, works!"

also, looking further into your error log, make sure you're in the proper
directory.
(i may have given you the wrong one earlier, run the below and see if it
works)

cd /var/services/homes/admin/DjangoProject/project/
gunicorn -w 4 project.wsgi:application

On Thu, Mar 5, 2020 at 2:34 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Somehow I cannot write everything into one post that I wanted to reply.
> Here comes the rest of my original post.
>
>
> gunicorn -w 4 wsgi:application
> [... continued ...]
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>  Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
> [2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
> Traceback (most recent call last):
>   File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583,
> in spawn_worker
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 129, in init_process
>   File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line
> 138, in load_wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67,
> in wsgi
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52
> , in load
>   File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41
> , in load_wsgiapp
>   File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in
> import_app
>   File
> "/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py",
> line 12, in 
> from django.core.wsgi import get_wsgi_application
> ImportError: No module named django.core.wsgi
> [2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
> [2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
> [2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.
>
> The wsgi filee only consists of:
>
> import os
>
> from django.core.wsgi import get_wsgi_application
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
>
> application = get_wsgi_application()
>
>
> What should I do differently?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d6ab1255-5fc0-4800-b618-555b34848422%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp29ynfVBdOx%2BptFHrZercMLTPy4Y7o85Oae_3sCEA4VOw%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Somehow I cannot write everything into one post that I wanted to reply. 
Here comes the rest of my original post.


gunicorn -w 4 wsgi:application
[... continued ...]
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
 Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6ab1255-5fc0-4800-b618-555b34848422%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you 

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Thanks Omar,

but do I have to write something into that wsgi file?

gunicorn -w 4 wsgi:application
[2020-03-05 12:55:09 +] [29297] [INFO] Starting gunicorn 19.9.0
[2020-03-05 12:55:09 +] [29297] [INFO] Listening at: http://127.0.0.1:8000 
(29297)
[2020-03-05 12:55:09 +] [29297] [INFO] Using worker: sync
[2020-03-05 12:55:09 +] [29307] [INFO] Booting worker with pid: 29307
[2020-03-05 12:55:09 +] [29307] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29307] [INFO] Worker exiting (pid: 29307)
[2020-03-05 12:55:09 +] [29308] [INFO] Booting worker with pid: 29308
[2020-03-05 12:55:09 +] [29308] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File "/var/services/homes/admin/DjangoProject/project/project/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Booting worker with pid: 29309
[2020-03-05 12:55:09 +] [29308] [INFO] Worker exiting (pid: 29308)
[2020-03-05 12:55:09 +] [29310] [INFO] Booting worker with pid: 29310
[2020-03-05 12:55:09 +] [29309] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29309] [INFO] Worker exiting (pid: 29309)
[2020-03-05 12:55:09 +] [29310] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 350, in 
import_app
  File 
"/var/services/homes/admin/DjangoProject/abrechnung/abrechnung/wsgi.py", 
line 12, in 
from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
[2020-03-05 12:55:09 +] [29310] [INFO] Worker exiting (pid: 29310)
[2020-03-05 12:55:10 +] [29297] [INFO] Shutting down: Master
[2020-03-05 12:55:10 +] [29297] [INFO] Reason: Worker failed to boot.

The wsgi filee only consists of:

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

application = get_wsgi_application()


What should I do differently?

-- 
You received this message because you 

Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread Omar Abou Mrad
Change your working directory to "project" (the directory containing
wsgi.py) and use:

 gunicorn -w 4 wsgi:application

It should work.

On Thu, Mar 5, 2020 at 10:14 AM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Could anyone tell me how to start correctly the unicorn (integration)?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e4404c7e-e6d1-460d-9c22-e4571f1b7528%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp0UjVBWMSiW8v-CBn1ZQfwAwg23Fdwr8TEutXQNvZh3xw%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread 'MH' via Django users
Could anyone tell me how to start correctly the unicorn (integration)?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e4404c7e-e6d1-460d-9c22-e4571f1b7528%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-04 Thread 'MH' via Django users
Hi Omar

Actually I do not know why apache is better than the development webserver 
from django or gunicorn, but I wanted to give it a try. The installation 
worked.

Now I am not sure what I am doing wrong:

gunicorn project/wsgi.py:application
[2020-03-04 13:46:26 +] [28939] [INFO] Starting gunicorn 19.9.0
[2020-03-04 13:46:26 +] [28939] [INFO] Listening at: http://127.0.0.1:8000 
(28939)
[2020-03-04 13:46:26 +] [28939] [INFO] Using worker: sync
[2020-03-04 13:46:26 +] [28950] [INFO] Booting worker with pid: 28950
[2020-03-04 13:46:26 +] [28950] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/opt/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in 
spawn_worker
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129
, in init_process
  File "/opt/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138
, in load_wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in 
wsgi
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, 
in load
  File "/opt/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 
in load_wsgiapp
  File "/opt/lib/python2.7/site-packages/gunicorn/util.py", line 354, in 
import_app
ImportError: Failed to find application, did you mean 
'project/wsgi:application'?
[2020-03-04 13:46:26 +] [28950] [INFO] Worker exiting (pid: 28950)
[2020-03-04 13:46:26 +] [28939] [INFO] Shutting down: Master
[2020-03-04 13:46:26 +] [28939] [INFO] Reason: Worker failed to boot.

I just found this file in my project folder in a folder below the manage.py 
command. So therefore I thought that this could be the right wsgi file. I 
did not write anything into 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2f03ec91-59e7-4060-bf53-78c4fb5d1d2b%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread Omar Abou Mrad
[Alternative] While this shouldn't be considered as a way to circumvent
learning how to
configure apache or nginx to serve/proxy python apps, you can also consider
sticking
to pure python dependencies (if this is for personal use). you can ignore
the webserver
completely and simply opt for [1] gunicorn for app serving and use [2]
whitenoise for
serving static files.

[1] https://gunicorn.org/
[2] http://whitenoise.evans.io/

On Tue, Mar 3, 2020 at 3:02 PM 'MH' via Django users <
django-users@googlegroups.com> wrote:

> Dear Andreas
>
> I want to build a little system, which consists of several django apps
> that help me in my daily life. But I don't want to upload documents about
> insurances and stuff to any cloud. Therefore I wanted a solution on premise
> and the NAS seemed to be a good choice. Could be wrong about that. So far I
> was happy with development version, but it seems difficult to install other
> things like mod-wsgi.
>
> Best regards
> MH
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/564baec6-a88e-4360-bb13-9518b1f40634%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwtXp0W%3D%2BmbYxq1iYVv8AgP%3DE4_KPo6FgLCu5qE_KxabiGLfg%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread 'MH' via Django users
Dear Andreas

I want to build a little system, which consists of several django apps that 
help me in my daily life. But I don't want to upload documents about 
insurances and stuff to any cloud. Therefore I wanted a solution on premise 
and the NAS seemed to be a good choice. Could be wrong about that. So far I 
was happy with development version, but it seems difficult to install other 
things like mod-wsgi.

Best regards
MH

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/564baec6-a88e-4360-bb13-9518b1f40634%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread 'MH' via Django users
Dear nitish

Thanks for your reply. I guess it is kind of a linux that Synology uses, 
but it is different from other distros. So many advice on the internet 
builds upon the ability to install packages via apt-get or ipkg, but both 
are not available here. Somehow (really only somehow) I got entware/opkg 
installed. But since then I have problems with the installations of most 
packages there.

Here are the results of my adaption of your suggested commands:

/opt/bin# ./opkg find httpd
/opt/bin#

So, it seems there is no httpd24 on this repo.

/opt/bin# ./opkg install apache
Package apache (2.4.37-2) installed in root is up to date.

/opt/bin# ./opkg install gcc
Package gcc (7.4.0-5) installed in root is up to date.

/opt/bin# sudo python3.5 -m pip install mod-wsgi
Collecting mod-wsgi
  Using cached mod_wsgi-4.7.1.tar.gz (498 kB)
ERROR: Command errored out with exit status 1:
 command: /usr/local/bin/python3.5 -c 'import sys, setuptools, 
tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-24inw61_/mod-wsgi/setup.py'"'"';f=getattr(tokenize,
 
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
egg_info --egg-base /tmp/pip-install-24inw61_/mod-wsgi/pip-egg-info
 cwd: /tmp/pip-install-24inw61_/mod-wsgi/
Complete output (5 lines):
Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/pip-install-24inw61_/mod-wsgi/setup.py", line 168, in 

'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not 
executable. Please check the list of prerequisites in the documentation for 
this package and install any missing Apache httpd server packages.

ERROR: Command errored out with exit status 1: python setup.py egg_info 
Check the logs for full command output.

I guess there are many problems, but this is just a start.

Best regards
MH


On Monday, March 2, 2020 at 9:04:23 PM UTC+1, MH wrote:
>
> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my 
> Synology Diskstation. So, I ignored many other problems and am very happy 
> that I built my very first, very simple app. And now I would like to move 
> it from the development stage to the production stage. Obviously I should 
> make a change to a distinct webserver. Synology offers nginx and apache 
> 2.4. I installed both. And now I do not really know how to proceed. Out 
> there, there are many instructions to use something called mod-wsgi. But I 
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too. 
> Most packages return an error, when I try to install something. Before this 
> gets too elusive, I would ask you for guidance and then I can provide you 
> with the following error messages.
>
> Best regards
> MH
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca388790-6dbf-448b-bde6-da14b055e9de%40googlegroups.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-03 Thread Andréas Kühne
Hi,

I don't think this is actually possible. Django runs python and not only
simple html. Nginx and apache are simple webservers. So unless you can get
good access to the terminal on the diskstation - I wouldn't even try this.
Why do you want to have the application running on a disk station?

Regards,

Andréas


Den mån 2 mars 2020 kl 21:04 skrev 'MH' via Django users <
django-users@googlegroups.com>:

> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my
> Synology Diskstation. So, I ignored many other problems and am very happy
> that I built my very first, very simple app. And now I would like to move
> it from the development stage to the production stage. Obviously I should
> make a change to a distinct webserver. Synology offers nginx and apache
> 2.4. I installed both. And now I do not really know how to proceed. Out
> there, there are many instructions to use something called mod-wsgi. But I
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too.
> Most packages return an error, when I try to install something. Before this
> gets too elusive, I would ask you for guidance and then I can provide you
> with the following error messages.
>
> Best regards
> MH
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3b30b913-c881-451d-a25e-3539eaefa035%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcNLXD%2BG2ihPhQ%2BM%2BcwwaC3NYwJ5424mxjrbOSCMdYM4A%40mail.gmail.com.


Re: Stuck with Django on a Synology Diskstation

2020-03-02 Thread nitish kumar
Hi MH,


what flavour of Linux you are using. if it is centos/redhat you can use 
below steps.

   $sudo yum install httpd24-devel.x86_64 gcc git
 $sudo python3.5 -m pip install  mod-wsgi


once installed you need to add site configuration and permissions to your 
Django code.

 $ cd ~/django_app
 $python manage.py makemigrations
 $python manage.py migrate
 Note: if you get any errors remove  "db.sqlite3" file and execute the above 2 
commands
 $python manage.py collectstatic
 $sudo chown :www-data db.sqlite3
 $sudo service apache2 restart


If packages are not available you have to try the offline installation. and 
you need to install dependencies manually.

ping me if you need more help(https://twitter.com/vullinitish)



On Tuesday, 3 March 2020 01:34:23 UTC+5:30, MH wrote:
>
> Hi there
>
> I am rather a newbie, but after some problems I got django installed on my 
> Synology Diskstation. So, I ignored many other problems and am very happy 
> that I built my very first, very simple app. And now I would like to move 
> it from the development stage to the production stage. Obviously I should 
> make a change to a distinct webserver. Synology offers nginx and apache 
> 2.4. I installed both. And now I do not really know how to proceed. Out 
> there, there are many instructions to use something called mod-wsgi. But I 
> cannot install this from the package center of the Diskstation.
>
> I also tried to get opkg working. And this did not turn out so well, too. 
> Most packages return an error, when I try to install something. Before this 
> gets too elusive, I would ask you for guidance and then I can provide you 
> with the following error messages.
>
> Best regards
> MH
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/073b40dd-1379-405e-8c44-b582b72173ac%40googlegroups.com.


Stuck with Django on a Synology Diskstation

2020-03-02 Thread 'MH' via Django users
Hi there

I am rather a newbie, but after some problems I got django installed on my 
Synology Diskstation. So, I ignored many other problems and am very happy 
that I built my very first, very simple app. And now I would like to move 
it from the development stage to the production stage. Obviously I should 
make a change to a distinct webserver. Synology offers nginx and apache 
2.4. I installed both. And now I do not really know how to proceed. Out 
there, there are many instructions to use something called mod-wsgi. But I 
cannot install this from the package center of the Diskstation.

I also tried to get opkg working. And this did not turn out so well, too. 
Most packages return an error, when I try to install something. Before this 
gets too elusive, I would ask you for guidance and then I can provide you 
with the following error messages.

Best regards
MH

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b30b913-c881-451d-a25e-3539eaefa035%40googlegroups.com.


Stuck trying to add an image display to admin

2019-12-11 Thread Joel Ricker
In my admin I have a section for editing products and for each product has 
a one to many of sample images. I wanted to display the image for convience 
in my StackedInline for the sample images. However after setting everything 
up to display the sample image, I am still getting an internal error when 
it tries to render the view. Can someone look at it and give me an idea of 
whats going on?

Here is my code so far:


admin.py: 

class SampleInline(admin.StackedInline):
model = SampleImage
extra = 3

 

verbose_name = "Sample Page"
verbose_name_plural = "Sample Pages"

 

fieldsets = (
(None, {
'fields' : ("sample_type", "sample_image", "order", 
"display_sample_image",)
}),
)
readonly_fields = ("display_sample_image",)

 

def display_sample_image(self, obj):
return obj.display_sample_image()
return "testing"


 models.py

class SampleImage(models.Model):
sheet = models.ForeignKey(Sheet, related_name = "samples", 
on_delete=models.CASCADE, null=True)
sample_type = models.IntegerField(choices=IMAGE_CHOICES, 
default=IMAGE_CHOICES[-1][0])
sample_image = models.ImageField(upload_to=sample_image_upload_to)
order = models.IntegerField(blank=True,  null=True)


def display_sample_image(self):
width = 200
height = width * self.sample_image.height / self.sample_image.width
return format_html('http://127.0.0.1:8000/admin/browse/sheet/3868/change/

Django Version: 2.2.7
Python Version: 3.7.0
Installed Applications:
['browse.apps.BrowseConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 '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']


Template error:
In template 
E:\Python\Python37\lib\site-packages\django\contrib\admin\templates\admin\includes\fieldset.html,
 
error at line 17
   2
   7 : 
   8 : {% if line.fields|length_is:'1' %}{{ line.errors }}{% 
endif %}
   9 : {% for field in line %}
   10 : 
   11 : {% if not line.fields|length_is:'1' and not 
field.is_readonly %}{{ field.errors }}{% endif %}
   12 : {% if field.is_checkbox %}
   13 : {{ field.field }}{{ field.label_tag }}
   14 : {% else %}
   15 : {{ field.label_tag }}
   16 : {% if field.is_readonly %}
   17 :  {{ 
field.contents }} 
   18 : {% else %}
   19 : {{ field.field }}
   20 : {% endif %}
   21 : {% endif %}
   22 : {% if field.field.help_text %}
   23 : {{ 
field.field.help_text|safe }}
   24 : {% endif %}
   25 : 
   26 : {% endfor %}
   27 : 


Traceback:

File "E:\Python\Python37\lib\site-packages\django\db\models\options.py" in 
get_field
  565. return self.fields_map[field_name]

During handling of the above exception ('display_sample_image'), another 
exception occurred:

File "E:\Python\Python37\lib\site-packages\django\contrib\admin\utils.py" 
in lookup_field
  262. f = _get_non_gfk_field(opts, name)

File "E:\Python\Python37\lib\site-packages\django\contrib\admin\utils.py" 
in _get_non_gfk_field
  293. field = opts.get_field(name)

File "E:\Python\Python37\lib\site-packages\django\db\models\options.py" in 
get_field
  567. raise FieldDoesNotExist("%s has no field named '%s'" % 
(self.object_name, field_name))

During handling of the above exception (SampleImage has no field named 
'display_sample_image'), another exception occurred:

File 
"E:\Python\Python37\lib\site-packages\django\core\handlers\exception.py" in 
inner
  34. response = get_response(request)

File "E:\Python\Python37\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  145. response = self.process_exception_by_middleware(e, 
request)

File "E:\Python\Python37\lib\site-packages\django\core\handlers\base.py" in 
_get_response
  143. response = response.render()

File "E:\Python\Python37\lib\site-packages\django\template\response.py" in 
render
  106. self.content = self.rendered_content

File "E:\Python\Python37\lib\site-packages\django\template\response.py" in 
rendered_content
  83. content = template.render(context, self._request)

File 

Re: Poll Tutorial: I'm stuck I have mysql on my vps I created the database

2019-01-23 Thread Motaz Hejaze
really your question is not clear ,
what is the error message you got from debugger ??


On Wed, Jan 23, 2019 at 9:29 AM Anirudh Jain 
wrote:

> First of all you can remove 'PORT'. Then the most important thing to do is
> to grant your user privileges to perform operations on mysql database that
> you must have created by the name 'urbanpyt_polls'. The easiest way to do
> is to run this query on mysql : GRANT ALL PRIVILEGES ON *.* TO 
> 'username'@'localhost'
> IDENTIFIED BY 'password';
> You only need to replace 'username' by your user and similarly the
> password.
> After this - python manage.py makemigrations and then migrate
>
> On Wed, Jan 23, 2019 at 12:28 PM RETAIL CYBER 
> wrote:
>
>> has anyone ever install the django on a live web hosting service? if so
>> when it comes to using db is the db virtual just like djangoEnv or do i use
>> the mysql thats on my host? i have a vsp??
>>
>> --
>> 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/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> *Anirudh Jain* | *Appreciate you taking time to read the mail.*
>
> --
> 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/CAC3mK7d3nUo%3DUy_%2B0yd8q_nvXHZbcRZmPoZAhuX-Rgg8wb%2BeTQ%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/CAHV4E-cjtC6bYsmS1mRHw-ObmLc4_YXfQP%3DuvDTt%2BJYV%3D8q_rA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Poll Tutorial: I'm stuck I have mysql on my vps I created the database

2019-01-22 Thread Anirudh Jain
First of all you can remove 'PORT'. Then the most important thing to do is
to grant your user privileges to perform operations on mysql database that
you must have created by the name 'urbanpyt_polls'. The easiest way to do
is to run this query on mysql : GRANT ALL PRIVILEGES ON *.* TO
'username'@'localhost'
IDENTIFIED BY 'password';
You only need to replace 'username' by your user and similarly the password.
After this - python manage.py makemigrations and then migrate

On Wed, Jan 23, 2019 at 12:28 PM RETAIL CYBER  wrote:

> has anyone ever install the django on a live web hosting service? if so
> when it comes to using db is the db virtual just like djangoEnv or do i use
> the mysql thats on my host? i have a vsp??
>
> --
> 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/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*Anirudh Jain* | *Appreciate you taking time to read the mail.*

-- 
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/CAC3mK7d3nUo%3DUy_%2B0yd8q_nvXHZbcRZmPoZAhuX-Rgg8wb%2BeTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Poll Tutorial: I'm stuck I have mysql on my vps I created the database

2019-01-22 Thread RETAIL CYBER
has anyone ever install the django on a live web hosting service? if so 
when it comes to using db is the db virtual just like djangoEnv or do i use 
the mysql thats on my host? i have a vsp??

-- 
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/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Poll Tutorial: I'm stuck I have mysql on my vps I created the database

2019-01-22 Thread RETAIL CYBER
all tutorials ive seen is in the view of someone doing it on a home pc
how can i connect to mysql thats already on my vps server. its with centos 
linx


im following this tutorial
https://docs.djangoproject.com/en/2.0/intro/tutorial02/


what I altered below:


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'urbanpyt_polls',
'USER': 'urbanpyt_dbz',
'PASSWORD': 'shawn316613'
'HOST': 'localhost',
'port': '',
}
}

-- 
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/554da5eb-099b-46be-9332-913ba6643752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Migration stuck when running schema migration + data migration in the same migration file with postgres replication

2019-01-08 Thread Marcelo Theodoro
We had the folllowing problem:
- We created a migration file that was adding a new field in one table
- In the same migration file of the schema migration, we also added a data 
migration to populate this field

Locally and in our sandbox the migration worked fine, without problem. It 
took ~30 seconds.

But in production, the migration stuck for more than 20 minutes and we have 
to kill it.


The only difference between our sandbox and production system is that in 
the production we have postres replication.


To test more the problem, I added a postgres replica in sandbox and it also 
stuck in that migration.


So the problem is:
When we have:
 - A schema migration and a data migration in the same migration file
 - And a postgres replica active

The migration stuck.



If I separate the data migration in another file, the migration works fine.
If I add "atomic = False" in the migration declaration, everything works, 
even using just one file for schema and data migration.


I looking to know if it's a bug or some detail in our configuration. 
Someone knows anything about it? More ideas about how to debug 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/bcc98321-deb2-4b70-928b-014d89814097%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
hey Dylan, two days ago anthony said to troubleshoot myself, the answer was 
there only.Since i am a beginer i tried myself but couldn't find out the 
error also i was tired as i just reached from office and started questioning

On Friday, May 11, 2018 at 11:19:43 PM UTC+5:30, Dylan Reinhold wrote:
>
> Is it grounds hogs day, didn't this exact error get asked two days ago and 
> Daniel answered then?
>
> On Fri, May 11, 2018 at 10:40 AM, Daniel Hepper  > wrote:
>
>> The error message is a hint that Django is not properly initialized.
>>
>> My guess is that you are using a plain python shell, which you started 
>> using the command „python“.
>>
>> Use „python manage.py shell“ instead. As explained in part 2 of the 
>> tutorial, this properly initializes Django.
>>
>> Hope that helps,
>> Daniel
>>
>> P.S.: I really admire your persistence! I promise that all these error 
>> messages will make sense at some point, if you stick with it.
>>
>> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah > >:
>>
>> Exceptions:
>>
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import datetime
>> >>> from django.utils import timezone
>> >>> from polls.models import Question
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
>> class Question(models.Model):
>>   File "c:\python36\lib\site-packages\django\db\models\base.py", line 
>> 100, in __new__
>> app_config = apps.get_containing_app_config(module)
>>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, 
>> in get_containing_app_config
>> self.check_apps_ready()
>>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, 
>> in check_apps_ready
>> raise AppRegistryNotReady("Apps aren't loaded yet.")
>> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
>>
>> -- 
>> 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/01e57139-6ac4-45ac-837e-196980bec2ad%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...@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/64C35250-AA7C-4C78-9E64-4AE431F87DB7%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bcfd5c98-fe71-4d51-97e4-ac825e03cffa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Dylan Reinhold
Is it grounds hogs day, didn't this exact error get asked two days ago and
Daniel answered then?

On Fri, May 11, 2018 at 10:40 AM, Daniel Hepper 
wrote:

> The error message is a hint that Django is not properly initialized.
>
> My guess is that you are using a plain python shell, which you started
> using the command „python“.
>
> Use „python manage.py shell“ instead. As explained in part 2 of the
> tutorial, this properly initializes Django.
>
> Hope that helps,
> Daniel
>
> P.S.: I really admire your persistence! I promise that all these error
> messages will make sense at some point, if you stick with it.
>
> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah :
>
> Exceptions:
>
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import datetime
> >>> from django.utils import timezone
> >>> from polls.models import Question
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
> class Question(models.Model):
>   File "c:\python36\lib\site-packages\django\db\models\base.py", line
> 100, in __new__
> app_config = apps.get_containing_app_config(module)
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 244,
> in get_containing_app_config
> self.check_apps_ready()
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 127,
> in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
>
> --
> 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/01e57139-6ac4-45ac-837e-196980bec2ad%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/64C35250-AA7C-4C78-9E64-4AE431F87DB7%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHtg44DvcDb8ZvRw_bD7krC7XhM4OK666fc%3DgPyfzeEFMQQ%3Dag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
ok ok i got it thanks

On Friday, May 11, 2018 at 11:11:00 PM UTC+5:30, Daniel Hepper wrote:
>
> The error message is a hint that Django is not properly initialized.
>
> My guess is that you are using a plain python shell, which you started 
> using the command „python“.
>
> Use „python manage.py shell“ instead. As explained in part 2 of the 
> tutorial, this properly initializes Django.
>
> Hope that helps,
> Daniel
>
> P.S.: I really admire your persistence! I promise that all these error 
> messages will make sense at some point, if you stick with it.
>
> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah  >:
>
> Exceptions:
>
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import datetime
> >>> from django.utils import timezone
> >>> from polls.models import Question
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
> class Question(models.Model):
>   File "c:\python36\lib\site-packages\django\db\models\base.py", line 100, 
> in __new__
> app_config = apps.get_containing_app_config(module)
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, 
> in get_containing_app_config
> self.check_apps_ready()
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, 
> in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
>
> -- 
> 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/01e57139-6ac4-45ac-837e-196980bec2ad%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/6c4bfe92-a9f1-43f7-84f6-1fb23499c00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Avitab Ayan Sarmah
i wrote the code inside mysite directory but still the error shows

On Friday, May 11, 2018 at 11:11:00 PM UTC+5:30, Daniel Hepper wrote:
>
> The error message is a hint that Django is not properly initialized.
>
> My guess is that you are using a plain python shell, which you started 
> using the command „python“.
>
> Use „python manage.py shell“ instead. As explained in part 2 of the 
> tutorial, this properly initializes Django.
>
> Hope that helps,
> Daniel
>
> P.S.: I really admire your persistence! I promise that all these error 
> messages will make sense at some point, if you stick with it.
>
> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah  >:
>
> Exceptions:
>
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import datetime
> >>> from django.utils import timezone
> >>> from polls.models import Question
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
> class Question(models.Model):
>   File "c:\python36\lib\site-packages\django\db\models\base.py", line 100, 
> in __new__
> app_config = apps.get_containing_app_config(module)
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, 
> in get_containing_app_config
> self.check_apps_ready()
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, 
> in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
>
> -- 
> 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/01e57139-6ac4-45ac-837e-196980bec2ad%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/182c032b-6957-4be7-a04e-26de1a7cab6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to reso

2018-05-11 Thread Daniel Hepper
The error message is a hint that Django is not properly initialized.

My guess is that you are using a plain python shell, which you started using 
the command „python“.

Use „python manage.py shell“ instead. As explained in part 2 of the tutorial, 
this properly initializes Django.

Hope that helps,
Daniel

P.S.: I really admire your persistence! I promise that all these error messages 
will make sense at some point, if you stick with it.

> Am 11.05.2018 um 19:08 schrieb Avitab Ayan Sarmah :
> 
> Exceptions:
> 
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import datetime
> >>> from django.utils import timezone
> >>> from polls.models import Question
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
> class Question(models.Model):
>   File "c:\python36\lib\site-packages\django\db\models\base.py", line 100, in 
> __new__
> app_config = apps.get_containing_app_config(module)
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, in 
> get_containing_app_config
> self.check_apps_ready()
>   File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, in 
> check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
> -- 
> 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/01e57139-6ac4-45ac-837e-196980bec2ad%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/64C35250-AA7C-4C78-9E64-4AE431F87DB7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


While going through the django tutorial i stuck while writing a code i.e., automated test.And error is showing with some tracebacks.I tried to resolve the error but i failed.Please help me to resolve

2018-05-11 Thread Avitab Ayan Sarmah
Exceptions:

Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> from django.utils import timezone
>>> from polls.models import Question
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\AVITABAYAN\mysite\polls\models.py", line 7, in 
class Question(models.Model):
  File "c:\python36\lib\site-packages\django\db\models\base.py", line 100, 
in __new__
app_config = apps.get_containing_app_config(module)
  File "c:\python36\lib\site-packages\django\apps\registry.py", line 244, 
in get_containing_app_config
self.check_apps_ready()
  File "c:\python36\lib\site-packages\django\apps\registry.py", line 127, 
in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

-- 
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/01e57139-6ac4-45ac-837e-196980bec2ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Stuck at Tutorial 1

2017-02-01 Thread ludovic coues
Sharing the contents of polls/urls.py could help but I assume you didn't
make any errors on the first line. To be sure, you can add a comment on the
first line and leave the second line blank.
If you still have an error on line 1, it might be related to how you save
your file. Python might not like utf8 with BOM.

I hope that helps you

On 1 Feb 2017 1:32 p.m., "Zhou Sicong"  wrote:

> Hi,
>
>   I tried doing exactly everything as told in Tutorial 1 (
> https://docs.djangoproject.com/en/1.10/intro/tutorial01/)
>   I use idle to write the polls.py and urls.py
>   Do i totally overwrite the code already in those file or leave them
> alone and add on the codes in the tutorial.
>
>   Because i always get this when i start run the server again. What could
> possibly be the error?
>
>
>
> Performing system checks...
>
> Unhandled exception in thread started by  check_errors..wrapper at 0x03C7D978>
> Traceback (most recent call last):
>   File "c:\django\django\utils\autoreload.py", line 226, in wrapper
> fn(*args, **kwargs)
>   File "c:\django\django\core\management\commands\runserver.py", line
> 125, in inner_run
> self.check(display_num_errors=True)
>   File "c:\django\django\core\management\base.py", line 356, in check
> include_deployment_checks=include_deployment_checks,
>   File "c:\django\django\core\management\base.py", line 343, in
> _run_checks
> return checks.run_checks(**kwargs)
>   File "c:\django\django\core\checks\registry.py", line 78, in run_checks
> new_errors = check(app_configs=app_configs)
>   File "c:\django\django\core\checks\urls.py", line 13, in
> check_url_config
> return check_resolver(resolver)
>   File "c:\django\django\core\checks\urls.py", line 23, in check_resolver
> return check_method()
>   File "c:\django\django\urls\resolvers.py", line 247, in check
> for pattern in self.url_patterns:
>   File "c:\django\django\utils\functional.py", line 31, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "c:\django\django\urls\resolvers.py", line 398, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
>   File "c:\django\django\utils\functional.py", line 31, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
>   File "c:\django\django\urls\resolvers.py", line 391, in urlconf_module
> return import_module(self.urlconf_name)
>   File "C:\Users\SzeChong\AppData\Local\Programs\Python\
> Python35-32\lib\importlib\__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in
> _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 662, in exec_module
>   File "", line 222, in
> _call_with_frames_removed
>   File "C:\mysite\mysite\urls.py", line 20, in 
> url(r'^polls/', include('polls.urls')),
>   File "c:\django\django\conf\urls\__init__.py", line 39, in include
> urlconf_module = import_module(urlconf_module)
>   File "C:\Users\SzeChong\AppData\Local\Programs\Python\
> Python35-32\lib\importlib\__init__.py", line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in
> _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 658, in exec_module
>   File "", line 764, in get_code
>   File "", line 724, in
> source_to_code
>   File "", line 222, in
> _call_with_frames_removed
>   File "C:\mysite\polls\urls.py", line 1
> Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900
> 32 bit (Intel)] on win32
>  ^
> SyntaxError: invalid syntax
>
> --
> 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/CAF_57Gsq7nM5bJNGhhdoomQV9ywJ6pN5A
> gOfdGVYXe2jzFn4sg%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 

Re: Stuck at Tutorial 1

2017-02-01 Thread Nibil M S
There is some syntax error in the file. Please ensure that your file is 
following python syntax. I hope you know basics of python.





 On Wed, 01 Feb 2017 13:17:39 +0530 Zhou Sicong 
genie10...@gmail.com wrote 




Hi, 



  I tried doing exactly everything as told in Tutorial 1 
(https://docs.djangoproject.com/en/1.10/intro/tutorial01/)

  I use idle to write the polls.py and urls.py

  Do i totally overwrite the code already in those file or leave them alone and 
add on the codes in the tutorial. 



  Because i always get this when i start run the server again. What could 
possibly be the error?







Performing system checks...



Unhandled exception in thread started by function 
check_errors.locals.wrapper at 0x03C7D978

Traceback (most recent call last):

  File "c:\django\django\utils\autoreload.py", line 226, in wrapper

fn(*args, **kwargs)

  File "c:\django\django\core\management\commands\runserver.py", line 125, in 
inner_run

self.check(display_num_errors=True)

  File "c:\django\django\core\management\base.py", line 356, in check

include_deployment_checks=include_deployment_checks,

  File "c:\django\django\core\management\base.py", line 343, in _run_checks

return checks.run_checks(**kwargs)

  File "c:\django\django\core\checks\registry.py", line 78, in run_checks

new_errors = check(app_configs=app_configs)

  File "c:\django\django\core\checks\urls.py", line 13, in check_url_config

return check_resolver(resolver)

  File "c:\django\django\core\checks\urls.py", line 23, in check_resolver

return check_method()

  File "c:\django\django\urls\resolvers.py", line 247, in check

for pattern in self.url_patterns:

  File "c:\django\django\utils\functional.py", line 31, in __get__

res = instance.__dict__[self.name] = self.func(instance)

  File "c:\django\django\urls\resolvers.py", line 398, in url_patterns

patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

  File "c:\django\django\utils\functional.py", line 31, in __get__

res = instance.__dict__[self.name] = self.func(instance)

  File "c:\django\django\urls\resolvers.py", line 391, in urlconf_module

return import_module(self.urlconf_name)

  File 
"C:\Users\SzeChong\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
 line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

  File "frozen importlib._bootstrap", line 986, in _gcd_import

  File "frozen importlib._bootstrap", line 969, in _find_and_load

  File "frozen importlib._bootstrap", line 958, in 
_find_and_load_unlocked

  File "frozen importlib._bootstrap", line 673, in _load_unlocked

  File "frozen importlib._bootstrap_external", line 662, in exec_module

  File "frozen importlib._bootstrap", line 222, in 
_call_with_frames_removed

  File "C:\mysite\mysite\urls.py", line 20, in module

url(r'^polls/', include('polls.urls')),

  File "c:\django\django\conf\urls\__init__.py", line 39, in include

urlconf_module = import_module(urlconf_module)

  File 
"C:\Users\SzeChong\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
 line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

  File "frozen importlib._bootstrap", line 986, in _gcd_import

  File "frozen importlib._bootstrap", line 969, in _find_and_load

  File "frozen importlib._bootstrap", line 958, in 
_find_and_load_unlocked

  File "frozen importlib._bootstrap", line 673, in _load_unlocked

  File "frozen importlib._bootstrap_external", line 658, in exec_module

  File "frozen importlib._bootstrap_external", line 764, in get_code

  File "frozen importlib._bootstrap_external", line 724, in 
source_to_code

  File "frozen importlib._bootstrap", line 222, in 
_call_with_frames_removed

  File "C:\mysite\polls\urls.py", line 1

Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 
bit (Intel)] on win32

 ^

SyntaxError: invalid syntax





--

 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/CAF_57Gsq7nM5bJNGhhdoomQV9ywJ6pN5AgOfdGVYXe2jzFn4sg%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 

Stuck at Tutorial 1

2017-02-01 Thread Zhou Sicong
Hi,

  I tried doing exactly everything as told in Tutorial 1 (
https://docs.djangoproject.com/en/1.10/intro/tutorial01/)
  I use idle to write the polls.py and urls.py
  Do i totally overwrite the code already in those file or leave them alone
and add on the codes in the tutorial.

  Because i always get this when i start run the server again. What could
possibly be the error?



Performing system checks...

Unhandled exception in thread started by .wrapper at 0x03C7D978>
Traceback (most recent call last):
  File "c:\django\django\utils\autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
  File "c:\django\django\core\management\commands\runserver.py", line 125,
in inner_run
self.check(display_num_errors=True)
  File "c:\django\django\core\management\base.py", line 356, in check
include_deployment_checks=include_deployment_checks,
  File "c:\django\django\core\management\base.py", line 343, in _run_checks
return checks.run_checks(**kwargs)
  File "c:\django\django\core\checks\registry.py", line 78, in run_checks
new_errors = check(app_configs=app_configs)
  File "c:\django\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
  File "c:\django\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
  File "c:\django\django\urls\resolvers.py", line 247, in check
for pattern in self.url_patterns:
  File "c:\django\django\utils\functional.py", line 31, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "c:\django\django\urls\resolvers.py", line 398, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
  File "c:\django\django\utils\functional.py", line 31, in __get__
res = instance.__dict__[self.name] = self.func(instance)
  File "c:\django\django\urls\resolvers.py", line 391, in urlconf_module
return import_module(self.urlconf_name)
  File
"C:\Users\SzeChong\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 662, in exec_module
  File "", line 222, in
_call_with_frames_removed
  File "C:\mysite\mysite\urls.py", line 20, in 
url(r'^polls/', include('polls.urls')),
  File "c:\django\django\conf\urls\__init__.py", line 39, in include
urlconf_module = import_module(urlconf_module)
  File
"C:\Users\SzeChong\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 658, in exec_module
  File "", line 764, in get_code
  File "", line 724, in source_to_code
  File "", line 222, in
_call_with_frames_removed
  File "C:\mysite\polls\urls.py", line 1
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900
32 bit (Intel)] on win32
 ^
SyntaxError: invalid syntax

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


Re: Stuck on tutorial your first Django app part 2

2016-06-10 Thread Neil Hunt
I just went through the tutorial again to check what the definition of my 
__str__() method was and I noticed where the tutorial says to add a custom 
method to polls/models.py. Before I copied and pasted a whole new object 
and method to the file instead of adding the custom method to the object. 
The next bit works now, hurray. Sorry to ask such a stupid question. Thanks 
a lot for your speedy reply.

On Thursday, June 9, 2016 at 10:03:18 PM UTC+1, ke1g wrote:
>
> What is the definition of your __str__() method?
>
> On Thu, Jun 9, 2016 at 4:11 PM, Neil Hunt <hunt...@gmail.com 
> > wrote:
>
>> Hello,
>>
>> I'm enjoying the tutorial and now I'm stuck on the second page (writing 
>> your first Django app part 2), shortly after this paragraph.
>>
>> 'It’s important to add __str__() 
>> <https://docs.djangoproject.com/en/1.9/ref/models/instances/#django.db.models.Model.__str__>
>>  
>> methods to your models, not only for your own convenience when dealing with 
>> the interactive prompt, but also because objects’ representations are used 
>> throughout Django’s automatically-generated admin.'
>>
>> The tutorial says to go into the interactive shell again.
>>
>> This line runs without error.
>>
>> 'from polls.models import Question, Choice'
>>
>> The next line Question.objects.all() results in
>>
>> '[]' instead of 
>>
>> '[]'
>>
>> Any help would be much 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...@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/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/6cfb84a1-8483-4d2b-bfbe-b90d990746e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Stuck on tutorial your first Django app part 2

2016-06-09 Thread Bill Freeman
What is the definition of your __str__() method?

On Thu, Jun 9, 2016 at 4:11 PM, Neil Hunt <hunt.n...@gmail.com> wrote:

> Hello,
>
> I'm enjoying the tutorial and now I'm stuck on the second page (writing
> your first Django app part 2), shortly after this paragraph.
>
> 'It’s important to add __str__()
> <https://docs.djangoproject.com/en/1.9/ref/models/instances/#django.db.models.Model.__str__>
> methods to your models, not only for your own convenience when dealing with
> the interactive prompt, but also because objects’ representations are used
> throughout Django’s automatically-generated admin.'
>
> The tutorial says to go into the interactive shell again.
>
> This line runs without error.
>
> 'from polls.models import Question, Choice'
>
> The next line Question.objects.all() results in
>
> '[]' instead of
>
> '[]'
>
> Any help would be much 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/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAB%2BAj0un20P4O3hd%3DvyRk6FOqO9c3KoN8xYEd7%3DCsXyCaDAoKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Stuck on tutorial your first Django app part 2

2016-06-09 Thread Neil Hunt
Hello,

I'm enjoying the tutorial and now I'm stuck on the second page (writing 
your first Django app part 2), shortly after this paragraph.

'It’s important to add __str__() 
<https://docs.djangoproject.com/en/1.9/ref/models/instances/#django.db.models.Model.__str__>
 
methods to your models, not only for your own convenience when dealing with 
the interactive prompt, but also because objects’ representations are used 
throughout Django’s automatically-generated admin.'

The tutorial says to go into the interactive shell again.

This line runs without error.

'from polls.models import Question, Choice'

The next line Question.objects.all() results in

'[]' instead of 

'[]'

Any help would be much 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/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django (stuck at the end of the tutorial)

2016-05-01 Thread Cronos Cto
Ty Aeron I will check it out.

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


Re: New to Django (stuck at the end of the tutorial)

2016-04-30 Thread Aaron Poncé
Just a related/unrelated sidenote.. I'm also new to Django and I found an 
amazing tutorial series on youtube... Just wanted to share it with you: 

https://youtu.be/FNQxxpM1yOs?list=PLQVvvaa0QuDeA05ZouE4OzDYLHY-XH-Nd

It's a 12 part series and it really helped me get the ball rolling



On Tuesday, April 26, 2016 at 12:33:09 AM UTC-7, Cronos Cto wrote:
>
>
> Hello Django Lovers.
>
> So I started on Django as project of mine. Seems like a great first 
> framework to start on. At the moment I am stuck at this:
>
>
>
> <https://lh3.googleusercontent.com/-lP0oAE5EZAA/Vx7HXX0Me4I/AH0/1s25myal0jYxvTkpRswWG5W9xzZ01uorwCLcB/s1600/problema1.png>
> This was after what I encountered at the end of the Django oficial post 
> app tutorial.
>
> I tried several ways to solve it. The problem seems to lay in the url.py 
> file, but I can not seem to solve it.
>
>
> <https://lh3.googleusercontent.com/-rUiOqjxXf_8/Vx7I3msoaQI/AIA/jA6oLTlafUsIjnq1fCjUTwrs_omppIHIQCLcB/s1600/file1.png>
>
> Thank you to anyone that can help me solve 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4706b1f9-0acb-48d0-b264-a54c252430dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django (stuck at the end of the tutorial)

2016-04-29 Thread Mie Rex
I just did another try with a different version of Django which is same 
version of Django used in the book I am reading.
It turns out where the project(mysite) saved has no effect on it.  I think 
it's how Django suppose to behave.
Perhaps you are not working with the same version of Django as the 
tutorial??

The sense of achievement is great once the view function starts to working 
and progress are being made.
I hope you could figure out your problem soon.
Cheers~

Mie Rex於 2016年4月27日星期三 UTC-7下午7時02分56秒寫道:
>
> I had a smiliar problem with another Django tutorial.
>>
>
> I was running Django with Anaconda environment and I took the advice from 
> "Two Scoop Django" to have all projects stored in one directory and all the 
> environment in another.  Therefore the project "mysite" was initialized and 
> put in a folder, which was parallel to the environment folder.
> I fixed all the problem by initializing the project inside the environment 
> used for Django.
>
> Took me 3 days to figure out what was the problem.
> Hope you could figure out how to fix that soon.
> Cheers
>

-- 
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/f0794dab-736d-43a3-8b93-2ac69178e7bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   >