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)

Raphael Das Gupta
@das-g
In section "Your first Django URL!" of the "Django URLs" chapter, the tutorial gives this content for mysite/urls.py:
from django.contrib import admin
from django.urls import path, include  # ← This line should make `include` available.

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('blog.urls')),
]

There's some instructions above that code listing towards that end:

[…] You will also need to change the from django.urls… line because we are using the include function here, so you will need to add that import to the line.

(Maybe that could be worded more clearly.)

Nazrin H. Nazarudin
@nazrinhz
Ah yes. I did miss that step while I was setting up my code. Thanks for the clarification!
Lazyturtle0852
@Lazyturtle0852
Hello. I'm trying to install python to my MacBook (M1). I downloaded the Mac OS X 64-bit/32-bit installer and followed the instructions. However, when I entered python3 --version it returned zsh: killed python3 --version Any help will be appreciated.
Raphael Das Gupta
@das-g
For M1 Mac you'll probably have to use the "macOS 64-bit universal2 installer", @Lazyturtle0852. It seems to be available in Python 3.9 and higher.
Nazrin H. Nazarudin
@nazrinhz
Hi! I've just finished the CSS section of the tutorial. Everything works fine when I do local testings. But after I pull the same file from GitHub and running it on PythonAnywhere, the CSS settings doesn't seem to work anymore. Any ideas on this?
AbhigyaShridhar
@AbhigyaShridhar
@nazrinhz it might be caused by previously saved cache. Try ctr + alt + f5 and reload the page
Nazrin H. Nazarudin
@nazrinhz
Will it be cmd + opt + f5 for mac? and when do I press these combinations?
AbhigyaShridhar
@AbhigyaShridhar
You have to give this command after you've opened the web page you want to check css for. You'll have to check what the command is for Mac I've never used it😅 This should open the page in a new tab
Nazrin H. Nazarudin
@nazrinhz
I tried clearing the cache, reload the page, reload the page without cache. It's not working still. I can confirm that the CSS still works for localhost
Nazrin H. Nazarudin
@nazrinhz
After further digging, I had to execute python manage.py collectstatic on the PythonAnywhere bash to make it work. So the issue is resolved now.
AbhigyaShridhar
@AbhigyaShridhar
@nazrinhz Oh so you must have put DEBUG = False in settings. Static files aren't automatically loaded in non debug mode
1 reply
shubhaml1
@shubhaml1
Create a file .env at the 'root of your project' and add the following property in it: may i know what this line means in single quotes
shubhaml1
@shubhaml1
image.png
when I'm trying to generate random string it throws me a error can anyone look into screenshot above help me out
AbhigyaShridhar
@AbhigyaShridhar

Create a file .env at the 'root of your project' and add the following property in it: may i know what this line means in single quotes

root directory of a project is the directory which contains all the other files and folders of the project in it. For example:

myProject
 - app1
 - - file1
 - - file2
 - app2
 - - file1
 - - file2

If this is the structure of your project, myProject is your root directory. So you have to put your .env file here:

myProject
 - .env
 - app1
 - - file1
 - - file2
 - app2
 - - file1
 - - file2

To add a property in the .env file just do:
property_name = <value>

when I'm trying to generate random string it throws me a error can anyone look into screenshot above help me out

You have to show the code you are using to generate a random string. It's difficult to understand the problem using just an error message

shubhaml1
@shubhaml1
code snippet is above the error message also i'm attaching here: python -c 'from django.core.management.utils import get_random_secret_key; \ print(get_random_secret_key())'
shubhaml1
@shubhaml1
can you please answer what you mean by code as I've attached everything best of my knowledge if you need anything else let me know
AbhigyaShridhar
@AbhigyaShridhar
@shubhaml1 the error which you are getting means that you opened a string but didn't close it. You have a ' before from django..... You may not have paid attention while copying that snippet. Remove the '.
ayamqd
@ayamqd

Hello! I'm trying out the django tutorial and i'm at the deployment part, when i type the command " git push -u origin main " i get:
fatal: unable to access 'https://github.com/ayamqd/my-first-blog.git/': Failed to connect to github.com port 443 after 21123 ms: Timed out

can anyone help me with this? i think it's a proxy problem depending on what i found on google and since i'm on my work computer, but i don't know how to fix it

Raphael Das Gupta
@das-g
@ayamqd If this occurs on your work computer but not on other computers (or in your work data network, but not in other networks) you might have to ask your employer's IT department whether you're allowed to access GitHub from there and how to do it.
María Fernanda V
@Marifer1111

Hello everyone!
I'm just starting with Django and trying to make friends with it 😅
Now I'm having trouble with the CSS.
Most of the styling works, but there are some details that don't, like the navbar, the "collapse" effect opens but doesn't close, and there is a carousel div that isn't visible.
I had created my web design apart, to make sure it worked, and then incorporated it into my Django project.
I would appreciate advice from you.

Thanks!

AbhigyaShridhar
@AbhigyaShridhar
@Marifer1111 So, what exactly is the problem you're facing? The design works with plain HTML but doesn't work with your Django project?
María Fernanda V
@Marifer1111
@AbhigyaShridhar Hi!! My problem is that the design doesn't work completely. There are some parts that "lose" the effect.
AbhigyaShridhar
@AbhigyaShridhar
@Marifer1111 Run your django server and open the website in a tab. Than go to browser console. See if it shows any errors with the Javascript files you added in your project. It'll be more clear as to where the problem is.
María Fernanda V
@Marifer1111
@AbhigyaShridhar Thanks! I could see the error. The console display this error message: "Cross Origin Request Blocked: The same origin policy does not allow reading of remote resources at https://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true. (Reason: CORS request unsuccessful). Status code: (null)." I was reading about that error I'm trying some things but without success...yet
osbox68
@osbox68
Hi, I followed your tutorial and when I started to create the blog this error appeared. I don't know if it was something wrongly typed in the tutorial or I have problems. The error is "STATIC_ROOT = os.path.join(BASE_DIR, 'static')"
Raphael Das Gupta
@das-g

