by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 16 2015 16:59
    olasitarska commented #362
  • May 16 2015 16:59

    olasitarska on master

    Making post_detail.html more co… Merge pull request #362 from ve… (compare)

  • May 16 2015 16:59
    olasitarska closed #362
  • May 16 2015 16:57
    kvbik commented #362
  • May 16 2015 16:51
    veuu opened #362
  • May 16 2015 15:20
    hjwp commented #361
  • May 16 2015 15:16
    hjwp synchronize #361
  • May 16 2015 15:15
    hjwp synchronize #361
  • May 16 2015 15:12
    bmispelon commented #361
  • May 16 2015 15:08
    hjwp opened #361
  • May 16 2015 14:58
    bmispelon opened #360
  • May 16 2015 13:15
    bmispelon commented #359
  • May 16 2015 13:15

    bmispelon on master

    Provide alternative runserver c… Merge pull request #359 from Al… (compare)

  • May 16 2015 13:15
    bmispelon closed #359
  • May 16 2015 13:14
    keimlink commented #359
  • May 16 2015 13:13
    olasitarska commented #359
  • May 16 2015 13:09
    bmispelon commented #359
  • May 16 2015 11:53
    Almad opened #359
  • May 15 2015 20:00
    bmispelon commented #358
  • May 15 2015 19:59

    bmispelon on master

    fixing broken github link Merge pull request #358 from gs… (compare)

HoBocPhat
@HoBocPhat
this is my error
Nikhil John
@nikhiljohn10
@seagulll13 You already know html, css, js and python. Maybe a basic knowledge of how a database work might help you. Then you need basic idea of how servers work, network works. That will be a kickstart. Try doing it and when you hit an error, google it and if still not solved, then ask here. Will be happy to help.
seagulll13
@seagulll13
thank you very much .
avraam1616
@avraam1616
I follow the djangogirls tuttorial and in the pythonanywhere sections BASH CONSOLE I write: ola.pythonanywhere.com) $ python manage.py createsuperuser, and I receive the error message:
I follow the djangogirls tuttorial and in the pythonanywhere sections BASH CONSOLE I write according to the istructions of the tuttorial: "ola.pythonanywhere.com) $ python manage.py createsuperuser ", and I receive the error message:
"bash: syntax error near unexpected token `)' ". Any help will be very appreciated as I am stuck with thiw and I cannot continue.
Nikhil John
@nikhiljohn10
@avraam1616 you only need to type python manage.py createsuperuser inside the terminal. The rest of what you see in tutorial is just for understanding.
3 replies
Nikhil John
@nikhiljohn10
Type ls in terminal and what do u see?
2 replies
Nikhil John
@nikhiljohn10
So it means that you not configured your pythonanywhere correctly. Go back to “Deploy” page in the djangogirls tutorial and try again from there. I bet thats where it went.
First check your github project page if it is correctly pushed. Because pythonanywhere pull the repo from that page. If you did not push your project in to github, then it make sense why you only got readme file.
Nikhil John
@nikhiljohn10
Also there is a possibility that you gave wrong repo link in to pythonanywhere. Check all these and i hope you figure it out. Cheers!
2 replies
keerthi
@keerthyakula_twitter
Hi, yesterday I created djangogirls project and finished few of my modules. Today when I try to activate my env in cmd. it is showing up as 'not recognised as internal command'. changed my directory to djangogirls. can someone help me out with this
Nikhil John
@nikhiljohn10
Need the “etc” part to debug.
keerthi
@keerthyakula_twitter
cmd shows as "myenv is not recognized as an internal or external command, operable program or batch file."
Nikhil John
@nikhiljohn10
@keerthyakula_twitter try “venv” ??
keerthi
@keerthyakula_twitter
'venv 'not working. But the environemt variable I created is 'myvenv'.
When we resume our coding we get into that directory and activate the env then coding goes on. Is this is the way of coding. I'm beginner to this django frmaework. Please don't mind for the beginner level queries
Nikhil John
@nikhiljohn10
. myvenv/bin/activate
Try that
. myvenv/bin/activate
keerthi
@keerthyakula_twitter
nops
not working
I can see myvenv file in one of my folders(djangogirls)
Nikhil John
@nikhiljohn10

