Django when I ran server(manage.py) nothing shows up? - django

I am working on Django web framework , Its been almost one year.
Today I ran into strange problem. when I run my manage.py runserver command on Django and try to see result in browser nothings shows up page is blank. Till yesterday it was fine. I am absolutely blank what to do.I though Due to Java script problem but even 127.0.0.1:8000/admin page is not showing.
I tried to change the port number ,used private browsing mode on browser both firefox and chrome still it shows nothing.
What is the problme? I tired to google it sstill I couldnot find solution of my problme. Need your help.
Thanks

Related

Installed version not tested with active version of WooCommerce 4.4.1

I continue to get this error message on my wordpress front page:
Warning: Cookie paths cannot contain any of the following ',; \t\r\n\013\014' in /var/www/aveugle-shop.com/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 1035
I can't figure out why this message is showing?
My hosting said that it was because they updated their php database (or something), and all i needed to do, was to run back their old one, by inserting a snippet into .htaccess file.
This worked for a day or two, and now it's showing again.
Do anyone know what the actual issue is, and how to fix it?
My woocommerce status also says this on a bunch of plugins, and i don't know if that's the fault:
Installed version not tested with active version of WooCommerce 4.4.0
I dont know if this is the correct solution but I got the same error just now.
It happened to me when I upgraded PHP from 7.2=>7.4.
It seems to originate somewhere from the database because I solved it by just importing the database again from my testserver, same database, same codebase but all of a sudden, it started to work after reimporting db... A cache issue maybe?

I can't sign into the Django admin login page

I have started multiple Django projects with like four different tutorials. Every single time I try "python manage.py createsuperuser", the admin login page just loads and loads and never goes anywhere. I want to make it absolutely clear that I haven't touched a thing in the code and everything is default code. I migrated everything before login. I've tried deleting the database and re-migrating. None of that works. Can someone help me? I have made around 10-15 accounts and NONE of them work. The page just keeps loading indefinitely and never goes anywhere. I've looked at EVERY stackoverflow post and no answers work. I started a virtualenv, downloaded Django, didn't touch the code, made migrations, I followed every tutorial TOO THE LETTER(!!!) and this is what I keep getting. The current tutorial hasn't changed in default code and he signed in with no problems. I'm assuming if he did, I can...I don't think putting code in is necessary since it's all virgin code, never touched. I didn't even make any apps yet.
I've tried deleting database and re-migrating
changing the password of current superuser
deleting the entire project and following everything the instructor said (TO THE LETTER!!!)
I have made 10-15 superuser accounts and none work
This sounds similar to a problem I was seeing. I wrote a question for it here (no answers yet): Django local dev server hangs with chrome after form submission. Works in firefox
Are you using windows and the chrome browser? Try using firefox to access the admin page and login. That worked for me. I'm still trying to figure out why Chome doesn't work, though. Like you, I created a brand new project from scratch; sometimes Chrome works and most of the time it doesn't. I've also found that hitting the stop button while the browser is sitting there thinking, then refresh, makes the logged in admin page show up.

Django will run the function content twice when using render

I am sorry that my English is not good. My problem is that refreshing the page in Google Chrome will cause the function with render to run twice But run it once in the Firefox browser. I don't know if this is a problem with Google Chrome or something else?(I hope to get help, thank you)
def add_teacher(request):
Teacher.objects.create(username='zhangs',avatar='https://static-image.xfz.cn/11.jpg',jobtitle='a',profile='b')
print('==')
return render(request,'course/course_index.html')
Both Google and Firefox run the same content.
Two teachers' data will be created when Google Chrome refreshes the page, But only one piece of data is created when Firefox is running. Pycharm will also print two ‘==’ content when Google runs. Print one on Firefox.

Django & Geraldo Reports error pdf not displayed correctly

I'm using Django 1.6.1 and Geraldo Reports 0.4.17, Firexos 24.3.0. Both in DEV & production environments I get the error "This PDF document might not be displayed correctly. In production,using Nginx 1.0.15 and gunicorn 18.0. Only browser used is Firefox.
If I run 2-3 reports or run one, then go any page and then run another report or even same as before, error comes up. If I restart Nginx & gunicorn, any report shows up perfect, until error again.
Checked for errors on nginx access & error logs, guninconr & django logs and there is no error reported to this issue.
When calling the reports I was originally using the standard 'generate_by method' and then when seeing this report in DEV env, changed it to 'generate_under_process_by' method. Unfortunately, that does not help.
How can I troubleshoot / solve this issue? Is there something I am missing?
Thanks.
I realized I was using the same HTTP response variable for all reports. I must define its value inside each report, even if it's repetitive.

dev server hiccups after saving from in Django admin

This is starting bug me: whenever I use the django admin to add or edit a record, I hit save and expect a confirmation page, but the result is a page that tells me the website is experiencing an error (it's not a Django page with a traceback, just a default view in my browser). If I hit reload or back in the browser, it takes me back to the user form. Even though the confimation page doesn't display, it never fails to save my entry in the database, so it's apparently just a problem generating/serving the confirmation page.
Has anyone else had this problem? Am I missing something obvious?
My server: Django dev server
My browser: Internet Explorer 7 (but same problem occurs with any broswer I use)
My OS: Windows XP
I got such a behaiviour when I overwrote __init__ incorrectly. Or to be more precise when switching to a new version of Django with these worng __init__s. That was the day I started to love signals :D.
Can you post your models?
This is certainly not how it's supposed to work! Have you been messing around in the Django codebase at all? The first thing that comes to mind here is a "pdb.set_trace()" left by mistake somewhere in the change_list codepath. Off-hand I can't think what else would cause the server to simply not respond.