Testing gevent-socketio on Django - django

I have a django site which uses gevent-socketio for a word game and I would like to automate the tests.
Since gevent-socketio implies user interaction and JavaScript actions I'm stuck in how to start writing tests.
Anyone can point me in the right direction?

Here are some referrals:
selenium. Basically, it's testing in a real browser that django can integrate with by the help of LiveServerTestCase.
mechanize - programmatic web-browsing. It's a very powerful tool, definitely worth looking. Note that it can "talk" to javascript.
sikuli - testing tool that works using screenshots. Very powerful too, but may be a bit too exotic in your case.
Hope that helps.

Related

I built the front-end of my MVP. Now, what do I do next?

I am stuck on taking the next steps to delve into backend for my first SaaS project.
I have created the front-end and now require the backend and server-side aspects but, as a total beginner, I am lost as to where to go from here. I have looked into AWS, deployment and the related on a fundamental level but am not sure if I am still going in the right direction, and cannot understand half of what I am reading/watching.
Help would be amazing.
If you need to build a backend for web applications, there are some easy to learn web frameworks that I'd suggest.
Django - Python: https://www.djangoproject.com/
Node.js - Javascript: https://nodejs.org/en/
Ruby on Rails - Ruby: https://rubyonrails.org/
If you come from a frontend background, Node might be your best bet because you may already know JS. I prefer Django, but all three of these frameworks are very robust and can support a small MVP and scale all the way up to huge deployments. Good luck.

Twitter in Django

I have to create web application similar to twitter with a few tweaks using django. I am clueless if I have to use a CMS for this or any other existing django-application. Working from ground up is quite tedious to be honest. Can anyone recommend me which CMS( or anything else) I should attempt trying?
There is a project called trillr1. According to its page:
"Trillr is a Twitter-like microblogging service enhanced with user directory and group discussion features. " that's maybe what you want.
https://contributions.coremedia.com/trillr1
I guess, the closest you can come with an out-of-the-box software to imitate Twitter is Status.net, the software, that powers identi.ca. However, this is a PHP application.
I'm not aware of something similar in the Django world.

Load Testing for Django Application

I have been looking for a tool to load test my django application. I was wondering if there is go to one for django web applications. I am required to login and place various requests to the site as multiple users and see how the site scales with traffic.
I have come across the following framweworks:
Seige
JMeter
Funkload
I was wondering if the community had any opinions on which is best, and fit together best with the django web application.
I welcome suggestions to any that I haven't mentioned as well.
Please and thank you
If you don't need to use javascript, and aren't looking to test your web server, I'm a huge fan of mechanize for this exact reason. spawn off several instances of mechanize that traverse your site, and you can get a very good idea of where your performance issues lie.
That said, if you do need javascript for anything, mechanize will not work as it has no ability to handle javascript. In this case you need to use selenium or webdriver. I've recently combined selenium with nunit for extremely great success. you can run several selenium instances and use selenium-rc to remotely track/control them. If you have some cash, browsermob does a fantastic job of this for you.
If you need to test your web server, look no further than apache bench.
Edit: This is my preferred approach. JMeter is very cool, but I found it a pain to use and an eyesore. YMMV though.

Django App for Academic Journal?

I'm looking a Django app I'm looking for an app that that allows for management and integration of footnotes for articles
just wondering if anyone had seen something around...
It's certainly not a perfect fit, but I wrote a Django app that supports annotations and footnotes on texts, although the app concentrates more on annotations. If you have the time to read source and adapt it to your needs, clone the app from GitHub.

Web technology for a first small web project

