Create a Django project in pydev from a mercurial repo - django

I like using the python editor pydev in Eclipse. I want to team up with some people who've a python project (actually a Django site) stored in a mercurial repo. Can one create a new Django project in pydev that grabs code from a Mercurial repo? If so, how?
Thanks
Arthur

Doing a google search on does eclipse support mercurial gives you:
MercurialEclipse - an Eclipse plugin for Mercurial support, and I would suggest to start from here. This should work regardless of what sort of project you're working on.
A discussion on whether it is better to use git or Mercurial with Eclipse, which can help you out.
Additionally, if you didn't want to install the MercurialEclipse plugin, you could use Mercurial independently of Eclipse, clone the repository and then start a project with those files. In this case I would just make sure that your project meta files are in Mercurial's ignore list so they wouldn't get pushed to the remote repository.
If there's anything you'd like me to elaborate on, please comment. Good luck.

Related

Spree Commerce - "Bundle install" (replace my files and lose info)

I am working on a e-commerce platform with Spree Commerce (RoR), each time I run
bundle install
command (after add a new gem), Spree change all my website (app)!!
I don't know why but Spree replace all my view, models and controllers files, ... it make me start all over again...
At first, I used to replace them with my backups, so far, I made so many modifications that I forget what files I've modified.
How can I disable the functionality to replace all my files?
Or any advise to work with it (install gems and stuff)
Thanks in advance
Do you use a DVCS as git? If not you should.
After bundle install which command do you are using?

Using virtualenv with legacy Django projects

I am finally going to start using virtualenv for my Django projects on my development machine. Before I start I want to know if there are any special considerations for dealing with my existing projects. My presumed workflow is something like:
make a new virtualenv
activate the new virtualenv
Install Django in there
pip install all the packages I know I need for my existing project
copy my Django project files, app files, and git files into the project folder within the virtualenv.
Edit
6. make requirements file for deployment
This is obviously very simplified but are there any steps or considerations I am fundamentally missing? Is git going to be happy about moving? Also is it best practice to have a separate virtualenv for each Django project?
I know this is not a typical code problem, but I hope those that know more than I do can point me in the right direction.
Many thanks.
I don't see any big issue on migrating your projects and I think your 5-steps plan is correct, in particular, for steps 3/4/5 (I'd merge them), you can handle project dependencies with pip, possibly using requirement files.
Requirement files are plain text files telling to pip which packages have to be installed in your virtualenv, included your git-tracked projects which eventually can be deployed in your virtual environment as development eggs (they bring with them version control infos).
Once you have a req file, it's a matter of:
pip install -r file.req
to have all needed packages installed in your env.
As you can see from virtualenv docs, a typical req file would contain something like:
django==1.3.0
-e git://git.myproject.org/MyProject.git#egg=MyProject
I usually keep each project in its own virtualenv, so I can deploy it to the production server the same way I do for local development.

Cloning a django project from hg using buildout and using it for development

I have a django project sitting in a bitbucket repository. Is it possible to automate using buildout, the following process:
1. Install django
2. clone the django project from hg repository
3. install the dependency modules of the django project
Update: I have achieved what I wanted to, with the help of mr.developer extension as suggested by Ross.
While doing that I had another question popping up. Which is the best place to specify the dependencies - in the buildout.cfg or in the setup.py of the 'develop' modules? For now I have duplicated the specification.
Generally, you make your checkout the buildout itself, so you'd place buildout.cfg and bootstrap.py in your project root. That way when someone checks out/clones your project, they just do the bootstrap/buildout dannce and they're up and running.
If you have multiple checkouts, then look into mr.developer.

Producing a WAR file from a django project with SQLite

I have a django project (a django module/app some other modules that are used from the django one) that uses SQLite. This project is for a University course and now I am asked to supply it in such a way so that it may be installed on some server in our faculty. I'm not the one who's going to install it, and I will not be contacted in case of failure, so I am looking for the easiest, simplest way to supply the project for installation.
I have come across django-jython which supposedly allows one to create WAR files from django projects. However, in the Database Backends section, it says:
SQLite3
Experimental. By now, use it only if you are working on improving it. Or if you are really adventurous.
My overall goal is to deliver this project and I would appreciate any helpful advice. In particular:
Is there another way to pack a django project into a WAR file that supports SQLite?
Is it safe to use SQLite with django-jython in spite of this warning? If so, then how?
Is there any other simple way to pack a django project so that it'll be a piece of cake to install?
If the above answers are "no", then what does it take to change the configuration of the project to use MySQL instead?
You should look into Fabric for easy deployment. I haven't used it myself, but I've heard good things.
I've also had good success quickly and easily setting up servers using Gunicorn with Nginx as a reverse-proxy.
As others have said, using virtualenv, with pip, can quickly
get all your dependencies installed via requirements.txt (from virtualenv).
Some of these blog posts may help:
Tools of the modern Python hacker - virtualenv, pip, fabric
Basic Django Deployment - virtualenv, pip, fabric, rsync
Easy Django Deployment - very quick nginx and gunicorn setup
Edit:
As I reread your post I saw your last bullet point/question. Django is designed to be loosely coupled, meaning that there shouldn't (in most cases) be reasons that one app is dependant on sqlite vs mysql. If you don't need to save the data in the db, changing to MySQL is as easy as starting a mysql server on your machine, and changing the settings.py of your django project. This SO question may help

