How start django server automatically using pytest-django

2018-07-07 Thread prakash sharma
Hi there,
I am facing issue that my django server is not started .
I want to run the pytest-django  for test cases without manual runserver.

Here is my test file:

import requests

def test_demo():
response = requests.get('http://0.0.0.0:8000/' + "demo")
assert (response.status_code == 200)



Here is the cmd:
pytest .tests/test_demo.py --ds=my_project.settings



I am getting :
Failed to establish a new connection: [Errno 111] Connection refused


Is there is  a way that my django server will start automatically with 
pytest.

-- 
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/2c166097-9635-4dd0-828c-5b1f3006cf1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JSON serializable issue

2018-07-07 Thread Melvyn Sopacua
Hi,

> However i am not
> sure about it and i cannt find where to looking for. I am sending an
> attachment with the bug. I have many days with it.
> Thanks for any idea.


This looks like you're trying to store an exception in a session, using the 
JSON session backend. Since json doesn't know how to serialize an exception 
object, it bails out.

The underlying problem is that you're trying to store more then 80 chars into 
a field with max lenght 80. Without code, it is impossible to tell how the two 
relate.

-- 
Melvyn Sopacua

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


Re: How start django server automatically using pytest-django

2018-07-07 Thread Mikhailo Keda
read more about testing 
- https://docs.djangoproject.com/en/2.0/topics/testing/

you don't need to use requests, use testing client instead 
- https://docs.djangoproject.com/en/2.0/topics/testing/tools/#making-requests

-- 
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/a78fc84f-bc06-4e59-9eb2-fa392a1b74d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How start django server automatically using pytest-django

2018-07-07 Thread Mikhailo Keda
there is an example - 
https://bitbucket.org/voron-raven/tools-site/src/master/tool/tests/tests_views.py

>
to run tests:
python manage.py test

-- 
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/31815ceb-17d7-4c04-b9fd-c851e241006d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


from django.contrib.auth.views import login

2018-07-07 Thread Ahmad
hello everyone, 

when i import this line it's not working. 
from django.contrib.auth.views import login

My Django Versions is 2.0



from django.conf.urls import url
from . import views
from django.contrib.auth.views import login

urlpatterns = [
url(r'^$',views.home),
url(r'^login/$', login, {'template_name': 'accounts/login.html'}),
  
]


error : 


 from django.contrib.auth.views import login
ImportError: cannot import name 'login'

-- 
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/a97b6e1a-0990-4ab7-9833-37a0d10b8df6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django object to json

2018-07-07 Thread Kamal Sharma
hi,

I am facing a problem to get data from database in form of JSON.

data = model.objects.all()

now i have a big list in data and want to convert it into JSON.
how can i do it.

Thanks

Kamal Sharma

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


Re: How start django server automatically using pytest-django

2018-07-07 Thread Kamal Sharma
do you want to test on development server??


On Sat, Jul 7, 2018 at 1:17 PM, prakash sharma 
wrote:

> Hi there,
> I am facing issue that my django server is not started .
> I want to run the pytest-django  for test cases without manual runserver.
>
> Here is my test file:
>
> import requests
>
> def test_demo():
> response = requests.get('http://0.0.0.0:8000/' + "demo")
> assert (response.status_code == 200)
>
>
>
> Here is the cmd:
> pytest .tests/test_demo.py --ds=my_project.settings
>
>
>
> I am getting :
> Failed to establish a new connection: [Errno 111] Connection refused
>
>
> Is there is  a way that my django server will start automatically with
> pytest.
>
> --
> 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/2c166097-9635-4dd0-828c-5b1f3006cf1e%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/CAHfh8PT4-0XPerJJJfyi52peyxhyKQ1P_HRZurWzKRCC0zcQ0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: from django.contrib.auth.views import login

2018-07-07 Thread Jason
you want LoginView

https://docs.djangoproject.com/en/2.0/topics/auth/default/#django.contrib.auth.views.LoginView

On Saturday, July 7, 2018 at 7:42:53 AM UTC-4, Ahmad wrote:
>
> hello everyone, 
>
> when i import this line it's not working. 
> from django.contrib.auth.views import login
>
> My Django Versions is 2.0
>
>
>
> from django.conf.urls import url
> from . import views
> from django.contrib.auth.views import login
>
> urlpatterns = [
> url(r'^$',views.home),
> url(r'^login/$', login, {'template_name': 'accounts/login.html'}),
>   
> ]
>
>
> error : 
>
>
>  from django.contrib.auth.views import login
> ImportError: cannot import name 'login'
>

