These are chat archives for django/django

5th
Aug 2015
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 15:01
Hey guys!
I'm following Django girls tutorial. Everything was working fine until I reached chapter Django urls. I did everything as mentioned in the tutorial but the localhost url is not working. I get the error saying that 'web page is not available'.
André Duarte
@clint74
Aug 05 2015 15:03
@SudarshiniTyagi could you put the link for this tutorial and if possible the code of your urls.py?
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 15:04
André Duarte
@clint74
Aug 05 2015 15:07
Wich one is giving you an error, the root or admin? urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'', include('blog.urls')), ]
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 15:39
the root
Actually none of them is available
Mir Nazim
@mnazim
Aug 05 2015 15:43
@SudarshiniTyagi what do you see when you go to http://localhost:8000/
André Duarte
@clint74
Aug 05 2015 15:45
@SudarshiniTyagi ok, so I believe you provided the blog app and the respective urls.py inside blog folder. Correct?
André Duarte
@clint74
Aug 05 2015 15:50
@mnazim @SudarshiniTyagi Following the tutorial I saw that the error is expected once the view will be created only in step 14. Am I right?
Mir Nazim
@mnazim
Aug 05 2015 15:50
Haven’t actually seen the tutorial.
Just had a look. Yes, that image is misleading. Readers have not actually been asked to setup urls yet. So yes it won’t work urls are actually setup.
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 17:12
@mnazim It says "webpage not available"
Mir Nazim
@mnazim
Aug 05 2015 17:13
did you run python manage.py runserver command in your project directory?
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 17:13
How do I setup urls
Oh no
Mir Nazim
@mnazim
Aug 05 2015 17:13
Please run and try again:
cd path/to/project
python manage.py runserver
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 17:14
Yeah it works now
Mir Nazim
@mnazim
Aug 05 2015 17:14
:thumbsup:
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 17:14
Thanks a lot :) I completely forgot about that
Mir Nazim
@mnazim
Aug 05 2015 17:15
no problem.
Sudarshini Tyagi
@SudarshiniTyagi
Aug 05 2015 17:26
@clint74 I had done step 14 too... Just didn't start the server. Silly mistake :P
André Duarte
@clint74
Aug 05 2015 17:28
@SudarshiniTyagi hahahaha, happens all the time with me. :smile:
milad.kh
@iMilad
Aug 05 2015 20:46
does someone know why django-admin has problem in Ubuntu 14.04 when I use virtualenv ?
I use miniconda
this is the error:
import hmac
  File "/home/user/miniconda/lib/python2.7/hmac.py", line 8, in <module>
    from operator import _compare_digest as compare_digest
ImportError: cannot import name _compare_digest
André Duarte
@clint74
Aug 05 2015 20:51
there is no problem in using virtualenv in Ubuntu 14.04
milad.kh
@iMilad
Aug 05 2015 20:52
I can install django but when I want to start a project then I got this error
André Duarte
@clint74
Aug 05 2015 20:53
You must watch in your site-packages to see if 'operator' package or folder exists
if exists, maybe we have an file permission problem
milad.kh
@iMilad
Aug 05 2015 20:57
how should I check it ?
André Duarte
@clint74
Aug 05 2015 20:58
ls /home/user/miniconda/lib/python2.7/
there is a site-packages folder???
milad.kh
@iMilad
Aug 05 2015 20:59
yes there is
André Duarte
@clint74
Aug 05 2015 21:00
and there is an operator folder inside site-packages?

another alternative is to run Python within your virtualenv and try to

import operator

to see if the main package exists

milad.kh
@iMilad
Aug 05 2015 21:02
no there isn't
but I can import operator
python version is 2.7.6 in virtualenv but global is 2.7.10 ... could be a problem ?
André Duarte
@clint74
Aug 05 2015 21:05
@iMilad hmmm... operator is installed globaly. This is not a problem

Have you tried on shell

from operator import _compare_digest as compare_digest

?

milad.kh
@iMilad
Aug 05 2015 21:09
This message was deleted
cannot import name _compare_digest
André Duarte
@clint74
Aug 05 2015 21:49
@iMilad it seems to have an issue with python 2.7, try to install 2.8 and verify if persists on error