Mylyn & Redmine Integration

I'm trying to get Mylyn and Redmine work together so I can manage tasks right inside Eclipse. I saw this on redmine wiki http://www.redmine.org/wiki/redmine/HowTo_Mylyn but I think it's for the old version of Mylyn.
I can't find the Generic Web Connector plugin for Mylyn but there's this Web templates plugin. I think that one replaced the Generic Web Connector. But it's quite different from the screenshots posted at the Redmine wiki. There's no Task URL, New Task URL, etc.
Here is what you are looking for:
http://sourceforge.net/projects/redmin-mylyncon/
A Mylyn connector specially for RedMine. It works fine with eclipse ganymede.
The update site is: http://redmin-mylyncon.sourceforge.net/update-site/N/
Here are the steps to perform integration between Eclipse Mylyn and Redmine.
I assume that Eclipse, Mylyn and Redmine are already installed, the latter somewhere in $REDMINE_HOME. Tested with Eclipse 3.7 and Redmine 1.2.1.
Summarily, you need to install an Eclipse plugin AND a Redmine plugin.
Go to $REDMINE_HOME/vendor/plugins and run
git clone git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector
(Re)start the server, and in Redmine under Administration/Plugins the Mylyn Connector Plugin should be listed
Again in Redmine, under Administration/Settings/Authentication, check the "Enable REST web service" field
In Eclipse, install the Eclipse connector via its update site
http://redmin-mylyncon.sourceforge.net/update-site/N/
Create your repository and check that it connects, then you are good to go!
See this manual.
http://wiki.eclipse.org/index.php/Mylyn_Extensions
Eclipse Menu.
Help -> Software Updates ... -> Add Site...
http://download.eclipse.org/tools/mylyn/update/incubator
http://www.redmine.org/projects/redmine/wiki/HowTo_Mylyn
http://danmunn.github.com/redmine_mylyn_connector/
https://github.com/danmunn/redmine_mylyn_connector
As of july 2012 now there is a new dedicated Redmine-Mylyn-Connector under active development for Redmine 2.x! (Got to admit, I haven't tested it yet.)
I am in the process of testing the 1.x connector that can be found on sourceforge, I will edit this post once I am done.
EDIT:
The update-site for the mylyn-plugin from the link in the accepted posting works.
As well as the mylyn-connector for the redmine installation. (Tested with 1.3.2 installation, don't forget to restart the web server after installing it. ;))
But both things aren't working out... once the mylyn-connector is installed, the web-interface is not working anymore. ;(
EDIT2:
The special connector works with 2.x and Mylyn finally looks proper.
http://danmunn.github.com/redmine_mylyn_connector/ the redmine server plugin.
http://kenjiru.ro/blog/2012/02/install-the-redmine-mylyn-connector-for-eclipse another server plugin link and the eclipse connector plugin
Will look like this.
As of yesterday, Sven has taken down the update site (if you go there, you'll find nothing) since someone reported him to Sourceforge (see https://sourceforge.net/tracker/?func=detail&aid=3441532&group_id=228995&atid=1075435).
So, there are NO binaries available now for Eclipse. Does anyone know of alternative ways to get these plugins? I have no clue how to compile.
The GIT and SVN repositories are there, but again as I sad, I'm not a java programmer. Can anyone offer Sven a site where he can store the binaries as an Update?
For retrieve redmine mylyn connector
https://github.com/ljader/redmine-mylyn-plugin
In eclipse juno 4.2
"Install new software" and as local archive like in this post :
How to install plugin for Eclipse from .zip
Also a good read from redmine.
HowTo connect a Mylyn repository to Redmine:
http://www.redmine.org/wiki/1/HowTo_Mylyn
download.eclipse.org/tools/mylyn/update/incubator wont work anymore, for the new update sites look at http://www.eclipse.org/mylyn/downloads/
The Web Connector could be found via http://download.eclipse.org/mylyn/incubator/3.5