-- 
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/58ebf268-8ad6-422b-a693-63c0fca02ce3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How start django server automatically using pytest-django

2018-07-07 Thread prakash sharma

@Mikhailo I agree, that we should not use requests. But then what is point 
of using pytest-django then??
I am using pytest-django with the hope that it will manage and restart the 
server itself.


On Saturday, July 7, 2018 at 4:41:25 PM UTC+5:30, Mikhailo Keda wrote:
>
> read more about testing - 
> https://docs.djangoproject.com/en/2.0/topics/testing/
>
> you don't need to use requests, use testing client instead - 
> https://docs.djangoproject.com/en/2.0/topics/testing/tools/#making-requests
>

-- 
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/2a27f655-c163-41f8-9de0-c834b63fe2a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


edit page (form) not shown

2018-07-07 Thread BeginnerB
Hi, I am really junior into Django. Really loving it, but stuck on this for 
2 weeks.

I have a models (ImpCalendar), which has a ForeignKey to Establishments. I 
do not use that foreignkey in the view/form so i don't know if it is 
relevant.
I want to have a form for the ImpCalendar so I can edit it.
The url should have the calendar_id, which i set in the urls.py

If i in views.py do;
return render(request, 'importer/calendaredit.html', {'form': calendar})
i do see the data on a page, but not a (edit) form. Just the data, not the 
fill-in fields.

When i do
return render(request, 'importer/calendaredit.html', {'form': form})
which sounds logical to me, I get the error

django.urls.exceptions.NoReverseMatch: Reverse for 'calendaredit' with 
arguments '('',)' not found. 1 pattern(s) tried: [
'importer\\/calendar\\/(?P[0-9]+)\\/$']

It seems to me, the value returned for the calendar_id is now forms-data 
(html) which it can not do anything with.  But i don't know what I am doing 
wrong.



models.py
class Impcalendar(models.Model):
establishment = models.ForeignKey(Establishments, on_delete=SET_NULL, 
null=True)
url = models.CharField(max_length=255)
comment = models.CharField(max_length=255, null=True, blank=True)
status = models.IntegerField(null=True, blank=True)
def __str__(self):
return str(self.establishment)

forms.py
from django import forms
import datetime
from importer.models import Impcalendar, Establishments

class ImpcalendarForm(forms.ModelForm):
class Meta:
model = Impcalendar
fields = ['id', 'url'] 

urls.py
from django.urls import path
from importer import views

urlpatterns = [
path('', views.index, name='index'),
path('calendar//', views.calendaredit, name=
'calendaredit')
]

views.py
def calendaredit(request, calendar_id):
calendar = get_object_or_404(Impcalendar, pk=calendar_id)

print (calendar.url)
if request.method == 'POST':
form = ImpcalendarForm(request.POST, instance=calendar)
if form.is_valid():
calendar.save()
else:
form = ImpcalendarForm(request.POST or None, instance=calendar)
return render(request, 'importer/calendaredit.html', {'form': form})

calendaredit.html
{% extends 'importer/base.html' %}
{% block content %}
{{ form.id }}

{% if error_message %}{{ error_message }}{% endif %}


   
  {% csrf_token %}
  {{ form.id }}
  {{ form.url }}
   



{% endblock %}

I did read the tutorial and the forms documentation on the site, but i am 
making a mistake a probably overlook.

-- 
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/d40fd9e5-69fc-4c90-a6da-e685e57d6af2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How start django server automatically using pytest-django

2018-07-07 Thread prakash sharma
RE:'do you want to test on development server'
NO, Drone is running the test cases.I don't want to run the runserver 
command.

