Django website rendering as a total mess (intermittently, not always) - django

I have a website built in Django 1.5 that - at times - doesn't load correctly. And by not loading correctly, I specifically mean that if I type its url in my samsung s6 edge's mobile browser, I sometimes (but not mostly) see the page below. I am clueless regarding why this is happening (not much shows up in my logs), and how I can troubleshoot it. Please advise.

Unfortunately you didn't include enough information in your post to properly debug your issue. Also, Django is now on version 1.8.5 and it may be possible that your issue has been patched since then.
Posting your source code is the best way to get help on issues like this.
If you are trying to troubleshoot it yourself and your app is using logging properly you should try writing unit tests for the various components that make up your app.

Related

How to accelerate the landing web page using Django on Digitalocean?

I created a "landing page website" using Django, it's a very simple website for using just for showing up the data with no query sets that coming from the database it's just 3 or 4 queries.
I'm using the Nginx server for deploying and everything working properly but just the loading of the page is very very slow, I don't know where can I find the issue. I thought that the problem might become from Nginx since it has the ability to manage static files and also, I thought about maybe droplet cause such that issue.
my brain is frozen about finding the core of that problem where I can't think of where the problem may happen so, how can I accelerate my web page, and what are the reasons for that problem?
I don't know if StackOverflow is a good choice to ask such that question or not but I will be grateful for solving that problem in advance

Django completely broken even after reinstalling it

Let me preface this by saying that my knowledge on django and web development in general is very superficial.
I was messing around with security configs on my django project, trying to make my website use https (which since then I learned is not that easy to do) but I got it into a redirect loop I believe (the website never loads). I tried to revert all my changes but couldn't get to run the website locally. After looking for answers on google in vain I decided to start the project from scratch (I had just started it anyway). But now even that doesn't work, even the Writing your first app tutorial doesn't work.
After that I reinstalled python and all the dependencies expecting that to clear every possible thing that I had changed but it didn't, still the same problem, websites never load trying to use https.
Where else could the problem in my system be?
Deleted cache and cookies and it solved the problem.

Ember: app not being fetched by Google

Having tested a simple (hello world) app in ember a few months ago, I was really excited because I knew that Google was able to fetch and therefore index it. Another app I built in Angular a few years was also being indexed! So I pressed on with my ember development and now have an application ready to deploy. This uses a PHP/MySQL backend api.
Today, I uploaded the production build to a server and then checked things in webmaster tools using the fetch and render tool. This time, nothing is being rendered !!!! I have double checked and uploaded the hello world app to the same server, which was fetched and rendered without any problem. I have absolutely no idea why this is happening!
I then looked at ember-cli-fastboot (having not really worried about it before because I thought that Google could index single page apps) and when I run
ember fastboot --serve-assets
I get
jQuery is not defined
ReferenceError: jQuery is not defined
So I'm now at a complete standstill after a lot of work!
Any help in resolving this would be much appreciated! Ideally I don't want to have to use fastboot, but if I have to, I'm not sure how to resolve the above issue.
unfortunately, ember-fastboot has some limitations and jQuery is one of them. You could use Phantom-based prerender instead.

django with mongodb giving a 504 Gateway time-out

So, I am writing a django-mongo app, using mongo for storing files as well, and using the python files mongoforms and mongoengine. Things were going well for a while, but just recently I have started to get 504 errors. I am using nginx -> apache (mod_wsgi) for non-static files.
Other (non-mongo) django apps on the same server are working, as are static html pages served up by ngnix. Also, if I turn off mongodb entirely, I get the normal django debug=True error page, so when mongo is just turned off it seems that nginx, apache, and django are all able to function.
However, with mongo in the picture I am now unable to get a response. I am able to use the command line interface to mongo, and although I'm only using the 32b version, it says that I'm only using 0.0625GB for the database in question.
So, I realize this isn't enough information to figure out what my problem is, but that's more or less what I'm looking for: where do I look next? I can connect to mongo, but not via django, although I used to be able to. I've tried commenting out virtually the entire django view, just leaving the index call which is not even asking for anything from mongo, so what I'm looking for is where do I look next? Are there any debugging techniques for mongo where I can figure out why it's taking so long to respond to django? Any other ways to debug this?
I don't expect anyone to miraculously solve my problem here but telling me what info to look for next would help as I don't have much experience debugging the django-mongo connection. It worked at one time but it has stopped working and I'm not sure where to look.