@keerthyakula_twitter

# Initiate venv
python3 -m venv myvenv 

# Activate venv
. myvenv/bin/activate

Thats the simple work flow for venv. nothing else you normally need to get there.

keerthi
@keerthyakula_twitter
above code is for creating and activating right?
what if we need to activate the environment variable which is alreaady created?
just to resume our coding again
Nikhil John
@nikhiljohn10
Same activation command.
keerthi
@keerthyakula_twitter
I tried using above two commands one more myenv environment got created
Nikhil John
@nikhiljohn10
Good. Is it working with activation command?
keerthi
@keerthyakula_twitter
No. t's just creating one more env variable. but not able to activate either of them
Nikhil John
@nikhiljohn10
What is the terminal output to . myvenv/bin/activate?
keerthi
@keerthyakula_twitter
myenv is not recognized as an internal or external command, operable program or batch file.
Nikhil John
@nikhiljohn10
One more doubt... is it windows?
keerthi
@keerthyakula_twitter
yes
Nikhil John
@nikhiljohn10
No wonder. It’s probably path problem. Happens is windows 99% of time with linux related softwares. Not your mistake.
*in
Try this on windows powershell
myvenv\Scripts\activate
Nikhil John
@nikhiljohn10
🤞🏼 on linux, its pure logic that make a software work... in windows, we need lot of luck too due to the proprietary codes behind it. 😅
Nikhil John
@nikhiljohn10

@keerthyakula_twitter
Quote from django girls tutorial:

NOTE: on Windows 10 you might get an error in the Windows PowerShell that says execution of scripts is disabled on this system. In this case, open another Windows PowerShell with the "Run as Administrator" option. Then try typing the following command before starting your virtual environment:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Select “yes to all” option

Lily Perera Capetillo
@clicly
Hello girls , I'm looking for a job as a junior django developer or join a project to gain experience, I hope for your help
yubeen-Shin
@yubeen-Shin
Hi, i need help
path('post/<int:pk>/', views.post_detail, name='post_detail'), in tutorial.
Changed int to str(<str:pk). It is error(Field 'id' expected a number but got 'pk'.)
str not supported?
Nikhil John
@nikhiljohn10
In django model, “id” is autogenerated as int pk. So post = get_object_or 404(Post, pk=pk) need pk value as integer.
Nikhil John
@nikhiljohn10
If you want to pass a string try this..
path('post/<int:pk>/<mystr>/', views.post_detail, name='post_detail'),
Then..
def post_detail(request, pk, mystr):
    post = get_object_or_404(Post, title__startswith=mystr, pk=pk)
    return render(request, 'blog/post_detail.html', {'post': post})
yubeen-Shin
@yubeen-Shin
wow!! Thank you for your answer!!
Nikhil John
@nikhiljohn10

Correction

path('post/<slug:title>/', views.post_detail, name='post_detail'),
Then..
def post_detail(request, title):
post = get_object_or_404(Post, title=mystr)
return render(request, 'blog/post_detail.html', {'post': post})

You need to use “slug” type to pass any kind of string
Also no need to use pk at all if you just wanna search by string
keerthi
@keerthyakula_twitter
Yes! it's working. Thanks a lot :) @nikhiljohn10
Nikhil John
@nikhiljohn10
@keerthyakula_twitter Awesome. You are welcome 👍🏼
keerthi
@keerthyakula_twitter
Actually it is working in cmd itself. When I replaced '/' with '\' while activating environment variable @nikhiljohn10
Nikhil John
@nikhiljohn10
Yeah. There is always one thing or other that slow us down in windows while programming.