On Saturday, July 7, 2018 at 5:12:51 PM UTC+5:30, Kamal Sharma wrote:
>
> do you want to test on development server??
>
>
> On Sat, Jul 7, 2018 at 1:17 PM, prakash sharma  > wrote:
>
>> Hi there,
>> I am facing issue that my django server is not started .
>> I want to run the pytest-django  for test cases without manual runserver.
>>
>> Here is my test file:
>>
>> import requests
>>
>> def test_demo():
>> response = requests.get('http://0.0.0.0:8000/' + "demo")
>> assert (response.status_code == 200)
>>
>>
>>
>> Here is the cmd:
>> pytest .tests/test_demo.py --ds=my_project.settings
>>
>>
>>
>> I am getting :
>> Failed to establish a new connection: [Errno 111] Connection refused
>>
>>
>> Is there is  a way that my django server will start automatically with 
>> pytest.
>>
>> -- 
>> 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/2c166097-9635-4dd0-828c-5b1f3006cf1e%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/d18ca5b1-6426-405b-8348-91c13ace1bb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django object to json

2018-07-07 Thread Mikhailo Keda
check - http://www.django-rest-framework.org/api-guide/serializers/

-- 
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/9767bdaa-9a2f-4331-90bf-b1049ff23544%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django object to json

2018-07-07 Thread Mikhailo Keda
check - https://docs.djangoproject.com/en/2.0/topics/serialization/

-- 
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/1e28dee5-4b40-4167-aac8-aba16a463724%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django object to json

2018-07-07 Thread Bob Gailer
On Jul 7, 2018 7:42 AM, "Kamal Sharma"  wrote:
>
> hi,
>
> I am facing a problem to get data from database in form of JSON.
>
> data = model.objects.all()
>
> now i have a big list in data and want to convert it into JSON.
> how can i do it.

import json
json_biglist = json.dumps(biglist)

Django may offer an alternative.

>
> Thanks
>
> Kamal Sharma
>
> --
> 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/CAHfh8PQmAZ5EB4ENunxjwdd%3DQcXDH-x8db9e6kP%2BtuY2Zr8vxw%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/CAP1rxO6CidFamw_L-160U_jkXq9pGDp-ajzHqsXFMQEasBtJkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Fresh Django with mod_wsgi and apache goes Time Out on 18.04

2018-07-07 Thread Mohammad Etemaddar
I have installed Ubuntu server 18.04 and *VirtualMin* on it. installed 
python3-pip and then virtualenv.
Also installed *libapache2-mod-wsgi-py3*
Created new virtual server and configured the modwsgi for it.
Also created fresh django website for it.
But I get Timeout error!
Here is my apache configuration for mod_wsgi:

Code:

WSGIDaemonProcess username.ir python-home=/home/username/venv 
python-path=/home/username/website
WSGIProcessGroup username.ir


Alias /media/ /home/username/website/media/
Alias /static/ /home/username/website/static/


Require all granted



Require all granted


WSGIScriptAlias / /home/username/website/website/wsgi.py



Require all granted



Django version: 1.11.14
I have configured website like this on a Debian 9 server and worked great.
How can I 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/95b2df4a-bba5-4cd6-9e28-f069fb092126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fresh Django with mod_wsgi and apache goes Time Out on 18.04

2018-07-07 Thread Kasper Laudrup

Hi Mohammad,

On 2018-07-07 16:26, Mohammad Etemaddar wrote:
I have installed Ubuntu server 18.04 and *VirtualMin* on it. installed 
python3-pip and then virtualenv.

Also installed *libapache2-mod-wsgi-py3*
Created new virtual server and configured the modwsgi for it.
Also created fresh django website for it.
But I get Timeout error!


Which kind of timeout do you get?

If you get a timeout when trying to access your site with eg. a browser, 
I would try to ssh to the host and try to connect to the site locally, 
eg. "telnet localhost 80". If that connects, then I would look into 
whether port 80 is open in a firewall or similar.


If you get a "504 Gateway Timeout", then there's an issue with the 
connection between Apache and the WSGI application. Possibly the Django 
app is not running?


I cannot really come with a solution, but I hope that can help you in 
troubleshooting.


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 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/8168bb9f-fb80-715e-caf5-8dd595c48d3c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: from django.contrib.auth.views import login

2018-07-07 Thread Phako Perez
hi,

instead of

from django.contrib.auth.views import login


you need to use

from django.contrib.auth import login

regards.

On Sat, Jul 7, 2018 at 6:41 AM, Ahmad  wrote:

> hello everyone,
>
> when i import this line it's not working.
> from django.contrib.auth.views import login
>
> My Django Versions is 2.0
>
>
>
> from django.conf.urls import url
> from . import views
> from django.contrib.auth.views import login
>
> urlpatterns = [
> url(r'^$',views.home),
> url(r'^login/$', login, {'template_name': 'accounts/login.html'}),
>
> ]
>
>
> error :
>
>
>  from django.contrib.auth.views import login
> ImportError: cannot import name 'login'
>
> --
> 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/a97b6e1a-0990-4ab7-9833-37a0d10b8df6%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/CAF%3Duzp3WLbxyNUORJKNs9L5MTG%2B7xDOoCO40CqCpsMGDUN554Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


help in understanding the sqlite3 backend

2018-07-07 Thread Sumit J
Hello,

I am trying to understand the sqlite3 backend, especially the 
register_converter part.

I wanted to understand why are those converters put in place?
I commented out this registration and even then was able to to query the 
database in django shell via the ORM..
Even raw query execution returned correct results.

Is it there to maintain backward compatibility ? (guessing)

Thank you

-- 
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/047f179e-8d10-4752-8a67-7480d5a7074f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JSON serializable issue

2018-07-07 Thread Luis
Dear Melvyn,
I had a week with this issue. Thanks to you i could to find the problem. I
am working with AWS and it change some names for its instances (+3 or 4
letters). Then it couldnt write to the database. Before, i thinked in this
solution but i was not sure and went for other solution. I change the
length of the column and into the code. It is working very well.
Thanks,
Luis




2018-07-07 4:32 GMT-05:00 Melvyn Sopacua :

> Hi,
>
> > However i am not
> > sure about it and i cannt find where to looking for. I am sending an
> > attachment with the bug. I have many days with it.
> > Thanks for any idea.
>
>
> This looks like you're trying to store an exception in a session, using
> the
> JSON session backend. Since json doesn't know how to serialize an
> exception
> object, it bails out.
>
> The underlying problem is that you're trying to store more then 80 chars
> into
> a field with max lenght 80. Without code, it is impossible to tell how the
> two
> relate.
>
> --
> Melvyn Sopacua
>
> --
> 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/Td7D655GLKI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/6363934.dWIXy7cGKv%40fritzbook.
> 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/CACnFoPpWrsr0xM%2BM07Y1qXb3AzamiNKbyxab-EgdN-2GQUc99g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


help, How can i solve this error please

2018-07-07 Thread Hambali Idrees Ibrahim






-- 
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/667914ce-d796-4a75-9a55-654508c7ee7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AttributeError:

2018-07-07 Thread Hambali Idrees Ibrahim
 

from django.conf.urls import url
from . import views
from django.contrib.auth import login, logout



urlpatterns = [
url(r'^$', views.home),
url(r'^login/$', login, {'template_name': 'accounts/login.html'}),
url(r'^logout/$', logout, {'template_name': 'accounts/logout.html'}),
url(r'^register/$', views.register, name='register')
]








File "C:\Users\Hambadrees\django\toturial\accounts\urls.py", line 11, in 

url(r'^register/$', views.register, name='register')
AttributeError: module 'accounts.views' has no attribute 'register'

-- 
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/a89b1e42-4a0f-4bf6-a9c5-34e724efbf8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help, How can i solve this error please

2018-07-07 Thread Ahmad Hassan
from django.contrib.auth.views import LoginView, LogoutView




urlpatterns = [


 url(r'^login/$', 
LoginView.as_view(template_name='accounts/login.html')),
 url(r'^logout/$', 
LogoutView.as_view(template_name='accounts/logout.html')),
]



On 7/8/18, Hambali Idrees Ibrahim  wrote:
>
>
> 
>
> 
>
> --
> 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/667914ce-d796-4a75-9a55-654508c7ee7d%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/CAFq2r%2BZQ_QxsSR8u%2BPSzvmyL1RR8pAniQreSLqODg%3DtjK_w%2BMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django wamp

2018-07-07 Thread thebobbobsled

Hi,
I'm a novice with django but have been setting up django on a Win7 Wamp 
stack.  We have several small non-django websites running on wamp.
Those projects are in c:/wamp/www/myproject for ex. and are accessed as 
localhost/myproject or myipxxx/myproject.

Under wamp I have tried putting the django project in c:/wamp/apps, in 
c:/wamp/www, and just in c:/wamp too.  They all work fine with apache and 
mod_wsgi.
At least I get a sample "helloworld" message in the webpage when I access 
the django site as localhost/mydjangosite or myipxxx/mydjangosite.  This is 
basically the simple tut01 or polls app kindof django project.

