I can't sign into the Django admin login page - django

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.

Related

Cpanel Django ERR_TOO_MANY_REDIRECTS on Admin/Auth/User and Admin/Auth/Group Pages

I'm doing a project for a client using Django and have finally installed it on CPanel.
Everything seems to be working great, but when I try to access the admin panel, the tables group or user has an error because it says it's doing a lot of redirections.
In the admin panel, I just have this:
When I try to register something, it loads the page, like this:
But when I try to access the tables, it shows me an ERR_TOO_MANY_REDIRECTS, as shown in the following picture:
It basically says that it's not working and to try to delete my cookies. I did that, and nothing worked. In the urls.py I only have the admin path so the redirection problem is not from something I miscofigured there.
I haven't modified the installation parameters for settings.py besides the Allowed_Host variable to allow the URL of the page, the database connection using PostgreSQL and its working, and the variables of the static files are also working.
So I'm feeling deadlocked because I can't find an answer to this and I don't believe I'm the first one experiencing this.
EDIT: The only new thing that I found is this and as I said I haven't even created files yet so I don't know what Index is this:
If someone knows anything, please let me know.

Magento 2 cannot login admin because form key invalid

I'm in a brain-breaking problem here. I've created a nice Magento 2.1.7 installation with two websites (two stores, two domains) and somehow after a while we are unable to login the backend of Magento.
Invalid Form Key. Please refresh the page.
Now, after trying a few options, still no success. Checked core_config_data, edit max_input_vars, nothing works. The strange thing is, on the front it's still possible to checkout and do your shopping.
Anyway, I'm stumped here. Why is this happening, and how can this be fixed. Any help is welcome.
I often get this error, clearing the cookies for that site, then opening the admin panel in a new tab will resolve this.
You can recreate this error message if you double click the login button after filling out your login information.
Here are a few other reasons you may experience this issue
The form key inputs are outside of the form, you should check the html on the admin panel to check these inputs and exists and have correct values
Make sure the link you use to get to the admin page does not already have a form key in the url
Does this issue generate anything in var/log/system.log ?
Eventually, nothing helped, but what did the trick was creating a new install, setup this new install with all necessary modules (fortunately there were only four), configure the fresh installment like the old one (long live GitHub) and compare your fresh installation to the old one in the database table core_config_data. Basically reproduce your entire setup without any products in it, but just create your stores and categories.
If you spot any differences between the new installment and the old one in the core_config_data, edit them in the old one to be the same as your new one.
Next, edit your env.php with the database credentials to the old database which you've compared and edited.
And the last step, recompile, flush/clean cache and reindex.
Oh, and word of advice, if you're going to use https for your store, setup magento on https. I think something went very wrong when we've changed the base url's from insecure to secure.

problems with database after moving live drupal site to local site

To move my live drupal 8 site to a new local site I followed this tutorial by OS Training on YouTube. I am aware that they are doing the migration the other way around, but it shouldn't make that big a difference I guess.
They tell you to start by creating your new drupal 8 site and then moving some folders between your old site and the new one. The last step is to import your old database into the database of the new site.
I did all that but when I visit my new local drupal 8 site it first appears to show nothing until you scroll A LOT and then I'm able to get to things like my content and content types, where I see that nothing has happened. If I go check the database of the new site I see that everything is there that should be there, but I just can't get it to show up on the site itself.
I guess there's something wrong with the connection to the database, but I have no clue how to fix it. Any ideas?
-sidenote: I am using Acquia Dev Desktop to set up my local site
Compare the sites/default/settings.php file between live and local.
Make sure you have cleared all caches and rebuilt the DB. Also, check for errors using chrome developer console and write them down here.

Django Install Not Visible - No Errors

I recently did a successful Django install, and everything went as expected. No errors. But, nothing shows up. It is as if I had never installed Django.
There are no errors. Checking Django/Python versions returns as expected. From the console, I can create new projects/apps, run migrations, create users, etc. Everything seems to work. Except, when I go to mydomain.com, it just loads the old site's index.html as if Django doesn't exist.
I realize the above question isn't a good question. I figured out my problem before posting the question and decided to post my answer below with the question for future reference should others have the same issue later.
After the fruitless task of deleting and recreating my project files, I eventually figured out what happened with my Django installation. I had never enabled Passenger. On the web host in this case, DreamHost, it is just a simple checkbox in the control panel to enable, but I never did.
Other than the fact that I should have remembered I need to do enable Passenger for Django to show up, a couple things should have tipped me off. There was no tmp folder with a restart.txt file. I manually added it (that file's important), but didn't stop to think about why it wasn't there. Also, the html files were loading without being in the public folder.
That gave me an hour or so of frustration today, so I thought others might google this later and find this useful. Searching for "Django site has no errors but still doesn't work" wasn't a fruitful avenue for me.

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.