Running Mezzanine on App Engine

I am looking for a blog solution to run inside a Django project deployed on the Google App Engine. After a bit of review I decided to try out Mezzanine v0.11.3. I've overcome the hurdle of getting it in project using the advice of others deploying on App Engine at this link: http://groups.google.com/group/mezzanine-users/browse_thread/thread/c8b13c41a3168c94.
Mezzanine is now showing up in the Admin, but clicking on Blog posts leads to a multi-table inheritance failure. I believe that this is due to multi-site support functionality in Mezzanine via use of the Django sites framework.
Has anyone overcome this issue? I'm going to try to use django-dbindexer but I'm not confident it will work.
*Update: as far as I can tell, the folks at AllButtonsPressed don't have any magic solutions to work around ManyToManyField issues yet, so I think that option is dead.
If no one knows a work around, do any of you know of a good blog solution I can run inside a Django project on the App Engine?
*Update: found this post Integrating Blogger into a Google App Engine App. Will investigate if this solves the problem.
*Current Status:
I have not been able to solve this problem and I don't think it is currently solvable. Thought I would share what I found through my investigations though; maybe someone out there can carry on and come up with a solution.
Options tried:
Bloog
I looked this over but it is a Python
solution, not a Django solution and I
didn't want to do the work to turn it
into one
Byteflow ( https://bitbucket.org/piranha/byteflow/wiki/Home ) notes:
designed to be standalone, will need a
lot of edits to settings.py,
inclusion of 12 additional apps and
overrides on account settings plus
hand tuning at every upgrade.
AppEngineBlog ( http://code.google.com/p/appengineblogsoftware/ ) notes:
written in appengine specific code,
not maintained, no example sites
available to see how it looks
Coltrane ( http://code.google.com/p/coltrane-blog/source/browse/ ):
simple blog constructed from standard
Django functionality no development
or support, basically need to use
this code as a way to develop your
own blog and go from there
Flother ( https://github.com/flother/flother ):
found via Coltrane comments, probably
embeddable without too much trouble,
requires 8 additional apps,the photos
and places components have
ManyToManyFields that would have to
be re-written or these components
disabled
Blogger API ( http://code.google.com/apis/blogger/ ):
use Blogger at whatever location you
wish to gain fully functional
blogging capabilities, then use
Blogger API to deliver content to any
other site you wish to display it
Flother came close to what I need but there is still a fair bit of uncertainty and effort there. I'm proceeding with the Blogger option as the only viable choice for me at this time.
Well, as far as I can see, there is no way to get Mezzanine running on GAE other than wading into the code and ripping out anything relating to a ManyToManyField (Sites support, Photos and ... something else. Can't remember what).
The only thing I could find out there that has the potential to be added to an existing project, uses only portable Django code (app engine specific) and runs on App Engine is http://www.allbuttonspressed.com/projects/allbuttonspressed . I haven't actually tried to integrate it yet because I'm going to see if the Blogger solution works.
I've been using bloog for two of my blogs without any serious troubles so far - there are few little quirks that make it mildly unpleasant sometimes but nothing that's been a deal breaker.
I use the Blogger solution and it works fine, especially if you're only one person and you run the whole site.
The problem comes when you want to others to help you out. Now every css and design decision needs to be sent to a programmer who hacks away at django templates. A CMS with a real WYSIWYG editor would allow you to ship off that work to marketing/design people and let you focus on the fun stuff.
I came across a decent review of the various blogging engines for Django, however, it's unclear how well they each integrate with GAE.
I have deployed Mezzanine/Cartridge in GAE succesfully but I have not documented it yet in github or something like that. It works using python 2.7 of course and django 1.5. Additionally it works with Google Cloud SQL, and the local file system GAE provides. It additionally works with google gmail facilities. For thumbnailing I am using local GAE functionality.
It requires several additional libraries like boto, but it works well.
See a short demo in midevocional365.appspot.com/