That's probably only part of the error message, @osbox68. Can you try to tell us the complete error message?

If I remember correctly, there can be a problem related to this when the used Django version doesn't match that of the tutorial.

Olga Roschel
@olgaroschel

Hey guys! I've been doing the tutorial for a few weeks and I stopped at this error:

WARNING: Package(s) not found: django
Traceback (most recent call last):
File "/home/olgaroschel/.local/bin/pa_autoconfigure_django.py", line 54, in <module>
nuke=arguments.get('--nuke')
File "/home/olgaroschel/.local/bin/pa_autoconfigure_django.py", line 38, in main
project.update_settings_file()
File "/home/olgaroschel/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 97, in update_settings_file
new_django = version.parse(self.virtualenv.get_version("django")) >= version.parse("3.1")
File "/home/olgaroschel/.local/lib/python3.6/site-packages/pythonanywhere/virtualenvs.py", line 32, in get_version
output = subprocess.check_output(commands).decode()
File "/usr/local/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/local/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/home/olgaroschel/.virtualenvs/olgaroschel.pythonanywhere.com/bin/pip', 'show', 'django']' retur
ned non-zero exit status 1.

It's in the Deploy part
how can I solve?

seiya-gif
@seiya-gif
Hey everyone! I have a question about pythonanywhere.
Does the 3.6 in pip3.6 represent the python version?
1 reply
shubhaml1
@shubhaml1
image.png
when i was trying trying to create a database on python anywhere it shoots up this error ? I've checked this file is installed in the directory correctly but still showing me the error that file not found
shubhaml1
@shubhaml1
image.png
AbhigyaShridhar
@AbhigyaShridhar
@shubhaml1 are you sure you are in the mysite direcctory?
shubhaml1
@shubhaml1
why i need to be in mysite directory ?
shubhaml1
@shubhaml1
manage.py file is in <username>pythonanywhere.com directory
ljbproductions
@ljbproductions
I'm creating my first blog and I have this error when hooking up my Git repository to my computer to the one on Git Hub. Error: fatal: '/path/to/origin.git' does not appear to be a git repository
fatal: Could not read from remote repository. I think it might have something to do with my file structure. Any help is appreciated.
María Fernanda V
@Marifer1111
Hi guys!
Does anyone know a way to save a list in MySQL?
The reason: I want to make a list in the HTML with a "features" column data.
Does anyone know of a 'Django method' to do this?
I've tried some stackoverflow solutions but they haven't worked.
I appreciate the help!
Raphael Das Gupta
@das-g

Hi @ljbproductions

What's the exact command you entered that gave you this error message?

@Marifer1111 The Django method of doing that is to write a Django Model class for representing features and then let createmigration and migrate create the corresponding table in the MySQL database.
vasyanyasha
@vasyanyasha
Hello everyone!
Im on Extend your application-Updating the static files on the server.
For some reason, when i updated my pythonanywhere part, it doesnt show posts. It only shows the header(Django girls and thats it)
Raphael Das Gupta
@das-g
@Marifer1111 If you've already gone through the Django Girls tutorial you might want to also go through the Django tutorial at https://www.djangoproject.com/start/ to learn more about the Django concepts and how to use them. The Django documentation is also very informative.
ljbproductions
@ljbproductions
Hi Raphael Das Gupta, I put in these commands: laurafisk@Lauras-MacBook-Pro Python Intro % git init
Reinitialized existing Git repository in /Users/laurafisk/Desktop/Python Intro/.git/
laurafisk@Lauras-MacBook-Pro Python Intro % /djangogirls/.git
zsh: no such file or directory: /djangogirls/.git @das-g
She Codes Australia
@shecodesaus_twitter
Hello! I am from She Codes Australia, we run a six-month coding program for women. We are about to commence our Django module and were wondering if you'd have anyone willing to mentor this module for a few weeks? Our sessions run out of the Queensland AI Hub in Fortitude Valley on Tuesday from 5:30 - 8:30 pm and Saturday 9 am - 2 pm. We would love to have you join us and our cohort of 24 amazing ladies who are already in week 7 of the program. We provide tea and coffee and all visual-audio equipment, it is a great time and involves a lot of networking with like-minded ladies. I hope to hear from you soon! Thanks - Paris, She Codes Events and Marketing Coordinator.
FYI, this position is paid! Email: Amandine@spacecubed.com or Paris@spacecubed.com for further questions 😊
Viktor Moskalenko
@vikmos
Всем привет!
Есть кто онлайн?
Raphael Das Gupta
@das-g
Um, not quite sure what you did there, @ljbproductions. Was there a reason to run git init again?

Hi Paris (@shecodesaus_twitter)

Cool! You may also want to ask on https://djangogirls.slack.com/ . Claire (@GirlGeekUpNorth) should be able to give you access, if I'm not mistaken.

Raphael Das Gupta
@das-g

Hi @vikmos, welcome!

There's no need to ask whether someone's online. If you have a question, just ask. If you have something to say or share, just write (as long as it's on-topic.) Maybe people will read it right away, maybe later.