But the django project, wherever I put it in wamp, buggers our other 
non-django websites.  I get a message back from urls.py saying it's been 
thru all the urls listed and it cannot access our regular (non django 
sites) in c:/wamp/www when I try to access one as localhost/myproject or 
myipxxx/myproject from the browser.

I'm a bit stuck on how to get these two to play together nicely.  I'm not 
sure if it's a django project configuration, an apache httpd.conf problem, 
or a wamp issue.  I'm wondering if someone has experience with this issue 
and could point me in the right direction for how to use django, but 
continue to use localhost or myipxxx/ to access our non-django wamp sites.

Thank you,
Bob

-- 
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/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django wamp

2018-07-07 Thread m1chael
best not to fight Apache and just use nginx for django

On Sat, Jul 7, 2018, 11:07 PM  wrote:

>
> Hi,
> I'm a novice with django but have been setting up django on a Win7 Wamp
> stack.  We have several small non-django websites running on wamp.
> Those projects are in c:/wamp/www/myproject for ex. and are accessed as
> localhost/myproject or myipxxx/myproject.
>
> Under wamp I have tried putting the django project in c:/wamp/apps, in
> c:/wamp/www, and just in c:/wamp too.  They all work fine with apache and
> mod_wsgi.
> At least I get a sample "helloworld" message in the webpage when I access
> the django site as localhost/mydjangosite or myipxxx/mydjangosite.  This is
> basically the simple tut01 or polls app kindof django project.
>
> But the django project, wherever I put it in wamp, buggers our other
> non-django websites.  I get a message back from urls.py saying it's been
> thru all the urls listed and it cannot access our regular (non django
> sites) in c:/wamp/www when I try to access one as localhost/myproject or
> myipxxx/myproject from the browser.
>
> I'm a bit stuck on how to get these two to play together nicely.  I'm not
> sure if it's a django project configuration, an apache httpd.conf problem,
> or a wamp issue.  I'm wondering if someone has experience with this issue
> and could point me in the right direction for how to use django, but
> continue to use localhost or myipxxx/ to access our non-django wamp sites.
>
> Thank you,
> Bob
>
> --
> 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/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%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/CAAuoY6Nan7vxHE%3DLXAMYnMhh58%3DiV6DwFxQnt0FPBd7vvS6J_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django wamp

2018-07-07 Thread Gerald Brown

Is it possible to run 2 servers (Apache & Nginx) on the same system?

Maybe if they listen on different ports i.e. 80 & 81


On Sunday, 08 July, 2018 01:09 PM, m1chael wrote:

best not to fight Apache and just use nginx for django

On Sat, Jul 7, 2018, 11:07 PM > wrote:



Hi,
I'm a novice with django but have been setting up django on a Win7
Wamp stack.  We have several small non-django websites running on
wamp.
Those projects are in c:/wamp/www/myproject for ex. and are
accessed as localhost/myproject or myipxxx/myproject.

Under wamp I have tried putting the django project in
c:/wamp/apps, in c:/wamp/www, and just in c:/wamp too. They all
work fine with apache and mod_wsgi.
At least I get a sample "helloworld" message in the webpage when I
access the django site as localhost/mydjangosite or
myipxxx/mydjangosite.  This is basically the simple tut01 or polls
app kindof django project.

But the django project, wherever I put it in wamp, buggers our
other non-django websites.  I get a message back from urls.py
saying it's been thru all the urls listed and it cannot access our
regular (non django sites) in c:/wamp/www when I try to access one
as localhost/myproject or myipxxx/myproject from the browser.

I'm a bit stuck on how to get these two to play together nicely. 
I'm not sure if it's a django project configuration, an apache
httpd.conf problem, or a wamp issue.  I'm wondering if someone has
experience with this issue and could point me in the right
direction for how to use django, but continue to use localhost or
myipxxx/ to access our non-django wamp sites.

Thank you,
Bob
-- 
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/f9e69bf3-5192-41b9-9b80-d80617c9f5d9%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/CAAuoY6Nan7vxHE%3DLXAMYnMhh58%3DiV6DwFxQnt0FPBd7vvS6J_w%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/c1af585f-19c4-5cd0-7697-e167726ae65e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.