I'm a C++ developer with basic Python skills. Here's the task, a friend of mine is running a small company and he asked me if I can make a website for him. I have no real deadline so I think it's a perfect opportunity to try sth new and do some web development.
User has to be able to add photos, change texts ect.
Do you think that Django would be an overkill for this kind of project? I have no experience with it. Perhaps I should try to customize some blog engine or Google Sites?
You may be interested in Google App Engine (http://code.google.com/appengine) which recently exhibited a rise in popularity. The application runs on Google's servers, eliminating the need to maintain Apache and worry about up-time. You basically get a Django-based solution with a data store, with an SDK which allows you to conveniently develop an application on your desktop and then upload it to appspot.com for everyone to use.
The documentation is great, and even if you eventually decide not to use it, the tutorial is excellent for getting you up to speed on Python and webapp design. There is also a codelab which contains a simple Wiki example.
If you need to set up quickly a very simple website, Wordpress can be the perfect choice.
Wordpress is born as a blogging platform, but in the newer version you can manage pages, contact form and so on. And you can find good plugins to expand its capabilities.
The administration interface of wordpress is clean and easy to use, the page or article editor is simple and powerful. Add an image in a post or in a page is easy and intuitive as in no other opensource CMS I've seen.
Django is a pretty flexible framework, it tends to scale well both up and down. It may be overkill to have to learn the whole API for just a simple site, but if you're looking to learn something new, and have some time to spare, then it's a fun platform to learn and work from. My suggestion would be to install the API and have a play around with it, read the Django book and see how you get on.
Maybe before diving into Joomla or Django a first step should be working with the technologies in a raw, pure way. Create a simple web page that excutes some server side script (python? php?) that retrieves data from a mySQL database and displays it. Throw in a little javascript too. Just so that you feel comfortable with the bare-bones fundamentals.
Then when you dive into the big frameworks and libraries, they won't seem so magical.
If you're really asking what the best tool for the job is, then you are going to have to give a little more detail than "first small web project." If what you are asking is more along the lines of you want to learn web application development and what you already know is C++ and python so what would be a good web application stack where you can leverage your current skillset, then here are some more suggestions.
Django is pretty cool. Every one has already talked about it here. As mentioned earlier, the google app engine is sort of based on Django.
Also, consider zope which is another python based web application container.
If you wanted to leverage your C++ knowledge instead, then consider Wt.
Why don't you take a look at the hello world examples for all three and decide which one looks the most interesting to you?
There are a multitude of website frameworks and kits that you could go with as opposed to starting development work from the ground up. It really depends on what kind of technology you want to go with, and how comfortable you feel with the language's potential. As mentioned above, there are things like Joomla, and If you want to stick to PhP frameworks, you could also use Drupal, which has a ton of documentation and support, and is relatively easy to understand.
If you want to venture into the Microsoft realm, you could look into DotNetNuke. It too is much like Drupal and Joomla, so it's a nice CMS framework, which you might feel more comfortable with since ASP.Net is based off of a programming language as opposed to a a scripting language, unlike Classic ASP or PhP. If you're going to go the Microsoft route, I also recommend taking a look at their BizSpark developer program - but that's more dependent on how serious your friend is on running his site as a business.
Then you also have a lot of things offered up by Google, such as their charts and visualizations -- which doesn't seems like something you're looking for, but for future reference, or cool little things like a map mashup.
It really depends on how much you're willing to learn and how much time you have and sometimes not having a rough deadline is the worst possible thing that could happen. Naturally everything starts to take longer. By the time you're done, the tech is either out of date, or you've taken so long that the business plan has changed.
using django it is easy, there is already an application for photo albums available at http://code.google.com/p/django-photologue/ it becomes with tagging too and maybe you just need to add some jquery effects to get done your site.
To get this done you just create a django project, add the applications to your settings, configure your urls and templates, and thats it.
Also i f you need a small version you can just use this code as a base of your new app.
have fun with django!!
sergio
Pylons is an excellent Python web framework based on WSGI standard. It has ported many of the features of Ruby on Rails so is great for rapid development.
I've been using it for a few years now combined with SQLAlchemy for my database layer and I've found it perfect for development of all my web sites.
It is easily good enough for production sites too.
The one downside I've found is slight complications getting it deployed on shared hosting but as long as you have shell access to your host, you should be fine.
You may try to install and customize Joomla (http://www.joomla.org/) It's full of stuff, easy to use and easy to customize also.
Everybody reaches for a framework, but, assuming this is running on Apache, why not just server side includes, and, since you have Python experience, Python CGI scripts that emit JSON for use in the UI by Javascript. By going with CGI/SSI you defer your decisions about framework and/or templating system until later, when you have more experience under your belt, but you should be able to get a reasonable amount of re-use of whatever Python code you write.
I'll cast my vote for Drupal (http://www.drupal.org)
I think LOVDbyLess might do exactly what you want. If all you need is basic blog and photo upload and a simple SNS, then check out this Ruby-on-Rails open-source thing. It's been evolving with new features and is pretty easy to set up.